summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/engine.h
diff options
context:
space:
mode:
authortb <>2023-07-21 09:04:23 +0000
committertb <>2023-07-21 09:04:23 +0000
commitf3f431c8f6134c5d325ede30963e2f1edd9a0718 (patch)
treea06a9f51ed23a061b5e6a00600a42d86ad37ce11 /src/lib/libcrypto/engine/engine.h
parent0fa0e5b768255277d5110ebe72faab0818b80b86 (diff)
downloadopenbsd-f3f431c8f6134c5d325ede30963e2f1edd9a0718.tar.gz
openbsd-f3f431c8f6134c5d325ede30963e2f1edd9a0718.tar.bz2
openbsd-f3f431c8f6134c5d325ede30963e2f1edd9a0718.zip
Provide a bunch of always failing ENGINE API
This commit adds a few symbols under OPENSSL_NO_ENGINE. They will be used after the main ENGINE code is disabled in the next bump. The ecosystem is mostly prepared for dealing with a libcrypto compiled with OPENSSL_NO_ENGINE. There are a few stragglers like M2Crypto, dovecot and the latest apr-util release (fixed in their development branch). To avoid intrusive patching in these ports, we need to keep a bunch of ENGINE symbols around despite adding OPENSSL_NO_ENGINE. This of course meant patching some other ports, but that was way easier. ok jsing
Diffstat (limited to 'src/lib/libcrypto/engine/engine.h')
-rw-r--r--src/lib/libcrypto/engine/engine.h44
1 files changed, 39 insertions, 5 deletions
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h
index 0c620ba7f8..156c2f856c 100644
--- a/src/lib/libcrypto/engine/engine.h
+++ b/src/lib/libcrypto/engine/engine.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: engine.h,v 1.38 2023/04/18 09:10:44 tb Exp $ */ 1/* $OpenBSD: engine.h,v 1.39 2023/07/21 09:04:23 tb Exp $ */
2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -66,10 +66,6 @@
66 66
67#include <openssl/opensslconf.h> 67#include <openssl/opensslconf.h>
68 68
69#ifdef OPENSSL_NO_ENGINE
70#error ENGINE is disabled.
71#endif
72
73#include <openssl/bn.h> 69#include <openssl/bn.h>
74#ifndef OPENSSL_NO_DH 70#ifndef OPENSSL_NO_DH
75#include <openssl/dh.h> 71#include <openssl/dh.h>
@@ -246,6 +242,43 @@ extern "C" {
246 * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */ 242 * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc). */
247#define ENGINE_CMD_BASE 200 243#define ENGINE_CMD_BASE 200
248 244
245/*
246 * Prototypes for the stub functions in engine_stubs.c. They are provided to
247 * build M2Crypto, Dovecot, apr-utils without patching. All the other garbage
248 * can hopefully go away soon.
249 */
250#ifdef OPENSSL_NO_ENGINE
251void ENGINE_load_builtin_engines(void);
252void ENGINE_load_dynamic(void);
253void ENGINE_load_openssl(void);
254int ENGINE_register_all_complete(void);
255
256void ENGINE_cleanup(void);
257ENGINE *ENGINE_new(void);
258
259int ENGINE_free(ENGINE *engine);
260int ENGINE_init(ENGINE *engine);
261int ENGINE_finish(ENGINE *engine);
262
263ENGINE *ENGINE_by_id(const char *id);
264const char *ENGINE_get_id(const ENGINE *engine);
265const char *ENGINE_get_name(const ENGINE *engine);
266
267int ENGINE_set_default(ENGINE *engine, unsigned int flags);
268
269ENGINE *ENGINE_get_default_RSA(void);
270int ENGINE_set_default_RSA(ENGINE *engine);
271
272int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, long i, void *p,
273 void (*f)(void), int cmd_optional);
274int ENGINE_ctrl_cmd_string(ENGINE *engine, const char *cmd, const char *arg,
275 int cmd_optional);
276
277EVP_PKEY *ENGINE_load_private_key(ENGINE *engine, const char *key_id,
278 UI_METHOD *ui_method, void *callback_data);
279EVP_PKEY *ENGINE_load_public_key(ENGINE *engine, const char *key_id,
280 UI_METHOD *ui_method, void *callback_data);
281#else
249/* If an ENGINE supports its own specific control commands and wishes the 282/* If an ENGINE supports its own specific control commands and wishes the
250 * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on its 283 * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on its
251 * behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN entries 284 * behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN entries
@@ -714,6 +747,7 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
714 void *ENGINE_get_static_state(void); 747 void *ENGINE_get_static_state(void);
715 748
716void ERR_load_ENGINE_strings(void); 749void ERR_load_ENGINE_strings(void);
750#endif
717 751
718/* Error codes for the ENGINE functions. */ 752/* Error codes for the ENGINE functions. */
719 753