diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2022-02-03 17:00:36 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2022-02-04 17:53:37 +0700 |
commit | d5f236fa91808b2ac724693baefe74c93b02e87f (patch) | |
tree | 224bd315147c5530850a7c6bd29799bf2df473a0 /misc | |
parent | 67856558c52a7e7bcf948fb7f40b7cd8aad63e51 (diff) | |
download | slackbuilds-d5f236fa91808b2ac724693baefe74c93b02e87f.tar.gz |
misc/samdump2: Patch for openssl-1.1.x.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/samdump2/openssl_compat.patch | 89 | ||||
-rw-r--r-- | misc/samdump2/samdump2.SlackBuild | 2 |
2 files changed, 91 insertions, 0 deletions
diff --git a/misc/samdump2/openssl_compat.patch b/misc/samdump2/openssl_compat.patch new file mode 100644 index 0000000000..85dd163ffd --- /dev/null +++ b/misc/samdump2/openssl_compat.patch @@ -0,0 +1,89 @@ +diff -Naur a/Makefile b/Makefile +--- a/Makefile 2012-04-20 20:27:00.000000000 +0800 ++++ b/Makefile 2018-01-30 12:12:55.114072617 +0800 +@@ -30,7 +30,7 @@ + INSTALL = $(shell which install) + CC = $(shell which gcc) + CFLAGS = -Wall +-LIBS = -lssl ++LIBS = -lssl -lcrypto + + # Default target + all: build +diff -Naur a/samdump2.c b/samdump2.c +--- a/samdump2.c 2012-04-20 20:27:00.000000000 +0800 ++++ b/samdump2.c 2018-01-30 12:10:49.627208011 +0800 +@@ -58,7 +58,7 @@ + + void str_to_key(unsigned char *str,unsigned char *key) + { +- // void des_set_odd_parity(des_cblock *); ++ // void DES_set_odd_parity(DES_cblock *); + int i; + + key[0] = str[0]>>1; +@@ -72,7 +72,7 @@ + for (i=0;i<8;i++) { + key[i] = (key[i]<<1); + } +- des_set_odd_parity((des_cblock *)key); ++ DES_set_odd_parity((DES_cblock *)key); + } + + /* +@@ -210,8 +210,8 @@ + unsigned char hbootkey[0x20]; + + /* Des */ +- des_key_schedule ks1, ks2; +- des_cblock deskey1, deskey2; ++ DES_key_schedule ks1, ks2; ++ DES_cblock deskey1, deskey2; + + int i, j; + +@@ -419,15 +419,15 @@ + + /* Get the two decrpt keys. */ + sid_to_key1(rid,(unsigned char *)deskey1); +- des_set_key_checked((des_cblock *)deskey1,ks1); ++ DES_set_key_checked((DES_cblock *)deskey1, &ks1); + sid_to_key2(rid,(unsigned char *)deskey2); +- des_set_key_unchecked((des_cblock *)deskey2,ks2); ++ DES_set_key_unchecked((DES_cblock *)deskey2, &ks2); + + /* Decrypt the lanman password hash as two 8 byte blocks. */ +- des_ecb_encrypt((des_cblock *)obfkey, +- (des_cblock *)fb, ks1, DES_DECRYPT); +- des_ecb_encrypt((des_cblock *)(obfkey + 8), +- (des_cblock *)&fb[8], ks2, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)obfkey, ++ (DES_cblock *)fb, &ks1, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)(obfkey + 8), ++ (DES_cblock *)&fb[8], &ks2, DES_DECRYPT); + + + +@@ -472,16 +472,16 @@ + if (lm_size != 0x14) { + /* Get the two decrpt keys. */ + sid_to_key1(rid,(unsigned char *)deskey1); +- des_set_key((des_cblock *)deskey1,ks1); ++ DES_set_key((DES_cblock *)deskey1, &ks1); + sid_to_key2(rid,(unsigned char *)deskey2); +- des_set_key((des_cblock *)deskey2,ks2); ++ DES_set_key((DES_cblock *)deskey2, &ks2); + } + + /* Decrypt the NT md4 password hash as two 8 byte blocks. */ +- des_ecb_encrypt((des_cblock *)obfkey, +- (des_cblock *)fb, ks1, DES_DECRYPT); +- des_ecb_encrypt((des_cblock *)(obfkey + 8), +- (des_cblock *)&fb[8], ks2, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)obfkey, ++ (DES_cblock *)fb, &ks1, DES_DECRYPT); ++ DES_ecb_encrypt((DES_cblock *)(obfkey + 8), ++ (DES_cblock *)&fb[8], &ks2, DES_DECRYPT); + + /* sf27 wrap to sf25 */ + //sf27( obfkey, (int*)&rid, fb ); diff --git a/misc/samdump2/samdump2.SlackBuild b/misc/samdump2/samdump2.SlackBuild index f158026a3b..356ca875da 100644 --- a/misc/samdump2/samdump2.SlackBuild +++ b/misc/samdump2/samdump2.SlackBuild @@ -79,6 +79,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +patch -p1 < $CWD/openssl_compat.patch + make LIBS="-lcrypto" CFLAGS="$SLKCFLAGS" install -d -m 755 $PKG/usr/bin install samdump2 -m 755 $PKG/usr/bin |