FIX: makeing sure the "make clean" now deletes the nonce2key.exe file.

This commit is contained in:
iceman1001 2016-01-17 23:00:50 +01:00
commit 9d1eaa281f
2 changed files with 7 additions and 14 deletions

View file

@ -5,7 +5,7 @@ LDFLAGS =
OBJS = crypto1.o crapto1.o
HEADERS = crapto1.h
EXES = nonce2key
EXES = nonce2key nonce2key.exe
all: $(OBJS) $(EXES)
@ -15,8 +15,5 @@ all: $(OBJS) $(EXES)
% : %.c
$(LD) $(LDFLAGS) -o $@ $(OBJS) $<
crypto1test: libnfc $(OBJS)
$(LD) $(LDFLAGS) -o crypto1test crypto1test.c $(OBJS)
clean:
rm -f $(OBJS) $(EXES)

View file

@ -416,9 +416,7 @@ uint32_t *lfsr_prefix_ks(uint8_t ks[8], int isodd)
/** check_pfx_parity
* helper function which eliminates possible secret states using parity bits
*/
static struct Crypto1State*
check_pfx_parity(uint32_t prefix, uint32_t rresp, uint8_t parities[8][8],
uint32_t odd, uint32_t even, struct Crypto1State* sl)
static struct Crypto1State* check_pfx_parity(uint32_t prefix, uint32_t rresp, uint8_t parities[8][8], uint32_t odd, uint32_t even, struct Crypto1State* sl)
{
uint32_t ks1, nr, ks2, rr, ks3, c, good = 1;
@ -456,8 +454,7 @@ check_pfx_parity(uint32_t prefix, uint32_t rresp, uint8_t parities[8][8],
* It returns a zero terminated list of possible cipher states after the
* tag nonce was fed in
*/
struct Crypto1State*
lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8])
struct Crypto1State* lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8])
{
struct Crypto1State *statelist, *s;
uint32_t *odd, *even, *o, *e, top;
@ -468,8 +465,9 @@ lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8])
s = statelist = malloc((sizeof *statelist) << 20);
if(!s || !odd || !even) {
free(statelist);
statelist = 0;
goto out;
free(odd);
free(even);
return 0;
}
for(o = odd; *o + 1; ++o)
@ -481,8 +479,6 @@ lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8])
}
s->odd = s->even = 0;
out:
free(odd);
free(even);
return statelist;
}