user/py3-xmlsec: add xmlsec 1.3.3 support

This commit is contained in:
Antoine Martin 2024-01-19 23:17:24 -05:00
parent c271508b7f
commit 018226775d
2 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,35 @@
diff --git a/src/constants.c.orig b/src/constants.c
index 72ae217..b12d0ad 100644
--- a/src/constants.c.orig
+++ b/src/constants.c
@@ -445,7 +445,7 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
#endif
#if XMLSEC_VERSION_HEX > 0x10212
// from version 1.2.19
- PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataEcdsa, "ECDSA")
+ PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataEc, "ECDSA")
#endif
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataHmac, "HMAC")
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataRsa, "RSA")
diff --git a/src/keys.c.orig b/src/keys.c
index 1440331..8b84c34 100644
--- a/src/keys.c.orig
+++ b/src/keys.c
@@ -163,7 +163,7 @@ static PyObject* PyXmlSec_KeyFromFile(PyObject* self, PyObject* args, PyObject*
if (is_content) {
key->handle = xmlSecCryptoAppKeyLoadMemory((const xmlSecByte*)data, (xmlSecSize)data_size, format, password, NULL, NULL);
} else {
- key->handle = xmlSecCryptoAppKeyLoad(data, format, password, NULL, NULL);
+ key->handle = xmlSecCryptoAppKeyLoadEx(data, xmlSecKeyDataTypePrivate, format, password, NULL, NULL);
}
Py_END_ALLOW_THREADS;
@@ -206,7 +206,7 @@ static PyObject* PyXmlSec_KeyFromEngine(PyObject* self, PyObject* args, PyObject
if ((key = PyXmlSec_NewKey1((PyTypeObject*)self)) == NULL) goto ON_FAIL;
Py_BEGIN_ALLOW_THREADS;
- key->handle = xmlSecCryptoAppKeyLoad(engine_and_key_id, xmlSecKeyDataFormatEngine, NULL, xmlSecCryptoAppGetDefaultPwdCallback(),
+ key->handle = xmlSecCryptoAppKeyLoadEx(engine_and_key_id, xmlSecKeyDataTypePrivate, xmlSecKeyDataFormatEngine, NULL, xmlSecCryptoAppGetDefaultPwdCallback(),
(void*)engine_and_key_id);
Py_END_ALLOW_THREADS;

View file

@ -4,7 +4,7 @@
_pyname=xmlsec
pkgname="py3-$_pyname"
pkgver=1.3.13
pkgrel=4
pkgrel=5
arch="all"
pkgdesc="Python bindings for the XML Security Library"
url="https://pypi.python.org/project/$_pyname"
@ -28,6 +28,7 @@ source="
$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz
253_pkcs11-support.patch
264_xmlsec3-support.patch
280_fix-function-deprecation.patch
"
builddir="$srcdir"/$_pyname-$pkgver
@ -52,4 +53,5 @@ sha512sums="
2aa080fbc918d5d360dcb086a8c529545514dd429649d99833425f92fa06a3a094cf3139f8ed00827fed358f0fa463b74c267e593ac14e5aadc299d64206ac8e py3-xmlsec-1.3.13.tar.gz
9155a2435d832b4dcd0260616f52eec148dca1dade76a89c23e10f017e4140024ef042b6b10c5b9435fcbf52e7dc4f7e5764dc7f5bdd7595c27b3106fab942cf 253_pkcs11-support.patch
d901c09a49145250dd9325476c1356f820519b9248195240584f6de62b8084205f698501a1f48e42b63fe4c7b169dcb65540edc03724ef7e9297b45216c5b481 264_xmlsec3-support.patch
a47d4d44a518939e72ff7213c6dcd2c391ff5e1bb2be6a1b0d0ab1ef6ed0155d81c26b8f844285883db2f8954b122e48a9b1bccf343a5344af7f1723b3fdd78d 280_fix-function-deprecation.patch
"