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 2a024bd48aa79b7e377cf20e5972d360b6a758c2..f433076ca121800ed16439d49351a8785afac8ef 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;