You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

  1. From 03ecd34e0137b3f0bf0d2fc3ab7f7d8b3682785e Mon Sep 17 00:00:00 2001
  2. From: Yousong Zhou <yszhou4tech@gmail.com>
  3. Date: Thu, 14 Dec 2017 18:03:35 +0800
  4. Subject: [PATCH] Fix compilation with libp11 version >= 0.4.7
  5. libp11 0.4.7 renamed then dropped macro definition in commits
  6. 4f0fce4: Error reporting fixes
  7. e4c641b: PKCS11 errors separated into P11 and CKR
  8. This change assumes that libp11 will restore compatibility by bringing
  9. back old forms of macro definition
  10. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
  11. ---
  12. openssl-pkcs11.c | 18 ++++++++++++++++++
  13. 1 file changed, 18 insertions(+)
  14. diff --git a/openssl-pkcs11.c b/openssl-pkcs11.c
  15. index 61da123..ba7e491 100644
  16. --- a/openssl-pkcs11.c
  17. +++ b/openssl-pkcs11.c
  18. @@ -30,6 +30,24 @@
  19. #include <libp11.h>
  20. #include <p11-kit/pkcs11.h>
  21. +#ifndef ERR_LIB_PKCS11
  22. +# if defined(ERR_LIB_CKR)
  23. +# define ERR_LIB_PKCS11 ERR_LIB_CKR
  24. +# elif defined(ERR_LIB_USER)
  25. +# define ERR_LIB_PKCS11 ERR_LIB_USER
  26. +# else
  27. +# error undefined macro ERR_LIB_PKCS11
  28. +# endif
  29. +#endif
  30. +
  31. +#ifndef PKCS11_F_PKCS11_LOGIN
  32. +# if defined(CKR_F_PKCS11_LOGIN)
  33. +# define PKCS11_F_PKCS11_LOGIN CKR_F_PKCS11_LOGIN
  34. +# else
  35. +# error undefined macro PKCS11_F_PKCS11_LOGIN
  36. +# endif
  37. +#endif
  38. +
  39. static PKCS11_CTX *pkcs11_ctx(struct openconnect_info *vpninfo)
  40. {
  41. PKCS11_CTX *ctx;
  42. --
  43. 1.8.3.1