mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Merge pull request #2458 from jmichelp/master
Fix out-of-bound reading in parity
This commit is contained in:
commit
28c1f60900
1 changed files with 4 additions and 4 deletions
|
@ -53,12 +53,12 @@ Card Number 11111111111111111111 = 0FFFFF
|
||||||
//E E E E E |E E E E E |EO O O O O| O O O O O| O
|
//E E E E E |E E E E E |EO O O O O| O O O O O| O
|
||||||
set_bit_by_position(packed,
|
set_bit_by_position(packed,
|
||||||
evenparity32(
|
evenparity32(
|
||||||
get_nonlinear_field(packed, 16, (uint8_t[]) {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}))
|
get_nonlinear_field(packed, 10, (uint8_t[]) {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}))
|
||||||
, 0);
|
, 0);
|
||||||
|
|
||||||
set_bit_by_position(packed,
|
set_bit_by_position(packed,
|
||||||
oddparity32(
|
oddparity32(
|
||||||
get_nonlinear_field(packed, 16, (uint8_t[]) {21, 23, 25, 27, 29, 31, 33, 35, 37, 39}))
|
get_nonlinear_field(packed, 10, (uint8_t[]) {21, 23, 25, 27, 29, 31, 33, 35, 37, 39}))
|
||||||
, 41);
|
, 41);
|
||||||
if (preamble)
|
if (preamble)
|
||||||
return add_HID_header(packed);
|
return add_HID_header(packed);
|
||||||
|
@ -76,9 +76,9 @@ static bool Unpack_Defcon32(wiegand_message_t *packed, wiegand_card_t *card) {
|
||||||
|
|
||||||
card->ParityValid =
|
card->ParityValid =
|
||||||
(get_bit_by_position(packed, 41) == oddparity32(
|
(get_bit_by_position(packed, 41) == oddparity32(
|
||||||
get_nonlinear_field(packed, 16, (uint8_t[]) {21, 23, 25, 27, 29, 31, 33, 35, 37, 39})))&&
|
get_nonlinear_field(packed, 10, (uint8_t[]) {21, 23, 25, 27, 29, 31, 33, 35, 37, 39})))&&
|
||||||
(get_bit_by_position(packed, 0) ==
|
(get_bit_by_position(packed, 0) ==
|
||||||
evenparity32(get_nonlinear_field(packed, 16, (uint8_t[]) {2, 4, 6, 8, 10, 12, 14, 16, 18, 20})));
|
evenparity32(get_nonlinear_field(packed, 10, (uint8_t[]) {2, 4, 6, 8, 10, 12, 14, 16, 18, 20})));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue