Skip to content

Commit 5f57f2e

Browse files
committed
Add compatibility for xmlsec 1.3
1 parent 1563947 commit 5f57f2e

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

doc/source/modules/constants.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,6 @@ Namespaces
166166
.. data:: xmlsec.constants.XPointerNs
167167
:annotation: = 'http://www.w3.org/2001/04/xmldsig-more/xptr'
168168

169-
.. data:: xmlsec.constants.Soap11Ns
170-
:annotation: = 'http://schemas.xmlsoap.org/soap/envelope/'
171-
172-
.. data:: xmlsec.constants.Soap12Ns
173-
:annotation: = 'http://www.w3.org/2002/06/soap-envelope'
174-
175169
.. data:: xmlsec.constants.NsExcC14N
176170
:annotation: = 'http://www.w3.org/2001/10/xml-exc-c14n#'
177171

src/constants.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,6 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
316316
PYXMLSEC_ADD_NS_CONSTANT(XPathNs, "XPATH");
317317
PYXMLSEC_ADD_NS_CONSTANT(XPath2Ns, "XPATH2");
318318
PYXMLSEC_ADD_NS_CONSTANT(XPointerNs, "XPOINTER");
319-
PYXMLSEC_ADD_NS_CONSTANT(Soap11Ns, "SOAP11");
320-
PYXMLSEC_ADD_NS_CONSTANT(Soap12Ns, "SOAP12");
321319
PYXMLSEC_ADD_NS_CONSTANT(NsExcC14N, "EXC_C14N");
322320
PYXMLSEC_ADD_NS_CONSTANT(NsExcC14NWithComments, "EXC_C14N_WITH_COMMENT");
323321

src/enc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ static int PyXmlSec_EncryptionContext__init__(PyObject* self, PyObject* args, Py
5050
}
5151
ctx->manager = manager;
5252
PYXMLSEC_DEBUGF("%p: init enc context - ok, manager - %p", self, manager);
53+
54+
// xmlsec 1.3 changed the key search to strict mode, causing various examples
55+
// in the docs to fail. For backwards compatibility, this changes it back to
56+
// lax mode for now.
57+
ctx->handle->keyInfoReadCtx.flags = XMLSEC_KEYINFO_FLAGS_LAX_KEY_SEARCH;
58+
ctx->handle->keyInfoWriteCtx.flags = XMLSEC_KEYINFO_FLAGS_LAX_KEY_SEARCH;
59+
5360
return 0;
5461
ON_FAIL:
5562
PYXMLSEC_DEBUGF("%p: init enc context - failed", self);

src/xmlsec/constants.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ NodeX509Data: Final[str]
8585
Ns: Final[str]
8686
NsExcC14N: Final[str]
8787
NsExcC14NWithComments: Final[str]
88-
Soap11Ns: Final[str]
89-
Soap12Ns: Final[str]
9088
TransformAes128Cbc: Final[__Transform]
9189
TransformAes128Gcm: Final[__Transform]
9290
TransformAes192Cbc: Final[__Transform]

0 commit comments

Comments
 (0)