From 95c0dba728e600aa39d176784d9c37587dc720fd Mon Sep 17 00:00:00 2001 From: zs <84500316@qq.com> Date: Mon, 22 Aug 2016 17:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=EF=BC=88=E6=BC=8F=EF=BC=89?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=B4=E6=98=8E=E8=A7=81https://github.com?= =?UTF-8?q?/zsdev2015/GmSSL/commit/5c315bca3f08e706e6a81a133575cda315012e4?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ssl/ssl_lib.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index dd74a02d..3d9ea9bb 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -2585,9 +2585,16 @@ EVP_PKEY *ssl_get_sign_pkey(SSL *s, const SSL_CIPHER *cipher, idx = SSL_PKEY_RSA_SIGN; else if (c->pkeys[SSL_PKEY_RSA_ENC].privatekey != NULL) idx = SSL_PKEY_RSA_ENC; - } else if ((alg_a & SSL_aECDSA) && + } +# ifndef NO_GMSSL + else if ((alg_a & SSL_aSM2) && (c->pkeys[SSL_PKEY_ECC].privatekey != NULL)) idx = SSL_PKEY_ECC; +# endif + else if ((alg_a & SSL_aECDSA) && + (c->pkeys[SSL_PKEY_ECC].privatekey != NULL)) + idx = SSL_PKEY_ECC; + if (idx == -1) { SSLerr(SSL_F_SSL_GET_SIGN_PKEY, ERR_R_INTERNAL_ERROR); return (NULL);