Fix no-sm2 with clang
authorTodd Short <tshort@akamai.com>
Fri, 18 May 2018 18:54:01 +0000 (14:54 -0400)
committerMatt Caswell <matt@openssl.org>
Tue, 29 May 2018 16:03:14 +0000 (17:03 +0100)
Return immediately upon discovery of bad message digest.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6298)

crypto/ec/ec_pmeth.c

index 5be292379a1043cb9f6ba2b364b0fd1378f70c07..2fde4f7a5b9a952415ee417194cde65ef9a2a4dc 100644 (file)
@@ -124,7 +124,7 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen,
 
     if (ec_nid == NID_sm2) {
 #if defined(OPENSSL_NO_SM2)
-        ret = -1;
+        return -1;
 #else
         ret = SM2_sign(type, tbs, tbslen, sig, &sltmp, ec);
 #endif