220-disable_des.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --- a/src/openvpn/syshead.h
  2. +++ b/src/openvpn/syshead.h
  3. @@ -597,11 +597,11 @@ socket_defined(const socket_descriptor_t
  4. /*
  5. * Should we include NTLM proxy functionality
  6. */
  7. -#if defined(ENABLE_CRYPTO)
  8. -#define NTLM 1
  9. -#else
  10. +//#if defined(ENABLE_CRYPTO)
  11. +//#define NTLM 1
  12. +//#else
  13. #define NTLM 0
  14. -#endif
  15. +//#endif
  16. /*
  17. * Should we include proxy digest auth functionality
  18. --- a/src/openvpn/crypto_mbedtls.c
  19. +++ b/src/openvpn/crypto_mbedtls.c
  20. @@ -319,6 +319,7 @@ int
  21. key_des_num_cblocks(const mbedtls_cipher_info_t *kt)
  22. {
  23. int ret = 0;
  24. +#ifdef MBEDTLS_DES_C
  25. if (kt->type == MBEDTLS_CIPHER_DES_CBC)
  26. {
  27. ret = 1;
  28. @@ -331,6 +332,7 @@ key_des_num_cblocks(const mbedtls_cipher
  29. {
  30. ret = 3;
  31. }
  32. +#endif
  33. dmsg(D_CRYPTO_DEBUG, "CRYPTO INFO: n_DES_cblocks=%d", ret);
  34. return ret;
  35. @@ -339,6 +341,7 @@ key_des_num_cblocks(const mbedtls_cipher
  36. bool
  37. key_des_check(uint8_t *key, int key_len, int ndc)
  38. {
  39. +#ifdef MBEDTLS_DES_C
  40. int i;
  41. struct buffer b;
  42. @@ -367,11 +370,15 @@ key_des_check(uint8_t *key, int key_len,
  43. err:
  44. return false;
  45. +#else
  46. + return true;
  47. +#endif
  48. }
  49. void
  50. key_des_fixup(uint8_t *key, int key_len, int ndc)
  51. {
  52. +#ifdef MBEDTLS_DES_C
  53. int i;
  54. struct buffer b;
  55. @@ -386,6 +393,7 @@ key_des_fixup(uint8_t *key, int key_len,
  56. }
  57. mbedtls_des_key_set_parity(key);
  58. }
  59. +#endif
  60. }
  61. /*
  62. @@ -710,10 +718,12 @@ cipher_des_encrypt_ecb(const unsigned ch
  63. unsigned char *src,
  64. unsigned char *dst)
  65. {
  66. +#ifdef MBEDTLS_DES_C
  67. mbedtls_des_context ctx;
  68. ASSERT(mbed_ok(mbedtls_des_setkey_enc(&ctx, key)));
  69. ASSERT(mbed_ok(mbedtls_des_crypt_ecb(&ctx, src, dst)));
  70. +#endif
  71. }