Skip to content

Commit

Permalink
Remove unsupported sha oid.
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-shang committed Feb 5, 2021
1 parent 0cafd57 commit be955ce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 41 deletions.
16 changes: 1 addition & 15 deletions crypto/rsa_extra/rsassa_pss_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,13 @@ const RSA_PSS_SUPPORTED_ALGOR sha1_func = {
5,
};

const RSA_PSS_SUPPORTED_ALGOR sha224_func = {
NID_sha224,
// 2.16.840.1.101.3.4.2.4
{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04},
9,
};

const RSA_PSS_SUPPORTED_ALGOR sha256_func = {
NID_sha256,
// 2.16.840.1.101.3.4.2.1
{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01},
9,
};

const RSA_PSS_SUPPORTED_ALGOR sha384_func = {
NID_sha384,
// 2.16.840.1.101.3.4.2.2
{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02},
9,
};

const RSA_PSS_SUPPORTED_ALGOR sha512_func = {
NID_sha512,
// 2.16.840.1.101.3.4.2.3
Expand All @@ -48,7 +34,7 @@ const RSA_PSS_SUPPORTED_ALGOR sha512_func = {
// Used to check if the oid is in the supported five hash functions.
// Section 2.1. https://tools.ietf.org/html/rfc4055#page-4
static const RSA_PSS_SUPPORTED_ALGOR *const rsa_pss_hash_functions[] = {
&sha1_func, &sha224_func, &sha256_func, &sha384_func, &sha512_func,
&sha1_func, &sha256_func, &sha512_func,
};

const RSA_PSS_SUPPORTED_ALGOR MGF1 = {
Expand Down
26 changes: 0 additions & 26 deletions crypto/rsa_extra/rsassa_pss_asn1_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@
// Trailer Field: 0xBC (absent)
static const uint8_t pss_sha1_salt_absent[] = {0x30, 0x00};

// pss_sha224_salt_absent is a DER-encoded RSASSA-PSS-params:
// Hash Algorithm: sha224
// Mask Algorithm: mgf1 with sha224
// Minimum Salt Length: 0x14 (absent)
// Trailer Field: 0xBC (absent)
static const uint8_t pss_sha224_salt_absent[] = {
0x30, 0x2b, 0xa0, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
0x65, 0x03, 0x04, 0x02, 0x04, 0xa1, 0x1a, 0x30, 0x18, 0x06, 0x09, 0x2a,
0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x08, 0x30, 0x0b, 0x06, 0x09,
0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04};

// pss_sha256_salt_absent is a DER-encoded RSASSA-PSS-params:
// Hash Algorithm: sha256
// Mask Algorithm: mgf1 with sha256
Expand All @@ -44,17 +33,6 @@ static const uint8_t pss_sha256_salt_absent[] = {
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08, 0x30, 0x0B, 0x06, 0x09,
0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01};

// pss_sha384_salt_absent is a DER-encoded RSASSA-PSS-params:
// Hash Algorithm: sha384
// Mask Algorithm: mgf1 with sha384
// Minimum Salt Length: 0x14 (absent)
// Trailer Field: 0xBC (absent)
static const uint8_t pss_sha384_salt_absent[] = {
0x30, 0x2B, 0xA0, 0x0D, 0x30, 0x0B, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01,
0x65, 0x03, 0x04, 0x02, 0x02, 0xA1, 0x1A, 0x30, 0x18, 0x06, 0x09, 0x2A,
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x08, 0x30, 0x0B, 0x06, 0x09,
0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02};

// pss_sha512_salt_absent is a DER-encoded RSASSA-PSS-params:
// Hash Algorithm: sha512
// Mask Algorithm: mgf1 with sha512
Expand Down Expand Up @@ -129,12 +107,8 @@ struct RSASSAPSSParamsTestInput {
} kRSASSAPSSParamsTestInputs[] = {
{pss_sha1_salt_absent, sizeof(pss_sha1_salt_absent), NID_undef, NID_undef,
NID_undef, NID_undef},
{pss_sha224_salt_absent, sizeof(pss_sha224_salt_absent), NID_sha224,
NID_mgf1, NID_undef, NID_undef},
{pss_sha256_salt_absent, sizeof(pss_sha256_salt_absent), NID_sha256,
NID_mgf1, NID_undef, NID_undef},
{pss_sha384_salt_absent, sizeof(pss_sha384_salt_absent), NID_sha384,
NID_mgf1, NID_undef, NID_undef},
{pss_sha512_salt_absent, sizeof(pss_sha512_salt_absent), NID_sha512,
NID_mgf1, NID_undef, NID_undef},
{pss_sha256_salt_default, sizeof(pss_sha256_salt_default), NID_sha256,
Expand Down

0 comments on commit be955ce

Please sign in to comment.