0001-src-ocsp.c-fix-build-with-OPENSSL_NO_PSK.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 93e5cdd68b13cc3161d9b0094b0f331bdaf07cbc Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sat, 6 Jan 2024 17:28:20 +0100
  4. Subject: [PATCH] src/ocsp.c: fix build with OPENSSL_NO_PSK
  5. Fix the following build failure with OPENSSL_NO_PSK:
  6. ocsp.c: In function 'ocsp_init':
  7. ocsp.c:112:20: error: 'SERVICE_OPTIONS' {aka 'struct service_options_struct'} has no member named 'psk_keys'
  8. 112 | if(!section->psk_keys) {
  9. | ^~
  10. Fixes:
  11. - http://autobuild.buildroot.org/results/1707beea413a8da8713ad2dc59db947329da45d2
  12. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  13. Upstream: https://github.com/mtrojnar/stunnel/pull/18
  14. ---
  15. src/ocsp.c | 4 ++++
  16. 1 file changed, 4 insertions(+)
  17. diff --git a/src/ocsp.c b/src/ocsp.c
  18. index 5073ded..12792af 100644
  19. --- a/src/ocsp.c
  20. +++ b/src/ocsp.c
  21. @@ -109,12 +109,16 @@ int ocsp_init(SERVICE_OPTIONS *section) {
  22. s_log(LOG_DEBUG, "OCSP: Client OCSP stapling enabled");
  23. } else {
  24. #if OPENSSL_VERSION_NUMBER>=0x10002000L
  25. +#ifndef OPENSSL_NO_PSK
  26. if(!section->psk_keys) {
  27. +#endif
  28. if(SSL_CTX_set_tlsext_status_cb(section->ctx, ocsp_server_cb)==TLSEXT_STATUSTYPE_ocsp)
  29. s_log(LOG_DEBUG, "OCSP: Server OCSP stapling enabled");
  30. +#ifndef OPENSSL_NO_PSK
  31. } else {
  32. s_log(LOG_NOTICE, "OCSP: Server OCSP stapling is incompatible with PSK");
  33. }
  34. +#endif
  35. #else /* OpenSSL version 1.0.2 or later */
  36. s_log(LOG_NOTICE, "OCSP: Server OCSP stapling not supported");
  37. #endif /* OpenSSL version 1.0.2 or later */
  38. --
  39. 2.43.0