Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37040762
en ru br
Репозитории ALT
S:0.6.12.1-alt1
5.1: 0.6.1-alt5
www.altlinux.org/Changes

Группа :: Система/Основа
Пакет: pam_pkcs11

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: pam_pkcs11-0.6.9-build-with-LibreSSL.patch
Скачать


diff --git a/src/common/pam-pkcs11-ossl-compat.h b/src/common/pam-pkcs11-ossl-compat.h
index e14abb1..8d61849 100644
--- a/src/common/pam-pkcs11-ossl-compat.h
+++ b/src/common/pam-pkcs11-ossl-compat.h
@@ -105,6 +105,22 @@ extern "C" {
 	})
 #endif
 
+#if defined(LIBRESSL_VERSION_NUMBER)
+#define EVP_MD_CTX_new			EVP_MD_CTX_create
+#define EVP_MD_CTX_free			EVP_MD_CTX_destroy
+
+#if LIBRESSL_VERSION_NUMBER < 0x2070300fL
+#define X509_OBJECT_get0_X509(x)	(x->data.x509)
+#define X509_OBJECT_get0_X509_CRL(x)	(x->data.crl)
+#endif
+
+#define X509_OBJECT_free(x) ({ \
+	if (x) { \
+		X509_OBJECT_free_contents(x); \
+		OPENSSL_free(x); \
+		} \
+	})
+#endif
 
 /*
  * OpenSSL-1.1.0-pre5 has hidden the RSA and DSA structures
@@ -113,7 +129,7 @@ extern "C" {
  * If that is not good enough, vsersions could be added to libopensc
  */
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 /* based on OpenSSL-1.1.0 e_os2.h */
 /* pam_pkcs11_ossl_inline: portable inline definition usable in public headers */
 # if !defined(inline) && !defined(__cplusplus)
@@ -132,9 +148,11 @@ extern "C" {
 # endif
 #endif
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
 
+#if LIBRESSL_VERSION_NUMBER < 0x2070300fL
 #define RSA_bits(R) (BN_num_bits(R->n))
+#endif
 #include <openssl/bn.h>
 #ifndef OPENSSL_NO_RSA
@@ -144,6 +162,7 @@ extern "C" {
 #include <openssl/dsa.h>
 #endif
+#if LIBRESSL_VERSION_NUMBER < 0x2070300fL
 #if 1
 #ifndef OPENSSL_NO_RSA
 static pam_pkcs11_ossl_inline int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
@@ -337,6 +356,7 @@ static pam_pkcs11_ossl_inline void DSA_get0_key(const DSA *d, const BIGNUM **pub
 /* NOTE: DSA_set0_*  functions not defined because they are not used in OpenSC */
 #endif /* 0 */
+#endif /* old LibreSSL */
 #endif
 
 #ifdef __cplusplus
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin