Skip to content

Commit

Permalink
Merge pull request #242 from InfrastructureServices/openssl-no-engine
Browse files Browse the repository at this point in the history
Thanks you @pemensik
  • Loading branch information
wtoorop authored Jul 20, 2024
2 parents de1a872 + ef77ff8 commit 57edaa0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion examples/ldns-nsec3-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#ifdef HAVE_SSL
#include <openssl/conf.h>
#include <openssl/engine.h>
#endif /* HAVE_SSL */

#define MAX_FILENAME_LEN 250
Expand Down
6 changes: 5 additions & 1 deletion examples/ldns-signzone.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
#include <ldns/keys.h>

#include <openssl/conf.h>
#ifndef OPENSSL_NO_ENGINE
#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
#include <openssl/engine.h>
#else
# ifndef OPENSSL_NO_ENGINE
# define OPENSSL_NO_ENGINE
# endif
#endif
#include <openssl/err.h>

Expand Down
14 changes: 7 additions & 7 deletions keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@
#ifdef USE_DSA
#include <openssl/dsa.h>
#endif
#ifndef OPENSSL_NO_ENGINE
#if defined(HAVE_OPENSSL_ENGINE_H) && !defined(OPENSSL_NO_ENGINE)
#include <openssl/engine.h>
#else
# ifndef OPENSSL_NO_ENGINE
# define OPENSSL_NO_ENGINE
# endif
#endif
#endif /* HAVE_SSL */

Expand Down Expand Up @@ -116,16 +120,12 @@ ldns_key_new_frm_engine(ldns_key **key, ENGINE *e, char *key_id, ldns_algorithm
k = ldns_key_new();
if(!k) return LDNS_STATUS_MEM_ERR;
#ifndef S_SPLINT_S
k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL);
if(!k->_key.key) {
ldns_key_free(k);
return LDNS_STATUS_ERR;
}
ldns_key_set_algorithm(k, (ldns_signing_algorithm) alg);
k->_key.key = ENGINE_load_private_key(e, key_id, UI_OpenSSL(), NULL);
if (!k->_key.key) {
ldns_key_free(k);
return LDNS_STATUS_ENGINE_KEY_NOT_LOADED;
}
}
#endif /* splint */
*key = k;
return LDNS_STATUS_OK;
Expand Down

0 comments on commit 57edaa0

Please sign in to comment.