diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-09-07 22:03:22 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-09-08 05:03:56 +0000 |
commit | f25b8c6784e7dab61e0754159dd3202bda584da9 (patch) | |
tree | 6dc6892548c60c430a89c90f52e75a7e32e3844b /epan/crypt | |
parent | bcba9ba0d3341e3ad1c506d7dd9c762e5129a9b0 (diff) | |
download | wireshark-f25b8c6784e7dab61e0754159dd3202bda584da9.tar.gz wireshark-f25b8c6784e7dab61e0754159dd3202bda584da9.tar.bz2 wireshark-f25b8c6784e7dab61e0754159dd3202bda584da9.zip |
Move some stuff into the only code path where it's used.
AirPDCapPacketProcess() really does two different things; some of the
stuff it does in both code paths only needs to be done in one code path.
Make it so.
Change-Id: Idb231d729150781f323e88ed375c983a3afd2577
Reviewed-on: https://code.wireshark.org/review/10439
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/crypt')
-rw-r--r-- | epan/crypt/airpdcap.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/crypt/airpdcap.c b/epan/crypt/airpdcap.c index 659c8075b4..53737a2684 100644 --- a/epan/crypt/airpdcap.c +++ b/epan/crypt/airpdcap.c @@ -623,8 +623,6 @@ INT AirPDcapPacketProcess( { const UCHAR *addr; AIRPDCAP_SEC_ASSOCIATION_ID id; - PAIRPDCAP_SEC_ASSOCIATION sa; - int offset = 0; #ifdef _DEBUG #define MSGBUF_LEN 255 @@ -680,15 +678,6 @@ INT AirPDcapPacketProcess( return AIRPDCAP_RET_REQ_DATA; } - /* get the Security Association structure for the STA and AP */ - sa = AirPDcapGetSaPtr(ctx, &id); - if (sa == NULL){ - return AIRPDCAP_RET_UNSUCCESS; - } - - /* cache offset in the packet data (to scan encryption data) */ - offset = mac_header_len; - /* check if data is encrypted (use the WEP bit in the Frame Control field) */ if (AIRPDCAP_WEP(data[1])==0) { @@ -699,6 +688,17 @@ INT AirPDcapPacketProcess( } } else { if (mngDecrypt) { + PAIRPDCAP_SEC_ASSOCIATION sa; + int offset = 0; + + /* get the Security Association structure for the STA and AP */ + sa = AirPDcapGetSaPtr(ctx, &id); + if (sa == NULL){ + return AIRPDCAP_RET_UNSUCCESS; + } + + /* cache offset in the packet data (to scan encryption data) */ + offset = mac_header_len; if (decrypt_data==NULL) return AIRPDCAP_RET_UNSUCCESS; |