@@ -163,7 +163,12 @@ static PyObject* PyXmlSec_KeyFromFile(PyObject* self, PyObject* args, PyObject*
163
163
if (is_content ) {
164
164
key -> handle = xmlSecCryptoAppKeyLoadMemory ((const xmlSecByte * )data , (xmlSecSize )data_size , format , password , NULL , NULL );
165
165
} else {
166
- key -> handle = xmlSecCryptoAppKeyLoadEx (data , xmlSecKeyDataTypePrivate , format , password , NULL , NULL );
166
+ #if XMLSEC_VERSION_HEX >= 0x10303
167
+ // from version 1.3.3 (inclusive)
168
+ key -> handle = xmlSecCryptoAppKeyLoadEx (data , xmlSecKeyDataTypePrivate , format , password , NULL , NULL );
169
+ #else
170
+ key -> handle = xmlSecCryptoAppKeyLoad (data , format , password , NULL , NULL );
171
+ #endif
167
172
}
168
173
Py_END_ALLOW_THREADS ;
169
174
@@ -206,8 +211,12 @@ static PyObject* PyXmlSec_KeyFromEngine(PyObject* self, PyObject* args, PyObject
206
211
if ((key = PyXmlSec_NewKey1 ((PyTypeObject * )self )) == NULL ) goto ON_FAIL ;
207
212
208
213
Py_BEGIN_ALLOW_THREADS ;
209
- key -> handle = xmlSecCryptoAppKeyLoadEx (engine_and_key_id , xmlSecKeyDataTypePrivate , xmlSecKeyDataFormatEngine , NULL , xmlSecCryptoAppGetDefaultPwdCallback (),
210
- (void * )engine_and_key_id );
214
+ #if XMLSEC_VERSION_HEX >= 0x10303
215
+ // from version 1.3.3 (inclusive)
216
+ key -> handle = xmlSecCryptoAppKeyLoadEx (engine_and_key_id , xmlSecKeyDataTypePrivate , xmlSecKeyDataFormatEngine , NULL , xmlSecCryptoAppGetDefaultPwdCallback (), (void * )engine_and_key_id );
217
+ #else
218
+ key -> handle = xmlSecCryptoAppKeyLoad (engine_and_key_id , xmlSecKeyDataFormatEngine , NULL , xmlSecCryptoAppGetDefaultPwdCallback (), (void * )engine_and_key_id );
219
+ #endif
211
220
Py_END_ALLOW_THREADS ;
212
221
213
222
if (key -> handle == NULL ) {
0 commit comments