diff options
Diffstat (limited to 'crypto/openssl/apps/lib/engine_loader.c')
| -rw-r--r-- | crypto/openssl/apps/lib/engine_loader.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/crypto/openssl/apps/lib/engine_loader.c b/crypto/openssl/apps/lib/engine_loader.c index e0f26f614afe..dd391bafe4fa 100644 --- a/crypto/openssl/apps/lib/engine_loader.c +++ b/crypto/openssl/apps/lib/engine_loader.c @@ -19,10 +19,10 @@ #ifndef OPENSSL_NO_ENGINE -# include <stdarg.h> -# include <string.h> -# include <openssl/engine.h> -# include <openssl/store.h> +#include <stdarg.h> +#include <string.h> +#include <openssl/engine.h> +#include <openssl/store.h> /* * Support for legacy private engine keys via the 'org.openssl.engine:' scheme @@ -36,10 +36,10 @@ /* Local definition of OSSL_STORE_LOADER_CTX */ struct ossl_store_loader_ctx_st { - ENGINE *e; /* Structural reference */ + ENGINE *e; /* Structural reference */ char *keyid; int expected; - int loaded; /* 0 = key not loaded yet, 1 = key loaded */ + int loaded; /* 0 = key not loaded yet, 1 = key loaded */ }; static OSSL_STORE_LOADER_CTX *OSSL_STORE_LOADER_CTX_new(ENGINE *e, char *keyid) @@ -63,9 +63,9 @@ static void OSSL_STORE_LOADER_CTX_free(OSSL_STORE_LOADER_CTX *ctx) } static OSSL_STORE_LOADER_CTX *engine_open(const OSSL_STORE_LOADER *loader, - const char *uri, - const UI_METHOD *ui_method, - void *ui_data) + const char *uri, + const UI_METHOD *ui_method, + void *ui_data) { const char *p = uri, *q; ENGINE *e = NULL; @@ -77,9 +77,9 @@ static OSSL_STORE_LOADER_CTX *engine_open(const OSSL_STORE_LOADER *loader, /* Look for engine ID */ q = strchr(p, ':'); - if (q != NULL /* There is both an engine ID and a key ID */ - && p[0] != ':' /* The engine ID is at least one character */ - && q[1] != '\0') { /* The key ID is at least one character */ + if (q != NULL /* There is both an engine ID and a key ID */ + && p[0] != ':' /* The engine ID is at least one character */ + && q[1] != '\0') { /* The key ID is at least one character */ char engineid[256]; size_t engineid_l = q - p; @@ -113,7 +113,7 @@ static int engine_expect(OSSL_STORE_LOADER_CTX *ctx, int expected) } static OSSL_STORE_INFO *engine_load(OSSL_STORE_LOADER_CTX *ctx, - const UI_METHOD *ui_method, void *ui_data) + const UI_METHOD *ui_method, void *ui_data) { EVP_PKEY *pkey = NULL, *pubkey = NULL; OSSL_STORE_INFO *info = NULL; @@ -122,14 +122,12 @@ static OSSL_STORE_INFO *engine_load(OSSL_STORE_LOADER_CTX *ctx, if (ENGINE_init(ctx->e)) { if (ctx->expected == 0 || ctx->expected == OSSL_STORE_INFO_PKEY) - pkey = - ENGINE_load_private_key(ctx->e, ctx->keyid, - (UI_METHOD *)ui_method, ui_data); + pkey = ENGINE_load_private_key(ctx->e, ctx->keyid, + (UI_METHOD *)ui_method, ui_data); if ((pkey == NULL && ctx->expected == 0) || ctx->expected == OSSL_STORE_INFO_PUBKEY) - pubkey = - ENGINE_load_public_key(ctx->e, ctx->keyid, - (UI_METHOD *)ui_method, ui_data); + pubkey = ENGINE_load_public_key(ctx->e, ctx->keyid, + (UI_METHOD *)ui_method, ui_data); ENGINE_finish(ctx->e); } } @@ -188,7 +186,7 @@ void destroy_engine_loader(void) OSSL_STORE_LOADER_free(loader); } -#else /* !OPENSSL_NO_ENGINE */ +#else /* !OPENSSL_NO_ENGINE */ int setup_engine_loader(void) { |
