Fix no-sm3 (and no-sm2)
authorTodd Short <tshort@akamai.com>
Mon, 19 Mar 2018 17:21:13 +0000 (13:21 -0400)
committerMatt Caswell <matt@openssl.org>
Mon, 19 Mar 2018 18:49:19 +0000 (18:49 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5677)

Configure
crypto/ec/ec_curve.c
include/openssl/sm2.h

index a85beeaf6ef03c6cdf0efd42f5a0bf065cbdb817..0934088d2ddab77fda552ddb779764d960b529ec 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -486,6 +486,7 @@ my @disable_cascades = (
     "tests"             => [ "external-tests" ],
     "comp"              => [ "zlib" ],
     "ec"                => [ "tls1_3", "sm2" ],
     "tests"             => [ "external-tests" ],
     "comp"              => [ "zlib" ],
     "ec"                => [ "tls1_3", "sm2" ],
+    "sm3"               => [ "sm2" ],
     sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
 
     sub { !$disabled{"msan"} } => [ "asm" ],
     sub { !$disabled{"unit-test"} } => [ "heartbeats" ],
 
     sub { !$disabled{"msan"} } => [ "asm" ],
index 01d56543dbd58a81cc92f4269bd8ac58a88ec719..46cbe22e0593acc4e61d793885206821d42c9c35 100644 (file)
@@ -2997,8 +2997,10 @@ static const ec_list_element curve_list[] = {
      "RFC 5639 curve over a 512 bit prime field"},
     {NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0,
      "RFC 5639 curve over a 512 bit prime field"},
      "RFC 5639 curve over a 512 bit prime field"},
     {NID_brainpoolP512t1, &_EC_brainpoolP512t1.h, 0,
      "RFC 5639 curve over a 512 bit prime field"},
+#ifndef OPENSSL_NO_SM2
     {NID_sm2, &_EC_sm2p256v1.h, 0,
      "SM2 curve over a 256 bit prime field"},
     {NID_sm2, &_EC_sm2p256v1.h, 0,
      "SM2 curve over a 256 bit prime field"},
+#endif
 };
 
 #define curve_list_length OSSL_NELEM(curve_list)
 };
 
 #define curve_list_length OSSL_NELEM(curve_list)
index a3c055b199fe58fe16ec231dacabf5dc4d9ca85e..24ee7657b843166a1f5642ce8e8fd24320516e3e 100644 (file)
 
 # ifndef OPENSSL_NO_SM2
 
 
 # ifndef OPENSSL_NO_SM2
 
+#  ifdef __cplusplus
+extern "C" {
+#  endif
+
 #  include <openssl/ec.h>
 
 /* The default user id as specified in GM/T 0009-2012 */
 #  include <openssl/ec.h>
 
 /* The default user id as specified in GM/T 0009-2012 */
@@ -74,5 +78,9 @@ int SM2_decrypt(const EC_KEY *key,
 
 int ERR_load_SM2_strings(void);
 
 
 int ERR_load_SM2_strings(void);
 
+#  ifdef __cplusplus
+}
+#  endif
+
 # endif /* OPENSSL_NO_SM2 */
 #endif
 # endif /* OPENSSL_NO_SM2 */
 #endif