From b101236292985f9b65cc6aea47e4a4f1b6667a4d Mon Sep 17 00:00:00 2001 From: yuanzh78 Date: Sun, 5 May 2019 09:30:15 +0800 Subject: [PATCH] Update s3_lib.c in the end of finish msg of gmssl handshake, to get the correct hash algo, otherwise verify failed --- ssl/s3_lib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c index 4b960ac6..4a6f178e 100644 --- a/ssl/s3_lib.c +++ b/ssl/s3_lib.c @@ -4264,6 +4264,12 @@ long ssl_get_algorithm2(SSL *s) } else if (s->s3->tmp.new_cipher->algorithm_mkey & SSL_PSK) { if (alg2 == (SSL_HANDSHAKE_MAC_SHA384 | TLS1_PRF_SHA384)) return SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF; + } else{ + // in the end of finish msg of gmssl handshake, to get the correct hash algo + printf("ssl_get_algorithm2=0x08x\n", ssl_get_algorithm2); + if (alg2 == 0x909){ + return SSL_HANDSHAKE_MAC_SM3 | TLS1_PRF_SM3; + } } return alg2; }