Blob Blame Raw
Patch from legacy to modern version of openssl
diff -ru samdump2-3.0.0.old/Makefile samdump2-3.0.0.new/Makefile
--- samdump2-3.0.0.old/Makefile	2019-10-20 02:48:09.916426807 +0200
+++ samdump2-3.0.0.new/Makefile	2019-10-20 03:44:30.307001144 +0200
@@ -30,7 +30,7 @@
 INSTALL   = $(shell which install)
 CC	  = $(shell which gcc)
 CFLAGS    = -Wall 
-LIBS      = -lssl
+LIBS      = -lssl -lcrypto
 OWNER     = root
 GROUP     = root
 
Only in samdump2-3.0.0.new: samdump2
diff -ru samdump2-3.0.0.old/samdump2.c samdump2-3.0.0.new/samdump2.c
--- samdump2-3.0.0.old/samdump2.c	2019-10-20 02:48:09.916426807 +0200
+++ samdump2-3.0.0.new/samdump2.c	2019-10-20 03:33:27.394802654 +0200
@@ -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 );
Only in samdump2-3.0.0.new: samdump2.o