Add checks to the return value of EVP_Cipher to prevent silent encryption failure.
[openssl.git] / ssl / d1_pkt.c
index ed246a007807c9c59e96664e28f9154254150377..2952bccc5eb58ab8dfd3796581851cb73ae62c95 100644 (file)
@@ -1632,7 +1632,7 @@ int do_dtls1_write(SSL *s, int type, const unsigned char *buf, unsigned int len,
        if (eivlen)
                wr->length += eivlen;
 
        if (eivlen)
                wr->length += eivlen;
 
-       s->method->ssl3_enc->enc(s,1);
+       if(s->method->ssl3_enc->enc(s,1) < 1) goto err;
 
        /* record length after mac and block padding */
 /*     if (type == SSL3_RT_APPLICATION_DATA ||
 
        /* record length after mac and block padding */
 /*     if (type == SSL3_RT_APPLICATION_DATA ||