From d0bb2ed15564f29f845ed9ea3e0accb9c603ee0f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 28 Feb 2015 10:31:40 +0100 Subject: [PATCH] more packet-kerberos... Change-Id: I2287260e005cc5740eef58305d15528ccd2a6438 --- epan/dissectors/asn1/kerberos/k5.asn | 9 --------- epan/dissectors/asn1/kerberos/kerberos.cnf | 10 +++++++--- .../asn1/kerberos/packet-kerberos-template.c | 9 ++++----- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/epan/dissectors/asn1/kerberos/k5.asn b/epan/dissectors/asn1/kerberos/k5.asn index ecfeec8605..7f93cb8985 100644 --- a/epan/dissectors/asn1/kerberos/k5.asn +++ b/epan/dissectors/asn1/kerberos/k5.asn @@ -837,13 +837,6 @@ PA-ServerReferralData ::= SEQUENCE { referral-valid-until [3] KerberosTime OPTIONAL, ... } --- WS put extensions found elsewere here --- http://msdn.microsoft.com/en-us/library/cc206948.aspx --- -KERB-PA-PAC-REQUEST ::= SEQUENCE { -include-pac[0] BOOLEAN --If TRUE, and no pac present, include PAC. - --If FALSE, and PAC present, remove PAC -} PAC-OptionFlags ::= BIT STRING { claims(0), @@ -864,8 +857,6 @@ KERB-AD-RESTRICTION-ENTRY ::= [UNIVERSAL 16] SEQUENCE { restriction [1] OCTET STRING -- LSAP_TOKEN_INFO_INTEGRITY structure } -PA-PW-SALT ::= KerberosString - END -- etags -r '/\([A-Za-z][-A-Za-z0-9]*\).*::=/\1/' k5.asn1 diff --git a/epan/dissectors/asn1/kerberos/kerberos.cnf b/epan/dissectors/asn1/kerberos/kerberos.cnf index d37a30624e..c1eb4857c3 100644 --- a/epan/dissectors/asn1/kerberos/kerberos.cnf +++ b/epan/dissectors/asn1/kerberos/kerberos.cnf @@ -46,7 +46,6 @@ Krb5uint32 PA-ClientCanonicalized PA-ClientCanonicalizedNames PA-ENC-SAM-RESPONSE-ENC -PA-PAC-REQUEST PA-SAM-CHALLENGE-2 PA-SAM-CHALLENGE-2-BODY PA-SAM-REDIRECT @@ -160,10 +159,10 @@ guint32 msgtype; case KRB5_ET_KDC_ERR_PREAUTH_BAD_AUTHENTICATION_SET: case KRB5_ET_KDC_ERR_UNKNOWN_CRITICAL_FAST_OPTIONS: offset=dissect_ber_octet_string_wcb(FALSE, actx, tree, tvb, offset, hf_kerberos_e_data, dissect_kerberos_SEQUENCE_OF_PA_DATA); - break; default: offset=dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_kerberos_e_data, NULL); + break; } @@ -196,7 +195,7 @@ guint32 msgtype; offset=dissect_ber_octet_string_wcb(FALSE, actx, sub_tree, tvb, offset,hf_index, dissect_pkinit_PaPkAsRep); break; case KERBEROS_PA_PAC_REQUEST: - offset=dissect_ber_octet_string_wcb(FALSE, actx, sub_tree, tvb, offset,hf_index, dissect_kerberos_KERB_PA_PAC_REQUEST); + offset=dissect_ber_octet_string_wcb(FALSE, actx, sub_tree, tvb, offset,hf_index, dissect_kerberos_PA_PAC_REQUEST); break; case KERBEROS_PA_FOR_USER: /* S4U2SELF */ offset=dissect_ber_octet_string_wcb(FALSE, actx, sub_tree, tvb, offset,hf_index, dissect_kerberos_PA_S4U2Self); @@ -253,6 +252,7 @@ guint32 msgtype; break; default: offset=dissect_ber_octet_string_wcb(FALSE, actx, sub_tree, tvb, offset,hf_index, NULL); + break; } #.FN_BODY HostAddress/address @@ -291,6 +291,7 @@ guint32 msgtype; default: proto_tree_add_expert(tree, actx->pinfo, &ei_kerberos_address, tvb, offset, len); address_str = NULL; + break; } /* push it up two levels in the decode pane */ @@ -382,6 +383,7 @@ guint32 msgtype; break; default: offset=dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, NULL); + break; } return offset; @@ -466,6 +468,7 @@ guint32 msgtype; break; default: offset=dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); + break; } #.FN_BODY S4UUserID/subject-certificate @@ -593,6 +596,7 @@ guint32 msgtype; break; default: offset=dissect_ber_octet_string(implicit_tag, actx, tree, tvb, offset, hf_index, NULL); + break; } #.FN_BODY KrbFastResponse/strengthen-key diff --git a/epan/dissectors/asn1/kerberos/packet-kerberos-template.c b/epan/dissectors/asn1/kerberos/packet-kerberos-template.c index 84af7db3e8..9920bcbded 100644 --- a/epan/dissectors/asn1/kerberos/packet-kerberos-template.c +++ b/epan/dissectors/asn1/kerberos/packet-kerberos-template.c @@ -128,10 +128,9 @@ static dissector_handle_t kerberos_handle_udp; static int dissect_kerberos_Applications(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_ENC_TIMESTAMP(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_ENC_TS_ENC(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); -static int dissect_kerberos_KERB_PA_PAC_REQUEST(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); +static int dissect_kerberos_PA_PAC_REQUEST(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_S4U2Self(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_PA_S4U_X509_USER(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); -static int dissect_kerberos_PA_PW_SALT(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_ETYPE_INFO(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_ETYPE_INFO2(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); static int dissect_kerberos_AD_IF_RELEVANT(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_); @@ -1805,6 +1804,7 @@ static int dissect_krb5_PW_SALT(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { kerberos_private_data_t *private_data = kerberos_get_private_data(actx); + gint remaining = tvb_reported_length_remaining(tvb, offset); guint32 nt_status = 0; guint32 val_0 = 0; guint32 val_1 = 0; @@ -1817,7 +1817,7 @@ dissect_krb5_PW_SALT(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U goto no_error; } - if (tvb_reported_length_remaining(tvb, offset) != 12) { + if (remaining != 12) { goto no_error; } @@ -1856,8 +1856,7 @@ dissect_krb5_PW_SALT(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U return offset; no_error: - return dissect_kerberos_PA_PW_SALT(implicit_tag, tvb, offset, - actx, tree, hf_index); + return offset + remaining; } static int -- 2.34.1