2007-01-13 15:26:13 +00:00
|
|
|
# pkcs12.cnf
|
|
|
|
# PKCS12 conformation file
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
#.MODULE_IMPORT
|
|
|
|
PKCS-7 cms
|
|
|
|
PKCS-5 x509af
|
|
|
|
|
2007-10-16 13:59:40 +00:00
|
|
|
#.IMPORT ../cms/cms-exp.cnf
|
|
|
|
#.IMPORT ../x509if/x509if-exp.cnf
|
|
|
|
#.IMPORT ../x509af/x509af-exp.cnf
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
#.EXPORTS
|
|
|
|
|
|
|
|
#.REGISTER
|
2007-05-13 20:58:29 +00:00
|
|
|
KeyBag B "1.2.840.113549.1.12.10.1.1" "keyBag"
|
2007-01-13 15:26:13 +00:00
|
|
|
PKCS8ShroudedKeyBag B "1.2.840.113549.1.12.10.1.2" "pkcs8ShroudedKeyBag"
|
2007-05-13 20:58:29 +00:00
|
|
|
CertBag B "1.2.840.113549.1.12.10.1.3" "certBag"
|
|
|
|
SecretBag B "1.2.840.113549.1.12.10.1.4" "secretBag"
|
|
|
|
CRLBag B "1.2.840.113549.1.12.10.1.5" "crlBag"
|
2007-01-13 15:26:13 +00:00
|
|
|
SafeContents B "1.2.840.113549.1.12.10.1.6" "safeContentsBag"
|
|
|
|
|
|
|
|
# PKCS#9 Attributes - see master list in x509sat.cnf
|
|
|
|
PFX B "2.16.840.1.113730.3.1.216" "pkcs-9-at-PKCS12"
|
|
|
|
EncryptedPrivateKeyInfo B "1.2.840.113549.1.9.25.2" "pkcs-9-at-encryptedPrivateKeyInfo"
|
|
|
|
|
|
|
|
# Password Based Encryption
|
|
|
|
PBEParameter B "1.2.840.113549.1.12.1.1" "pbeWithSHAAnd128BitRC4"
|
|
|
|
PBEParameter B "1.2.840.113549.1.12.1.2" "pbeWithSHAAnd40BitRC4"
|
|
|
|
PBEParameter B "1.2.840.113549.1.12.1.3" "pbeWithSHAAnd3-KeyTripleDES-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.12.1.4" "pbeWithSHAAnd2-KeyTripleDES-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.12.1.5" "pbeWithSHAAnd128BitRC2-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.12.1.6" "pbeWithSHAAnd128BitRC2-CBC"
|
|
|
|
|
|
|
|
PBEParameter B "1.2.840.113549.1.5.1" "pbeWithMD2AndDES-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.5.3" "pbeWithMD5AndDES-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.5.4" "pbeWithMD2AndRC2-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.5.6" "pbeWithMD5AndRC2-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.5.10" "pbeWithSHA1AndDES-CBC"
|
|
|
|
PBEParameter B "1.2.840.113549.1.5.11" "pbeWithSHA1AndRC2-CBC"
|
|
|
|
|
|
|
|
PBKDF2Params B "1.2.840.113549.1.5.12" "id-PBKDF2"
|
2007-05-13 20:58:29 +00:00
|
|
|
PBES2Params B "1.2.840.113549.1.5.13" "id-PBES2"
|
2007-01-13 15:26:13 +00:00
|
|
|
PBMAC1Params B "1.2.840.113549.1.5.14" "id-PBMAC1"
|
|
|
|
|
|
|
|
#.NO_EMIT
|
|
|
|
|
|
|
|
#.TYPE_RENAME
|
|
|
|
|
|
|
|
#.FIELD_RENAME
|
|
|
|
PrivateKeyInfo/version privateKeyVersion
|
|
|
|
PBKDF2Params/salt saltChoice
|
|
|
|
|
|
|
|
#.PDU
|
|
|
|
AuthenticatedSafe
|
2007-08-17 18:52:40 +00:00
|
|
|
PrivateKeyInfo
|
2007-01-13 15:26:13 +00:00
|
|
|
|
|
|
|
#.FN_BODY PFX
|
|
|
|
dissector_handle_t dissector_handle;
|
|
|
|
|
|
|
|
/* we change the CMS id-data dissector to dissect as AuthenticatedSafe
|
|
|
|
not sure why PKCS#12 couldn't have used its own content type OID for AuthenticatedSafe */
|
|
|
|
dissector_handle=create_dissector_handle(dissect_AuthenticatedSafe_OCTETSTRING_PDU, proto_pkcs12);
|
|
|
|
dissector_change_string("ber.oid", "1.2.840.113549.1.7.1", dissector_handle);
|
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
|
|
|
|
/* restore the original dissector */
|
|
|
|
dissector_reset_string("ber.oid", "1.2.840.113549.1.7.1");
|
|
|
|
|
|
|
|
#.FN_BODY AuthenticatedSafe
|
|
|
|
dissector_handle_t dissector_handle;
|
|
|
|
|
|
|
|
/* we change the CMS id-data dissector to dissect as SafeContents */
|
|
|
|
dissector_handle=create_dissector_handle(dissect_SafeContents_OCTETSTRING_PDU, proto_pkcs12);
|
|
|
|
dissector_change_string("ber.oid", "1.2.840.113549.1.7.1", dissector_handle);
|
|
|
|
|
|
|
|
%(DEFAULT_BODY)s
|
|
|
|
|
|
|
|
/* restore the original dissector */
|
|
|
|
dissector_reset_string("ber.oid", "1.2.840.113549.1.7.1");
|
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_PARS SafeBag/bagId FN_VARIANT = _str VAL_PTR = &object_identifier_id
|
|
|
|
#.FN_FTR SafeBag/bagId
|
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
#.END
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_PARS CertBag/certId FN_VARIANT = _str VAL_PTR = &object_identifier_id
|
|
|
|
#.FN_FTR CertBag/certId
|
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
#.END
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_PARS CRLBag/crlId FN_VARIANT = _str VAL_PTR = &object_identifier_id
|
|
|
|
#.FN_FTR CRLBag/crlId
|
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
#.END
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
#.FN_PARS SecretBag/secretTypeId FN_VARIANT = _str VAL_PTR = &object_identifier_id
|
|
|
|
#.FN_FTR SecretBag/secretTypeId
|
2007-06-05 12:00:57 +00:00
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
#.END
|
|
|
|
|
|
|
|
#.FN_PARS PKCS12Attribute/attrId FN_VARIANT = _str VAL_PTR = &object_identifier_id
|
|
|
|
#.FN_FTR PKCS12Attribute/attrId
|
|
|
|
append_oid(tree, object_identifier_id);
|
|
|
|
#.END
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY SafeBag/bagValue
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2007-05-13 20:58:29 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY PKCS12Attribute/attrValues/_item
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2007-05-13 20:58:29 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY CertBag/certValue
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2007-05-13 20:58:29 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY CRLBag/crlValue
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2007-05-13 20:58:29 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2007-06-05 12:00:57 +00:00
|
|
|
#.FN_BODY SecretBag/secretValue
|
2007-01-13 15:26:13 +00:00
|
|
|
if(object_identifier_id)
|
2007-05-13 20:58:29 +00:00
|
|
|
offset = call_ber_oid_callback(object_identifier_id, tvb, offset, actx->pinfo, tree);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
#.FN_HDR PBEParameter
|
|
|
|
/* initialise the encryption parameters */
|
|
|
|
PBE_reset_parameters();
|
|
|
|
|
|
|
|
#.END
|
|
|
|
|
|
|
|
#.FN_PARS OCTET_STRING VAL_PTR = (hf_index == hf_pkcs12_salt ? &salt : NULL)
|
|
|
|
#.FN_PARS INTEGER VAL_PTR = (hf_index == hf_pkcs12_iterationCount ? &iteration_count : NULL)
|
|
|
|
|
|
|
|
#.FN_PARS EncryptedData VAL_PTR = &encrypted_tvb
|
|
|
|
|
|
|
|
#.FN_HDR EncryptedData
|
|
|
|
tvbuff_t *encrypted_tvb;
|
|
|
|
dissector_handle_t dissector_handle;
|
2008-01-03 13:20:10 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
#.END
|
|
|
|
|
|
|
|
#.FN_FTR EncryptedData
|
2007-01-13 15:26:13 +00:00
|
|
|
|
2008-01-03 13:20:10 +00:00
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
dissector_handle=create_dissector_handle(dissect_PrivateKeyInfo_PDU, proto_pkcs12);
|
2010-02-23 04:35:23 +00:00
|
|
|
dissector_change_string("ber.oid", object_identifier_id, dissector_handle);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
2008-01-03 13:20:10 +00:00
|
|
|
PBE_decrypt_data(object_identifier_id, encrypted_tvb, actx, actx->created_item);
|
2007-08-17 18:52:40 +00:00
|
|
|
|
|
|
|
/* restore the original dissector */
|
|
|
|
dissector_reset_string("ber.oid", object_identifier_id);
|
|
|
|
|
2007-01-13 15:26:13 +00:00
|
|
|
#.END
|
|
|
|
|
|
|
|
|
2007-08-17 18:52:40 +00:00
|
|
|
|