Add checks to the return value of EVP_Cipher to prevent silent encryption failure.
[openssl.git] / ssl / s3_enc.c
index 6b71323..63774bc 100644 (file)
@@ -556,7 +556,8 @@ int ssl3_enc(SSL *s, int send)
                        /* otherwise, rec->length >= bs */
                        }
                
-               EVP_Cipher(ds,rec->data,rec->input,l);
+               if(EVP_Cipher(ds,rec->data,rec->input,l) < 1)
+                       return -1;
 
                if (EVP_MD_CTX_md(s->read_hash) != NULL)
                        mac_size = EVP_MD_CTX_size(s->read_hash);