Guest User

Untitled

a guest
Jan 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. diff --git a/src/main/tls.c b/src/main/tls.c
  2. index cb6d0454c3..96f23112df 100644
  3. --- a/src/main/tls.c
  4. +++ b/src/main/tls.c
  5. @@ -2954,29 +2954,6 @@ SSL_CTX *tls_init_ctx(fr_tls_server_conf_t *conf, int client)
  6. return NULL;
  7. }
  8.  
  9. -#if OPENSSL_VERSION_NUMBER >= 0x10100000L
  10. - /*
  11. - * OpenSSL appears to have a bug where it does
  12. - * not allow PSK and certs to be used at the same
  13. - * time. RFC 8446 Section 2 (page 12) says:
  14. - *
  15. - * "Note that implementations can use (EC)DHE and PSK
  16. - * together, in which case both extensions will be supplied."
  17. - *
  18. - * Instead of having weird failures, we just warn
  19. - * the end user.
  20. - */
  21. - if (((conf->psk_identity || conf->psk_password || conf->psk_query)) &&
  22. - (conf->certificate_file || conf->private_key_password || conf->private_key_file)) {
  23. - radlog(L_DBG | L_WARN, "Disabling TLS 1.3 due to PSK and certificates being configured simultaneousy. This is not supported by OpenSSL");
  24. -
  25. - if (!SSL_CTX_set_max_proto_version(ctx, TLS1_2_VERSION)) {
  26. - ERROR("Failed setting maximum TLS version to 1.2 for OpenSSL 1.1, due to PSK and certs.");
  27. - return NULL;
  28. - }
  29. - }
  30. -#endif /* OpenSSL version >1.1.0 */
  31. -
  32. goto post_ca;
  33. }
  34. #else
  35. @@ -3124,6 +3101,24 @@ post_ca:
  36. }
  37.  
  38. #if OPENSSL_VERSION_NUMBER >= 0x10100000L
  39. + /*
  40. + * OpenSSL appears to have a bug where it does
  41. + * not allow PSK and certs to be used at the same
  42. + * time. RFC 8446 Section 2 (page 12) says:
  43. + *
  44. + * "Note that implementations can use (EC)DHE and PSK
  45. + * together, in which case both extensions will be supplied."
  46. + *
  47. + * Instead of having weird failures, we just warn
  48. + * the end user.
  49. + */
  50. + if ((conf->psk_identity || conf->psk_password || conf->psk_query) &&
  51. + (conf->certificate_file || conf->private_key_password || conf->private_key_file) &&
  52. + (max_version == TLS1_3_VERSION)) {
  53. + radlog(L_DBG | L_WARN, "Disabling TLS 1.3 due to PSK and certificates being configured simultaneousy. This is not supported by OpenSSL");
  54. + max_version = TLS1_2_VERSION;
  55. + }
  56. +
  57. if (!SSL_CTX_set_max_proto_version(ctx, max_version)) {
  58. ERROR("Failed setting TLS maximum version");
  59. return NULL;
Add Comment
Please, Sign In to add comment