From 5581d3275f240b6075db8e7c09e43a846e8ba96d Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Fri, 3 Apr 2020 15:38:52 +0800 Subject: [PATCH] fixup to previous commit: - reorder alg2Mech to match other related arrays - add back Camellia-GCM lines in ssl_bulk_cipher_defs[] - add Camellia-GCM SEC OID --- security/nss/lib/ssl/ssl3con.c | 2 +- security/nss/lib/ssl/sslspec.c | 4 ++++ security/nss/lib/util/secoidt.h | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/security/nss/lib/ssl/ssl3con.c b/security/nss/lib/ssl/ssl3con.c index 2750e5861..1a5c88628 100644 --- a/security/nss/lib/ssl/ssl3con.c +++ b/security/nss/lib/ssl/ssl3con.c @@ -421,8 +421,8 @@ static const SSLCipher2Mech alg2Mech[] = { { ssl_calg_camellia, CKM_CAMELLIA_CBC }, { ssl_calg_seed, CKM_SEED_CBC }, { ssl_calg_aes_gcm, CKM_AES_GCM }, - { ssl_calg_camellia_gcm, CKM_CAMELLIA_GCM }, { ssl_calg_chacha20, CKM_NSS_CHACHA20_POLY1305 }, + { ssl_calg_camellia_gcm, CKM_CAMELLIA_GCM }, }; const PRUint8 tls12_downgrade_random[] = { 0x44, 0x4F, 0x57, 0x4E, diff --git a/security/nss/lib/ssl/sslspec.c b/security/nss/lib/ssl/sslspec.c index def3c6750..c79f88986 100644 --- a/security/nss/lib/ssl/sslspec.c +++ b/security/nss/lib/ssl/sslspec.c @@ -56,6 +56,10 @@ static const ssl3BulkCipherDef ssl_bulk_cipher_defs[] = { SEC_OID_AES_256_GCM, "AES-256-GCM", MR_128}, {cipher_chacha20, ssl_calg_chacha20, 32,32, type_aead, 12, 0,16, 0, SEC_OID_CHACHA20_POLY1305, "ChaCha20-Poly1305", MR_MAX}, + {cipher_camellia_128_gcm, ssl_calg_camellia_gcm, 16,16, type_aead, 4, 0,16, 8, + SEC_OID_CAMELLIA_128_GCM, "Camellia-128-GCM", MR_128}, + {cipher_camellia_256_gcm, ssl_calg_camellia_gcm, 32,32, type_aead, 4, 0,16, 8, + SEC_OID_CAMELLIA_256_GCM, "Camellia-256-GCM", MR_128}, {cipher_missing, ssl_calg_null, 0, 0, type_stream, 0, 0, 0, 0, SEC_OID_UNKNOWN, "missing", 0U}, }; diff --git a/security/nss/lib/util/secoidt.h b/security/nss/lib/util/secoidt.h index 837972e2f..230448407 100644 --- a/security/nss/lib/util/secoidt.h +++ b/security/nss/lib/util/secoidt.h @@ -502,6 +502,9 @@ typedef enum { SEC_OID_EXT_KEY_USAGE_IPSEC_TUNNEL = 362, SEC_OID_EXT_KEY_USAGE_IPSEC_USER = 363, + SEC_OID_CAMELLIA_128_GCM = 364, + SEC_OID_CAMELLIA_256_GCM = 365, + SEC_OID_TOTAL } SECOidTag;