* added `hf emv scan` command and options
* add tlv tag save to json
* added tlv tree navigation
* added kernel id and moved some parts of code in ppse
* save gpo result
* added read records
* extract childs from tlv works
* added application data list
* added work with application data section
* flag --extract works
* refactoring: move json functions to emvjson.h/c
* added path.c to jansson
* refactoring: move ParamLoadFromJson
* refactoring: move defparams.json to tag-name-value structure
* refactoring and add key recovering
* added some codes to appdata list
* refactoring: process response format 1 from GPO
* added save mode
* added RID to app data
* add file name handling and small refactoring in argtable string processing
* added finalization logic to `emv scan` and option to remove hash checking in key recovery
This commit is contained in:
Oleg Moiseenko 2018-10-17 21:53:34 +03:00 committed by pwpiwi
commit 95b697f017
20 changed files with 1209 additions and 241 deletions

View file

@ -27,6 +27,11 @@
#include <string.h>
#include <stdarg.h>
static bool strictExecution = true;
void PKISetStrictExecution(bool se) {
strictExecution = se;
}
static const unsigned char empty_tlv_value[] = {};
static const struct tlv empty_tlv = {.tag = 0x0, .len = 0, .value = empty_tlv_value};
@ -108,9 +113,12 @@ static unsigned char *emv_pki_decode_message(const struct emv_pk *enc_pk,
printf("ERROR: Calculated wrong hash\n");
printf("decoded: %s\n",sprint_hex(data + data_len - 1 - hash_len, hash_len));
printf("calculated: %s\n",sprint_hex(crypto_hash_read(ch), hash_len));
crypto_hash_close(ch);
free(data);
return NULL;
if (strictExecution) {
crypto_hash_close(ch);
free(data);
return NULL;
}
}
crypto_hash_close(ch);