Browse Source

pkcs#8 support for aes and reduced sha512

Steffen Jaeckel 7 years ago
parent
commit
c56053870a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/pk/ecc/ecc_import_pkcs8.c

+ 8 - 0
src/pk/ecc/ecc_import_pkcs8.c

@@ -105,12 +105,17 @@ static const oid_id_st _hmac_oid_names[] = {
    { "1.2.840.113549.2.9",  "sha256" },
    { "1.2.840.113549.2.10", "sha384" },
    { "1.2.840.113549.2.11", "sha512" },
+   { "1.2.840.113549.2.12", "sha512-224" },
+   { "1.2.840.113549.2.13", "sha512-256" },
 };
 
 static const _pbes_type _pbes2_default_types[] = {
    { pkcs_5_alg2, "sha1",   "des",   8, 0 },
    { pkcs_5_alg2, "sha1",   "rc2",   4, 0 },
    { pkcs_5_alg2, "sha1",   "3des", 24, 0 },
+   { pkcs_5_alg2, "sha1",   "aes",  16, 0 },
+   { pkcs_5_alg2, "sha1",   "aes",  24, 0 },
+   { pkcs_5_alg2, "sha1",   "aes",  32, 0 },
 };
 
 typedef struct {
@@ -122,6 +127,9 @@ static const _pbes2_cipher_hmac_map _pbes2_ciphers[] = {
    { &_pbes2_default_types[0], "1.3.14.3.2.7"            },  /* http://www.oid-info.com/get/1.3.14.3.2.7            desCBC */
    { &_pbes2_default_types[1], "1.2.840.113549.3.2"      },  /* http://www.oid-info.com/get/1.2.840.113549.3.2      rc2CBC */
    { &_pbes2_default_types[2], "1.2.840.113549.3.7"      },  /* http://www.oid-info.com/get/1.2.840.113549.3.7      des-EDE3-CBC */
+   { &_pbes2_default_types[3], "2.16.840.1.101.3.4.1.2"  },  /* http://www.oid-info.com/get/2.16.840.1.101.3.4.1.2  aes128-CBC */
+   { &_pbes2_default_types[4], "2.16.840.1.101.3.4.1.22" },  /* http://www.oid-info.com/get/2.16.840.1.101.3.4.1.22 aes192-CBC */
+   { &_pbes2_default_types[5], "2.16.840.1.101.3.4.1.42" },  /* http://www.oid-info.com/get/2.16.840.1.101.3.4.1.42 aes256-CBC */
 };
 
 static const char *_oid_pbkdf2 = "1.2.840.113549.1.5.12";