Update TLS 1.2 GCM

This commit is contained in:
Zhi Guan
2026-06-11 23:53:42 +08:00
parent 0c974eaa25
commit d999e8879c
4 changed files with 156 additions and 24 deletions

View File

@@ -81,6 +81,7 @@ const char *tls_cipher_suite_name(int cipher)
case TLS_cipher_aes_128_ccm_sha256: return "TLS_AES_128_CCM_SHA256";
case TLS_cipher_aes_128_ccm_8_sha256: return "TLS_AES_128_CCM_8_SHA256";
case TLS_cipher_ecdhe_ecdsa_with_aes_128_cbc_sha256: return "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256";
case TLS_cipher_ecdhe_ecdsa_with_aes_128_gcm_sha256: return "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256";
case TLS_cipher_empty_renegotiation_info_scsv: return "TLS_EMPTY_RENEGOTIATION_INFO_SCSV";
}
return NULL;
@@ -98,6 +99,8 @@ int tls_cipher_suite_from_name(const char *name)
return TLS_cipher_ecc_sm4_cbc_sm3;
} else if (!strcmp(name, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256")) {
return TLS_cipher_ecdhe_ecdsa_with_aes_128_cbc_sha256;
} else if (!strcmp(name, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256")) {
return TLS_cipher_ecdhe_ecdsa_with_aes_128_gcm_sha256;
}
error_print();
return 0;
@@ -804,6 +807,8 @@ int tls_server_key_exchange_print(FILE *fp, const uint8_t *data, size_t datalen,
break;
case TLS_cipher_ecdhe_sm4_cbc_sm3:
case TLS_cipher_ecdhe_sm4_gcm_sm3:
case TLS_cipher_ecdhe_ecdsa_with_aes_128_cbc_sha256:
case TLS_cipher_ecdhe_ecdsa_with_aes_128_gcm_sha256:
if (tls_server_key_exchange_ecdhe_print(fp, data, datalen, format, indent) != 1) {
error_print();
return -1;
@@ -919,6 +924,8 @@ int tls_client_key_exchange_print(FILE *fp, const uint8_t *data, size_t datalen,
break;
case TLS_cipher_ecdhe_sm4_cbc_sm3:
case TLS_cipher_ecdhe_sm4_gcm_sm3:
case TLS_cipher_ecdhe_ecdsa_with_aes_128_cbc_sha256:
case TLS_cipher_ecdhe_ecdsa_with_aes_128_gcm_sha256:
if (tls_client_key_exchange_ecdhe_print(fp, data, datalen, format, indent) != 1) {
error_print();
return -1;
@@ -1179,4 +1186,3 @@ int tls_encrypted_record_print(FILE *fp, const uint8_t *record, size_t recordle
fprintf(fp, "\n");
return 1;
}