Added support for encrypted PKCS#8 files (for some PKCS#5 v1.5 schemes).

This commit is contained in:
Tobias Brunner
2012-02-01 18:27:46 +01:00
parent db3334dc32
commit cab127cba6
3 changed files with 261 additions and 4 deletions
+7 -3
View File
@@ -556,10 +556,13 @@ static const asn1Object_t algorithmIdentifierObjects[] = {
{ 1, "algorithm", ASN1_OID, ASN1_BODY }, /* 1 */
{ 1, "parameters", ASN1_OID, ASN1_RAW|ASN1_OPT }, /* 2 */
{ 1, "end opt", ASN1_EOC, ASN1_END }, /* 3 */
{ 1, "parameters", ASN1_SEQUENCE, ASN1_RAW|ASN1_OPT }, /* 4 */
{ 1, "end opt", ASN1_EOC, ASN1_END }, /* 5 */
{ 0, "exit", ASN1_EOC, ASN1_EXIT }
};
#define ALGORITHM_ID_ALG 1
#define ALGORITHM_ID_PARAMETERS 2
#define ALGORITHM_ID_ALG 1
#define ALGORITHM_ID_PARAMETERS_OID 2
#define ALGORITHM_ID_PARAMETERS_SEQ 4
/*
* Defined in header
@@ -581,7 +584,8 @@ int asn1_parse_algorithmIdentifier(chunk_t blob, int level0, chunk_t *parameters
case ALGORITHM_ID_ALG:
alg = asn1_known_oid(object);
break;
case ALGORITHM_ID_PARAMETERS:
case ALGORITHM_ID_PARAMETERS_OID:
case ALGORITHM_ID_PARAMETERS_SEQ:
if (parameters != NULL)
{
*parameters = object;
+3
View File
@@ -97,6 +97,9 @@
0x0C "sha384WithRSAEncryption" OID_SHA384_WITH_RSA
0x0D "sha512WithRSAEncryption" OID_SHA512_WITH_RSA
0x0E "sha224WithRSAEncryption" OID_SHA224_WITH_RSA
0x05 "PKCS-5"
0x03 "pbeWithMD5AndDES-CBC" OID_PBE_MD5_DES_CBC
0x0A "pbeWithSHA1AndDES-CBC" OID_PBE_SHA1_DES_CBC
0x07 "PKCS-7"
0x01 "data" OID_PKCS7_DATA
0x02 "signedData" OID_PKCS7_SIGNED_DATA