openssl_compat.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. diff -Naur a/Makefile b/Makefile
  2. --- a/Makefile 2012-04-20 20:27:00.000000000 +0800
  3. +++ b/Makefile 2018-01-30 12:12:55.114072617 +0800
  4. @@ -30,7 +30,7 @@
  5. INSTALL = $(shell which install)
  6. CC = $(shell which gcc)
  7. CFLAGS = -Wall
  8. -LIBS = -lssl
  9. +LIBS = -lssl -lcrypto
  10. # Default target
  11. all: build
  12. diff -Naur a/samdump2.c b/samdump2.c
  13. --- a/samdump2.c 2012-04-20 20:27:00.000000000 +0800
  14. +++ b/samdump2.c 2018-01-30 12:10:49.627208011 +0800
  15. @@ -58,7 +58,7 @@
  16. void str_to_key(unsigned char *str,unsigned char *key)
  17. {
  18. - // void des_set_odd_parity(des_cblock *);
  19. + // void DES_set_odd_parity(DES_cblock *);
  20. int i;
  21. key[0] = str[0]>>1;
  22. @@ -72,7 +72,7 @@
  23. for (i=0;i<8;i++) {
  24. key[i] = (key[i]<<1);
  25. }
  26. - des_set_odd_parity((des_cblock *)key);
  27. + DES_set_odd_parity((DES_cblock *)key);
  28. }
  29. /*
  30. @@ -210,8 +210,8 @@
  31. unsigned char hbootkey[0x20];
  32. /* Des */
  33. - des_key_schedule ks1, ks2;
  34. - des_cblock deskey1, deskey2;
  35. + DES_key_schedule ks1, ks2;
  36. + DES_cblock deskey1, deskey2;
  37. int i, j;
  38. @@ -419,15 +419,15 @@
  39. /* Get the two decrpt keys. */
  40. sid_to_key1(rid,(unsigned char *)deskey1);
  41. - des_set_key_checked((des_cblock *)deskey1,ks1);
  42. + DES_set_key_checked((DES_cblock *)deskey1, &ks1);
  43. sid_to_key2(rid,(unsigned char *)deskey2);
  44. - des_set_key_unchecked((des_cblock *)deskey2,ks2);
  45. + DES_set_key_unchecked((DES_cblock *)deskey2, &ks2);
  46. /* Decrypt the lanman password hash as two 8 byte blocks. */
  47. - des_ecb_encrypt((des_cblock *)obfkey,
  48. - (des_cblock *)fb, ks1, DES_DECRYPT);
  49. - des_ecb_encrypt((des_cblock *)(obfkey + 8),
  50. - (des_cblock *)&fb[8], ks2, DES_DECRYPT);
  51. + DES_ecb_encrypt((DES_cblock *)obfkey,
  52. + (DES_cblock *)fb, &ks1, DES_DECRYPT);
  53. + DES_ecb_encrypt((DES_cblock *)(obfkey + 8),
  54. + (DES_cblock *)&fb[8], &ks2, DES_DECRYPT);
  55. @@ -472,16 +472,16 @@
  56. if (lm_size != 0x14) {
  57. /* Get the two decrpt keys. */
  58. sid_to_key1(rid,(unsigned char *)deskey1);
  59. - des_set_key((des_cblock *)deskey1,ks1);
  60. + DES_set_key((DES_cblock *)deskey1, &ks1);
  61. sid_to_key2(rid,(unsigned char *)deskey2);
  62. - des_set_key((des_cblock *)deskey2,ks2);
  63. + DES_set_key((DES_cblock *)deskey2, &ks2);
  64. }
  65. /* Decrypt the NT md4 password hash as two 8 byte blocks. */
  66. - des_ecb_encrypt((des_cblock *)obfkey,
  67. - (des_cblock *)fb, ks1, DES_DECRYPT);
  68. - des_ecb_encrypt((des_cblock *)(obfkey + 8),
  69. - (des_cblock *)&fb[8], ks2, DES_DECRYPT);
  70. + DES_ecb_encrypt((DES_cblock *)obfkey,
  71. + (DES_cblock *)fb, &ks1, DES_DECRYPT);
  72. + DES_ecb_encrypt((DES_cblock *)(obfkey + 8),
  73. + (DES_cblock *)&fb[8], &ks2, DES_DECRYPT);
  74. /* sf27 wrap to sf25 */
  75. //sf27( obfkey, (int*)&rid, fb );