Skip to content

Commit c97f2b8

Browse files
Make DES/3DES/KW-3DES support conditional on DES availability in XMLSec
Some TLS libraries (e.g. OpenSSL) can be built without support for DES and DES-derived algorithms. Rather than assuming that xmlsec always supports them, guard the declaration of the DES, 3DES and KW-3DES constants based on the value of `XMLSEC_NO_DES`. Fixes #269.
1 parent 1563947 commit c97f2b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/constants.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,9 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
441441
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataRetrievalMethod, "RETRIEVALMETHOD")
442442
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataEncryptedKey, "ENCRYPTEDKEY")
443443
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataAes, "AES")
444+
#ifndef XMLSEC_NO_DES
444445
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataDes, "DES")
446+
#endif
445447
#ifndef XMLSEC_NO_DSA
446448
PYXMLSEC_ADD_KEYDATA_CONSTANT(KeyDataDsa, "DSA")
447449
#endif
@@ -489,8 +491,10 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
489491
PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformKWAes192, "KW_AES192");
490492
PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformKWAes256, "KW_AES256");
491493

494+
#ifndef XMLSEC_NO_DES
492495
PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformDes3Cbc, "DES3");
493496
PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformKWDes3, "KW_DES3");
497+
#endif
494498
#ifndef XMLSEC_NO_DSA
495499
PYXMLSEC_ADD_TRANSFORM_CONSTANT(TransformDsaSha1, "DSA_SHA1");
496500
#endif

0 commit comments

Comments
 (0)