MD5 and SHA-1 are not actually approved in the TLS KDF.
They are NIST hash functions, but this service indicator function is
specific to their use in the TLS KDF.
Change-Id: I5a1f9d2865813f436a8e2a7548dffefcb2813c5f
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62086
Auto-Submit: Adam Langley <agl@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
diff --git a/crypto/fipsmodule/service_indicator/service_indicator.c b/crypto/fipsmodule/service_indicator/service_indicator.c
index b1ea28e..64325be 100644
--- a/crypto/fipsmodule/service_indicator/service_indicator.c
+++ b/crypto/fipsmodule/service_indicator/service_indicator.c
@@ -303,14 +303,11 @@
}
void TLSKDF_verify_service_indicator(const EVP_MD *md) {
- // HMAC-MD5, HMAC-SHA1, and HMAC-MD5/HMAC-SHA1 (both used concurrently) are
- // approved for use in the KDF in TLS 1.0/1.1.
- // HMAC-SHA{256, 384, 512} are approved for use in the KDF in TLS 1.2.
- // These Key Derivation functions are to be used in the context of the TLS
- // protocol.
+ // HMAC-MD5/HMAC-SHA1 (both used concurrently) is approved for use in the KDF
+ // in TLS 1.0/1.1. HMAC-SHA{256, 384, 512} are approved for use in the KDF in
+ // TLS 1.2. These Key Derivation functions are to be used in the context of
+ // the TLS protocol.
switch (EVP_MD_type(md)) {
- case NID_md5:
- case NID_sha1:
case NID_md5_sha1:
case NID_sha256:
case NID_sha384:
diff --git a/crypto/fipsmodule/service_indicator/service_indicator_test.cc b/crypto/fipsmodule/service_indicator/service_indicator_test.cc
index 27042e0..ee66fc3 100644
--- a/crypto/fipsmodule/service_indicator/service_indicator_test.cc
+++ b/crypto/fipsmodule/service_indicator/service_indicator_test.cc
@@ -422,24 +422,12 @@
0x31, 0x1e, 0x2b, 0x21, 0x41, 0x8d, 0x32, 0x81,
};
-static const uint8_t kTLSOutput_mdsha1[32] = {
+static const uint8_t kTLSOutput_md5_sha1[32] = {
0x36, 0xa9, 0x31, 0xb0, 0x43, 0xe3, 0x64, 0x72, 0xb9, 0x47, 0x54,
0x0d, 0x8a, 0xfc, 0xe3, 0x5c, 0x1c, 0x15, 0x67, 0x7e, 0xa3, 0x5d,
0xf2, 0x3a, 0x57, 0xfd, 0x50, 0x16, 0xe1, 0xa4, 0xa6, 0x37,
};
-static const uint8_t kTLSOutput_md[32] = {
- 0x79, 0xef, 0x46, 0xc4, 0x35, 0xbc, 0xe5, 0xda, 0xd3, 0x66, 0x91,
- 0xdc, 0x86, 0x09, 0x41, 0x66, 0xf2, 0x0c, 0xeb, 0xe6, 0xab, 0x5c,
- 0x58, 0xf4, 0x65, 0xce, 0x2f, 0x5f, 0x4b, 0x34, 0x1e, 0xa1,
-};
-
-static const uint8_t kTLSOutput_sha1[32] = {
- 0xbb, 0x0a, 0x73, 0x52, 0xf8, 0x85, 0xd7, 0xbd, 0x12, 0x34, 0x78,
- 0x3b, 0x54, 0x4c, 0x75, 0xfe, 0xd7, 0x23, 0x6e, 0x22, 0x3f, 0x42,
- 0x34, 0x99, 0x57, 0x6b, 0x14, 0xc4, 0xc8, 0xae, 0x9f, 0x4c,
-};
-
static const uint8_t kTLSOutput_sha224[32] = {
0xdd, 0xaf, 0x6f, 0xaa, 0xd9, 0x2b, 0x3d, 0xb9, 0x46, 0x4c, 0x55,
0x8a, 0xf7, 0xa6, 0x9b, 0x0b, 0x35, 0xcc, 0x07, 0xa7, 0x55, 0x5b,
@@ -1783,9 +1771,7 @@
const uint8_t *expected_output;
const FIPSStatus expect_approved;
} kKDFTestVectors[] = {
- {EVP_md5, kTLSOutput_md, FIPSStatus::APPROVED},
- {EVP_sha1, kTLSOutput_sha1, FIPSStatus::APPROVED},
- {EVP_md5_sha1, kTLSOutput_mdsha1, FIPSStatus::APPROVED},
+ {EVP_md5_sha1, kTLSOutput_md5_sha1, FIPSStatus::APPROVED},
{EVP_sha224, kTLSOutput_sha224, FIPSStatus::NOT_APPROVED},
{EVP_sha256, kTLSOutput_sha256, FIPSStatus::APPROVED},
{EVP_sha384, kTLSOutput_sha384, FIPSStatus::APPROVED},