weak-ciphers.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. From: Александр Сомов <somov@yandex-team.ru>
  2. Date: Tue, 2 Apr 2019 12:24:57 +0000
  3. Subject: [PATCH] Enable weak ciphers
  4. REVIEW: 783205
  5. git-svn-id: svn+ssh://arcadia.yandex.ru/arc/trunk/arcadia/contrib/libs/openssl@4736527 41d65440-b5be-11dd-afe3-b2e846d9b4f8
  6. --- a/include/openssl/opensslconf-linux.h
  7. +++ b/include/openssl/opensslconf-linux.h
  8. @@ -75,6 +75,13 @@
  9. -#ifndef OPENSSL_NO_SSL3
  10. -# define OPENSSL_NO_SSL3
  11. -#endif
  12. -#ifndef OPENSSL_NO_SSL3_METHOD
  13. -# define OPENSSL_NO_SSL3_METHOD
  14. +
  15. +// https://st.yandex-team.ru/DEVTOOLS-5331
  16. +#define Y_OPENSSL_ENABLE_DEPRECATED
  17. +
  18. +#if !defined(Y_OPENSSL_ENABLE_DEPRECATED)
  19. +# ifndef OPENSSL_NO_SSL3
  20. +# define OPENSSL_NO_SSL3
  21. +# endif
  22. +# ifndef OPENSSL_NO_SSL3_METHOD
  23. +# define OPENSSL_NO_SSL3_METHOD
  24. +# endif
  25. #endif
  26. +
  27. @@ -90,3 +97,8 @@
  28. -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  29. -# define OPENSSL_NO_WEAK_SSL_CIPHERS
  30. +
  31. +// https://st.yandex-team.ru/DEVTOOLS-5331
  32. +#if !defined(Y_OPENSSL_ENABLE_DEPRECATED)
  33. +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
  34. +# define OPENSSL_NO_WEAK_SSL_CIPHERS
  35. +# endif
  36. #endif
  37. +
  38. --- a/ssl/ssl_cert.c
  39. +++ b/ssl/ssl_cert.c
  40. @@ -942,9 +942,14 @@ static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
  41. /* No unauthenticated ciphersuites */
  42. if (c->algorithm_auth & SSL_aNULL)
  43. return 0;
  44. +
  45. + // https://st.yandex-team.ru/DEVTOOLS-5331
  46. +#if !defined(Y_OPENSSL_ENABLE_DEPRECATED)
  47. /* No MD5 mac ciphersuites */
  48. if (c->algorithm_mac & SSL_MD5)
  49. return 0;
  50. +#endif
  51. +
  52. /* SHA1 HMAC is 160 bits of security */
  53. if (minbits > 160 && c->algorithm_mac & SSL_SHA1)
  54. return 0;