Lines Matching refs:ctx
46 OSSL_STORE_LOADER_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
48 if (ctx != NULL) {
49 ctx->e = e;
50 ctx->keyid = keyid;
52 return ctx;
55 static void OSSL_STORE_LOADER_CTX_free(OSSL_STORE_LOADER_CTX *ctx)
57 if (ctx != NULL) {
58 ENGINE_free(ctx->e);
59 OPENSSL_free(ctx->keyid);
60 OPENSSL_free(ctx);
72 OSSL_STORE_LOADER_CTX *ctx = NULL;
95 ctx = OSSL_STORE_LOADER_CTX_new(e, keyid);
97 if (ctx == NULL) {
102 return ctx;
105 static int engine_expect(OSSL_STORE_LOADER_CTX *ctx, int expected)
110 ctx->expected = expected;
116 static OSSL_STORE_INFO *engine_load(OSSL_STORE_LOADER_CTX *ctx,
122 if (ctx->loaded == 0) {
123 if (ENGINE_init(ctx->e)) {
124 if (ctx->expected == 0
125 || ctx->expected == OSSL_STORE_INFO_PKEY)
127 ENGINE_load_private_key(ctx->e, ctx->keyid,
129 if ((pkey == NULL && ctx->expected == 0)
130 || ctx->expected == OSSL_STORE_INFO_PUBKEY)
132 ENGINE_load_public_key(ctx->e, ctx->keyid,
134 ENGINE_finish(ctx->e);
138 ctx->loaded = 1;
151 static int engine_eof(OSSL_STORE_LOADER_CTX *ctx)
153 return ctx->loaded != 0;
156 static int engine_error(OSSL_STORE_LOADER_CTX *ctx)
161 static int engine_close(OSSL_STORE_LOADER_CTX *ctx)
163 OSSL_STORE_LOADER_CTX_free(ctx);