mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-07 12:33:39 +08:00
Uninitialized variable l results in cert length mismatch error
An local var `l` in gmtls_construct_client_certificate is uninitialized, which leads to an cert length mismatch error. GMTLS handshake using SM2-WITH-SMS4-SM3 cipher suite will be failed due to this issue. My editor automatically removed some trailing spaces when I fixed this bug. So some lines modified in `statem_gmtls.c` are insignificant. Please ignore them.
This commit is contained in:
@@ -1339,7 +1339,7 @@ int gmtls_construct_client_certificate(SSL *s)
|
||||
int al = -1;
|
||||
unsigned long alg_a = s->s3->tmp.new_cipher->algorithm_auth;
|
||||
unsigned char *p;
|
||||
int l;
|
||||
int l = 3 + SSL_HM_HEADER_LENGTH(s);
|
||||
|
||||
if (alg_a & SSL_aSM2) {
|
||||
if (!gmtls_construct_sm2_certs(s, &l)) {
|
||||
|
||||
Reference in New Issue
Block a user