Upgrade crapto1 library to v3.3 (#232)

- fix standalone tools mfkey32, mfkey64 and nonce2key to use common crapto1 library
- fix compiler warnings in tools/mfkey/mfkey64.c and tools/nonce2key/nonce2key.c
- allow crapto1.c to compile on ARM hosts
- add @iceman1001's readme.txt to tools/mfkey
This commit is contained in:
pwpiwi 2017-03-12 15:05:54 +01:00 committed by GitHub
commit 0ca9bc0e99
10 changed files with 150 additions and 195 deletions

View file

@ -1,17 +1,20 @@
VPATH = ../../common/crapto1
CC = gcc
LD = gcc
CFLAGS = -Wall -Winline -O4
CFLAGS = -I../../common -Wall -O4
LDFLAGS =
OBJS = crapto1.o crypto1.o
HEADERS =
EXES = mfkey64 mfkey32
LIBS =
all: $(OBJS) $(EXES) $(LIBS)
OBJS = crypto1.o crapto1.o
EXES = mfkey32 mfkey64
WINEXES = $(patsubst %, %.exe, $(EXES))
% : %.c $(OBJS)
$(LD) $(CFLAGS) -o $@ $< $(OBJS) $(LDFLAGS)
all: $(OBJS) $(EXES)
%.o : %.c
$(CC) $(CFLAGS) -c -o $@ $<
% : %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $<
clean:
rm -f $(OBJS) $(EXES) $(LIBS)
rm -f $(OBJS) $(EXES) $(WINEXES)

View file

@ -1,5 +1,5 @@
#include <inttypes.h>
#include "crapto1.h"
#include "crapto1/crapto1.h"
#include <stdio.h>
#include <stdlib.h>

View file

@ -1,5 +1,5 @@
#include <inttypes.h>
#include "crapto1.h"
#include "crapto1/crapto1.h"
#include <stdio.h>
#include <string.h>
@ -34,7 +34,7 @@ int main (int argc, char *argv[]) {
for (int i = 0; i < encc; i++) {
enclen[i] = strlen(argv[i + 6]) / 2;
for (int i2 = 0; i2 < enclen[i]; i2++) {
sscanf(argv[i+6] + i2*2,"%2x", (uint8_t*)&enc[i][i2]);
sscanf(argv[i+6] + i2*2,"%2x", (unsigned int *)&enc[i][i2]);
}
}
printf("Recovering key for:\n");