aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/pkcs12/pkcs12.cnf
blob: 4a86238dc4955d2669b457bbb639c68a87242bb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# pkcs12.cnf
# PKCS12 conformation file

# $Id$

#.MODULE_IMPORT
PKCS-7	cms
PKCS-5	x509af

#.INCLUDE ../cms/cms-exp.cnf
#.INCLUDE ../x509if/x509if-exp.cnf
#.INCLUDE ../x509af/x509af-exp.cnf

#.EXPORTS


#.REGISTER
KeyBag			B "1.2.840.113549.1.12.10.1.1"	"keyBag"
PKCS8ShroudedKeyBag	B "1.2.840.113549.1.12.10.1.2"	"pkcs8ShroudedKeyBag"
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"
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"
PBES2Params		B "1.2.840.113549.1.5.13" "id-PBES2"
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

#.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");

#.FN_PARS OBJECT_IDENTIFIER
	FN_VARIANT = _str VAL_PTR = &object_identifier_id

#.FN_BODY OBJECT_IDENTIFIER
  	const char *name = NULL;

	%(DEFAULT_BODY)s
  
	name = get_oid_str_name(object_identifier_id);
	proto_item_append_text(tree, " (%%s)", name ? name : object_identifier_id); 

#.FN_BODY T_bagValue	
	if(object_identifier_id)
		offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_BODY T_attrValues_item	
	if(object_identifier_id)
		offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_BODY T_certValue
	if(object_identifier_id)
		offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_BODY T_crlValue
	if(object_identifier_id)
		offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.FN_BODY T_secretValue
	if(object_identifier_id)
		offset = call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);

#.END