Lines Matching defs:pk11_ctx
94 pk11_context_t *pk11_ctx;
102 pk11_ctx = (pk11_context_t *) isc_mem_get(dctx->mctx,
103 sizeof(*pk11_ctx));
104 if (pk11_ctx == NULL)
106 ret = pk11_get_session(pk11_ctx, OP_DSA, ISC_TRUE, ISC_FALSE,
113 pk11_ctx->ontoken = dsa->ontoken;
114 pk11_ctx->object = dsa->object;
163 pk11_ctx->object = CK_INVALID_HANDLE;
164 pk11_ctx->ontoken = ISC_FALSE;
166 (pk11_ctx->session,
168 &pk11_ctx->object),
174 (pk11_ctx->session, &mech, pk11_ctx->object),
177 dctx->ctxdata.pk11_ctx = pk11_ctx;
191 if (!pk11_ctx->ontoken && (pk11_ctx->object != CK_INVALID_HANDLE))
192 (void) pkcs_C_DestroyObject(pk11_ctx->session, pk11_ctx->object);
201 pk11_return_session(pk11_ctx);
202 isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
203 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
228 pk11_context_t *pk11_ctx;
234 pk11_ctx = (pk11_context_t *) isc_mem_get(dctx->mctx,
235 sizeof(*pk11_ctx));
236 if (pk11_ctx == NULL)
238 ret = pk11_get_session(pk11_ctx, OP_DSA, ISC_TRUE, ISC_FALSE,
245 pk11_ctx->ontoken = dsa->ontoken;
246 pk11_ctx->object = dsa->object;
295 pk11_ctx->object = CK_INVALID_HANDLE;
296 pk11_ctx->ontoken = ISC_FALSE;
298 (pk11_ctx->session,
300 &pk11_ctx->object),
306 (pk11_ctx->session, &mech, pk11_ctx->object),
309 dctx->ctxdata.pk11_ctx = pk11_ctx;
323 if (!pk11_ctx->ontoken && (pk11_ctx->object != CK_INVALID_HANDLE))
324 (void) pkcs_C_DestroyObject(pk11_ctx->session, pk11_ctx->object);
333 pk11_return_session(pk11_ctx);
334 isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
335 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
350 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
352 if (pk11_ctx != NULL) {
353 if (!pk11_ctx->ontoken &&
354 (pk11_ctx->object != CK_INVALID_HANDLE))
355 (void) pkcs_C_DestroyObject(pk11_ctx->session,
356 pk11_ctx->object);
357 pk11_return_session(pk11_ctx);
358 isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
359 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
360 dctx->ctxdata.pk11_ctx = NULL;
367 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
372 (pk11_ctx->session,
378 (pk11_ctx->session,
390 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
399 (pk11_ctx->session, (CK_BYTE_PTR) r.base + 1, &siglen),
417 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
421 (pk11_ctx->session,
542 pk11_context_t *pk11_ctx;
549 pk11_ctx = (pk11_context_t *) isc_mem_get(key->mctx,
550 sizeof(*pk11_ctx));
551 if (pk11_ctx == NULL)
553 ret = pk11_get_session(pk11_ctx, OP_DSA, ISC_TRUE, ISC_FALSE,
560 (pk11_ctx->session, &mech, dpTemplate, (CK_ULONG) 5, &dp),
582 (pk11_ctx->session, dp, attr, 3),
592 (pk11_ctx->session, dp, attr, 3),
603 (pk11_ctx->session, &mech,
612 (pk11_ctx->session, pub, attr, 1),
619 (pk11_ctx->session, pub, attr, 1),
625 (pk11_ctx->session, priv, attr, 1),
632 (pk11_ctx->session, priv, attr, 1),
636 (void) pkcs_C_DestroyObject(pk11_ctx->session, priv);
637 (void) pkcs_C_DestroyObject(pk11_ctx->session, pub);
638 (void) pkcs_C_DestroyObject(pk11_ctx->session, dp);
639 pk11_return_session(pk11_ctx);
640 isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
641 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));
648 (void) pkcs_C_DestroyObject(pk11_ctx->session, priv);
650 (void) pkcs_C_DestroyObject(pk11_ctx->session, pub);
652 (void) pkcs_C_DestroyObject(pk11_ctx->session, dp);
653 pk11_return_session(pk11_ctx);
654 isc_safe_memwipe(pk11_ctx, sizeof(*pk11_ctx));
655 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));