-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasleap_static.patch
117 lines (106 loc) · 3.56 KB
/
asleap_static.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
--- asleap/Makefile
+++ asleap-patched/Makefile
@@ -7,33 +7,40 @@
# <dragorn> i think thats all anyone does
# <dragorn> make is a twisted beast
##################################
-LDLIBS = -lpcap -lxcrypt
-CFLAGS = -pipe -Wall -D_LINUX -D_OPENSSL_MD4
-LDLIBS += -lcrypto
-CFLAGS += -g3 #-ggdb -g
-PROGOBJ = asleap.o genkeys.o utils.o common.o sha1.o
-PROG = asleap genkeys
-#CC = clang-10
+LDLIBS = /usr/local/lib/libcrypt.a -lpcap -lcrypto -lssl -lpthread
+CFLAGS = -pipe -Wall -D_LINUX -D_OPENSSL_MD4 -static -I/libxcrypt-4.4.36/lib -Wno-deprecated-declarations
+#CFLAGS += -g3 #-ggdb -g
+PROGOBJ = asleap.o genkeys.o utils.o common.o sha1.o md4.o
+PROG = asleap genkeys
+#CC = clang-10
CC = gcc
-all: $(PROG) $(PROGOBJ)
+all: $(PROG)
-utils: utils.c utils.h
- $(CC) $(CFLAGS) utils.c -c
+utils.o: utils.c utils.h
+ $(CC) $(CFLAGS) -c utils.c
-common: common.c common.h
- $(CC) $(CFLAGS) common.c -c
+common.o: common.c common.h
+ $(CC) $(CFLAGS) -c common.c
-sha1: sha1.c sha1.h
- $(CC) $(CFLAGS) sha1.c -c
+sha1.o: sha1.c sha1.h
+ $(CC) $(CFLAGS) -c sha1.c
-asleap: asleap.c asleap.h sha1.o common.o common.h utils.o version.h sha1.c \
- sha1.h
- $(CC) $(CFLAGS) asleap.c -o asleap common.o utils.o sha1.o $(LDLIBS)
+md4.o: md4.c md4.h
+ $(CC) $(CFLAGS) -c md4.c
-genkeys: genkeys.c md4.c md4.h common.o utils.o version.h common.h
- $(CC) $(CFLAGS) md4.c genkeys.c -o genkeys common.o utils.o $(LDLIBS)
+asleap.o: asleap.c asleap.h sha1.h common.h utils.h version.h
+ $(CC) $(CFLAGS) -c asleap.c
+genkeys.o: genkeys.c md4.h common.h utils.h version.h
+ $(CC) $(CFLAGS) -c genkeys.c
+
+asleap: asleap.o common.o utils.o sha1.o md4.o
+ $(CC) $(CFLAGS) -o asleap asleap.o common.o utils.o sha1.o md4.o $(LDLIBS)
+
+genkeys: genkeys.o md4.o common.o utils.o
+ $(CC) $(CFLAGS) -o genkeys genkeys.o md4.o common.o utils.o $(LDLIBS)
+
clean:
$(RM) $(PROGOBJ) $(PROG) *~
@@ -41,3 +48,4 @@
@ls -l $(PROG)
@strip $(PROG)
@ls -l $(PROG)
+
Only in asleap-patched: Makefile.old
--- asleap/common.c
+++ asleap-patched/common.c
@@ -34,7 +34,11 @@
#define MD4Init MD4_Init
#define MD4Update MD4_Update
#define MD4Final MD4_Final
-#define MD4WRAP MD4
+#define MD4WRAP(input, inputLen, output) \
+ MD4_CTX md4; \
+ MD4Init(&md4); \
+ MD4Update(&md4, input, inputLen); \
+ MD4Final(output, &md4)
#else
#include "md4.h"
#define MD4WRAP md4
--- asleap/ietfproto.h
+++ asleap-patched/ietfproto.h
@@ -144,14 +144,15 @@
#define PPPCHAP_SUCCESS 3
#define PPPCHAP_FAILURE 4
-struct arphdr {
- uint16_t hwtype; /* format of hardware address */
- uint16_t prototype; /* format of protocol address */
- uint8_t hwlen; /* length of hardware address */
- uint8_t protolen; /* length of protocol address */
- uint16_t opcode; /* ARP opcode (command) */
-};
+//struct arphdr {
+// uint16_t hwtype; /* format of hardware address */
+// uint16_t prototype; /* format of protocol address */
+// uint8_t hwlen; /* length of hardware address */
+// uint8_t protolen; /* length of protocol address */
+// uint16_t opcode; /* ARP opcode (command) */
+//};
+/*
struct arpreq {
struct arphdr arph;
uint8_t req[20];
@@ -159,7 +160,7 @@
#define ARPHDR_LEN sizeof(struct arphdr);
#define ARPREQ_LEN sizeof(struct arpreq);
-
+*/
#define ARP_REQUEST 1 /* ARP request */
#define ARP_REPLY 2 /* ARP reply */
#define ARP_RREQUEST 3 /* RARP request */