move capk.txt to resources/

This commit is contained in:
Philippe Teuwen 2019-08-30 02:10:55 +02:00
commit 382129205f
2 changed files with 8 additions and 7 deletions

View file

@ -29,6 +29,8 @@
#include "ui.h" #include "ui.h"
#include "crypto.h" #include "crypto.h"
#include "proxmark3.h" #include "proxmark3.h"
#include "fileutils.h"
#include "pm3_cmd.h"
#define BCD(c) (((c) >= '0' && (c) <= '9') ? ((c) - '0') : \ #define BCD(c) (((c) >= '0' && (c) <= '9') ? ((c) - '0') : \
-1) -1)
@ -483,13 +485,12 @@ struct emv_pk *emv_pk_get_ca_pk(const unsigned char *rid, unsigned char idx) {
} }
} }
*/ */
const char *relfname = "emv/capk.txt"; char *path;
if (searchFile(&path, RESOURCES_SUBDIR, "capk", ".txt") != PM3_SUCCESS) {
char fname[strlen(get_my_executable_directory()) + strlen(relfname) + 1]; return NULL;
strcpy(fname, get_my_executable_directory()); }
strcat(fname, relfname); pk = emv_pk_get_ca_pk_from_file(path, rid, idx);
free(path);
pk = emv_pk_get_ca_pk_from_file(fname, rid, idx);
if (!pk) if (!pk)
return NULL; return NULL;