Skip to content

Commit

Permalink
add PKCS1.5 and Legacy algorithms to fizz::toString
Browse files Browse the repository at this point in the history
Summary: Fizz does not support these algorithms, but since Fizz is often used to read the initial TLS ClientHello, which may be from an older version of TLS, it is helpful to be able to print these values.

Reviewed By: mingtaoy

Differential Revision: D66736193

fbshipit-source-id: 8b3b5403d0fa09c873e59aac463e4f171b14e17a
  • Loading branch information
Yang Wang authored and facebook-github-bot committed Dec 5, 2024
1 parent 04baa01 commit 3c20213
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions fizz/record/Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,25 @@ std::string toString(SignatureScheme sigScheme) {
case SignatureScheme::rsa_pss_sha256_batch:
return "rsa_pss_sha256_batch";
}
// Handle legacy/compatibility algorithms
uint16_t val = static_cast<uint16_t>(sigScheme);
switch (val) {
// RSASSA-PKCS1-v1_5 algorithms
case 0x0401:
return "rsa_pkcs1_sha256";
case 0x0501:
return "rsa_pkcs1_sha384";
case 0x0601:
return "rsa_pkcs1_sha512";
// Fizz does not support these algorithms. They are listed
// here solely to aid in debugging when printing non-TLS 1.3
// ClientHellos (for example, in the fizzHandshakeFallback
// path)
case 0x0201:
return "rsa_pkcs1_sha1";
case 0x0203:
return "ecdsa_sha1";
}
return enumToHex(sigScheme);
}

Expand Down

0 comments on commit 3c20213

Please sign in to comment.