From 056130c05367371822c9024b1f32f6de3150a29d Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Tue, 13 Mar 2018 12:44:00 +0800 Subject: [PATCH] fix ssl bugs --- ssl/statem/statem_lib.c | 2 +- ssl/statem/statem_srvr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c index ceb0b89b..d95c6ba7 100644 --- a/ssl/statem/statem_lib.c +++ b/ssl/statem/statem_lib.c @@ -566,7 +566,7 @@ int tls_get_message_body(SSL *s, unsigned long *len) #ifndef OPENSSL_NO_SM2 static int ssl_cert_type_ecc(const X509 *x, const EVP_PKEY *pk) { - if (x && X509_get_signature_nid(x) == NID_sm2sign) { + if (x && X509_get_signature_nid(x) == NID_sm2sign_with_sm3) { if (X509_get_key_usage((X509 *)x) & X509v3_KU_DIGITAL_SIGNATURE) return SSL_PKEY_SM2; else diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 831a75aa..36d29792 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -690,7 +690,7 @@ int ossl_statem_server_construct_message(SSL *s) case TLS_ST_SW_CERT: #ifndef OPENSSL_NO_GMTLS if (SSL_IS_GMTLS(s)) - return tls_construct_server_certificate(s); + return gmtls_construct_server_certificate(s); #endif return tls_construct_server_certificate(s);