pkixtsp: add support for dissecting CMS signature time-stamps

As per RFC 3161 Appendix A. The ASN.1 elements it defines are not
officially part of any module, so just stick them into PKIXTSP.

Change-Id: I728505cb305b924465b62eb442288edea7f916a7
Reviewed-on: https://code.wireshark.org/review/19272
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Роман Донченко 2016-12-14 23:55:31 +03:00 committed by Anders Broman
parent 104b102948
commit 85266a0f72
3 changed files with 30 additions and 0 deletions

View File

@ -174,4 +174,11 @@ Accuracy ::= SEQUENCE {
millis [0] INTEGER (1..999) OPTIONAL,
micros [1] INTEGER (1..999) OPTIONAL }
-- from Appendix A
id-aa-timeStampToken OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) aa(2) 14 }
SignatureTimeStampToken ::= TimeStampToken
END

View File

@ -23,6 +23,7 @@ PKIStatusInfo/status pki_status
TSTInfo/version tst_version
#.REGISTER
SignatureTimeStampToken B "1.2.840.113549.1.9.16.2.14" "id-aa-timeStampToken"
TSTInfo B "1.2.840.113549.1.9.16.1.4" "id-ct-TSTInfo"
#.END

View File

@ -53,6 +53,7 @@ static int proto_pkixtsp = -1;
/*--- Included file: packet-pkixtsp-hf.c ---*/
#line 1 "./asn1/pkixtsp/packet-pkixtsp-hf.c"
static int hf_pkixtsp_TSTInfo_PDU = -1; /* TSTInfo */
static int hf_pkixtsp_SignatureTimeStampToken_PDU = -1; /* SignatureTimeStampToken */
static int hf_pkixtsp_version = -1; /* T_version */
static int hf_pkixtsp_messageImprint = -1; /* MessageImprint */
static int hf_pkixtsp_reqPolicy = -1; /* TSAPolicyId */
@ -349,6 +350,15 @@ dissect_pkixtsp_TSTInfo(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
return offset;
}
static int
dissect_pkixtsp_SignatureTimeStampToken(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_pkixtsp_TimeStampToken(implicit_tag, tvb, offset, actx, tree, hf_index);
return offset;
}
/*--- PDUs ---*/
static int dissect_TSTInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
@ -358,6 +368,13 @@ static int dissect_TSTInfo_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_
offset = dissect_pkixtsp_TSTInfo(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixtsp_TSTInfo_PDU);
return offset;
}
static int dissect_SignatureTimeStampToken_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
offset = dissect_pkixtsp_SignatureTimeStampToken(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkixtsp_SignatureTimeStampToken_PDU);
return offset;
}
/*--- End of included file: packet-pkixtsp-fn.c ---*/
@ -419,6 +436,10 @@ void proto_register_pkixtsp(void) {
{ "TSTInfo", "pkixtsp.TSTInfo_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixtsp_SignatureTimeStampToken_PDU,
{ "SignatureTimeStampToken", "pkixtsp.SignatureTimeStampToken_element",
FT_NONE, BASE_NONE, NULL, 0,
NULL, HFILL }},
{ &hf_pkixtsp_version,
{ "version", "pkixtsp.version",
FT_INT32, BASE_DEC, VALS(pkixtsp_T_version_vals), 0,
@ -586,6 +607,7 @@ void proto_reg_handoff_pkixtsp(void) {
/*--- Included file: packet-pkixtsp-dis-tab.c ---*/
#line 1 "./asn1/pkixtsp/packet-pkixtsp-dis-tab.c"
register_ber_oid_dissector("1.2.840.113549.1.9.16.2.14", dissect_SignatureTimeStampToken_PDU, proto_pkixtsp, "id-aa-timeStampToken");
register_ber_oid_dissector("1.2.840.113549.1.9.16.1.4", dissect_TSTInfo_PDU, proto_pkixtsp, "id-ct-TSTInfo");