Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mrtd overflow fixes #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/nfc/helpers/mrtd_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ uint16_t mrtd_bac_decrypt_verify_sm(const uint8_t* data, size_t data_length, uin
//printf("DO87.Tag: %X\n", do87.tag);
//printf("DO87.Length: %ld\n", do87.length);
//printf("DO87.Value: ");
//for(uint8_t i=1; i<do87.length; ++i) { printf("%02X ", do87.value[i]); }
//for(uint16_t i = 1; i<do87.length; ++i) printf("%02X ", do87.value[i]);
//printf("\r\n");

if(do87.tag) {
Expand All @@ -249,7 +249,7 @@ uint16_t mrtd_bac_decrypt_verify_sm(const uint8_t* data, size_t data_length, uin
size_t enclength = do87.length - 1;

mrtd_bac_decrypt(encdata, enclength, key_enc, output);
printf("Decrypted: "); for(uint8_t i=0; i<enclength; ++i) printf("%02X ", output[i]); printf("\r\n");
printf("Decrypted: "); for(uint16_t i = 0; i < enclength; ++i) printf("%02X ", output[i]); printf("\r\n");

//TODO: function mrtd_bac_unpad?
int padidx;
Expand Down
2 changes: 1 addition & 1 deletion lib/nfc/protocols/mrtd.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ bool parse_ef_dg1(EF_DG1_contents* DG1, const uint8_t* data, size_t length) {
}

bool mrtd_read_parse_file(MrtdApplication* app, EFFile file) {
uint8_t buffer[100];
uint8_t buffer[300];
size_t buf_len;

FURI_LOG_D(TAG, "Read and parse %s (%04X)", file.name, file.file_id);
Expand Down