PR: 2118
authorDr. Stephen Henson <steve@openssl.org>
Mon, 30 Nov 2009 13:53:42 +0000 (13:53 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 30 Nov 2009 13:53:42 +0000 (13:53 +0000)
Submitted by: Mounir IDRASSI <mounir.idrassi@idrix.net>
Approved by: steve@openssl.org

Check return value of ECDSA_sign() properly.

crypto/ec/ec_pmeth.c

index 2a024bd..f433076 100644 (file)
@@ -143,7 +143,7 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
 
        ret = ECDSA_sign(type, tbs, tbslen, sig, &sltmp, ec);
 
-       if (ret < 0)
+       if (ret <= 0)
                return ret;
        *siglen = (size_t)sltmp;
        return 1;