In BIO_write(), update the write statistics, not the read statistics.
[oweals/openssl.git] / crypto / asn1 / a_sign.c
index 1081950518c7b7fdea470c876523f58ace22124b..4dee45fbb83ab3a048ed85fad2f3a426be6fb7ac 100644 (file)
@@ -267,7 +267,12 @@ int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
                goto err;
                }
 
-       EVP_SignInit_ex(&ctx,type, NULL);
+       if (!EVP_SignInit_ex(&ctx,type, NULL))
+               {
+               outl=0;
+               ASN1err(ASN1_F_ASN1_ITEM_SIGN,ERR_R_EVP_LIB);
+               goto err;
+               }
        EVP_SignUpdate(&ctx,(unsigned char *)buf_in,inl);
        if (!EVP_SignFinal(&ctx,(unsigned char *)buf_out,
                        (unsigned int *)&outl,pkey))