220-disable_des.patch 1.6 KB

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