Lines Matching defs:pk11_ctx
73 pk11_context_t *pk11_ctx;
86 pk11_ctx = (pk11_context_t *) isc_mem_get(dctx->mctx,
87 sizeof(*pk11_ctx));
88 if (pk11_ctx == NULL)
90 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
95 ret = pk11_get_session(pk11_ctx, OP_EC, ISC_TRUE, ISC_FALSE,
100 PK11_RET(pkcs_C_DigestInit, (pk11_ctx->session, &mech), ISC_R_FAILURE);
101 dctx->ctxdata.pk11_ctx = pk11_ctx;
105 pk11_return_session(pk11_ctx);
106 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
107 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
116 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
121 if (pk11_ctx != NULL) {
122 (void) pkcs_C_DigestFinal(pk11_ctx->session, garbage, &len);
124 pk11_return_session(pk11_ctx);
125 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
126 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
127 dctx->ctxdata.pk11_ctx = NULL;
134 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
141 (pk11_ctx->session,
170 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
190 (pk11_ctx->session, digest, &dgstlen),
198 pk11_ctx->ontoken = ec->ontoken;
199 pk11_ctx->object = ec->object;
228 pk11_ctx->object = CK_INVALID_HANDLE;
229 pk11_ctx->ontoken = ISC_FALSE;
231 (pk11_ctx->session,
239 (pk11_ctx->session, &mech,
240 pk11_ctx->ontoken ? pk11_ctx->object : hKey),
244 (pk11_ctx->session,
254 (void) pkcs_C_DestroyObject(pk11_ctx->session, hKey);
263 pk11_return_session(pk11_ctx);
264 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
265 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
266 dctx->ctxdata.pk11_ctx = NULL;
291 pk11_context_t *pk11_ctx = dctx->ctxdata.pk11_ctx;
307 (pk11_ctx->session, digest, &dgstlen),
335 pk11_ctx->object = CK_INVALID_HANDLE;
336 pk11_ctx->ontoken = ISC_FALSE;
338 (pk11_ctx->session,
344 (pk11_ctx->session, &mech, hKey),
348 (pk11_ctx->session,
356 (void) pkcs_C_DestroyObject(pk11_ctx->session, hKey);
365 pk11_return_session(pk11_ctx);
366 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
367 isc_mem_put(dctx->mctx, pk11_ctx, sizeof(*pk11_ctx));
368 dctx->ctxdata.pk11_ctx = NULL;
480 pk11_context_t *pk11_ctx;
488 pk11_ctx = (pk11_context_t *) isc_mem_get(key->mctx,
489 sizeof(*pk11_ctx));
490 if (pk11_ctx == NULL)
492 ret = pk11_get_session(pk11_ctx, OP_EC, ISC_TRUE, ISC_FALSE,
517 (pk11_ctx->session, &mech,
531 (pk11_ctx->session, pub, attr, 1),
538 (pk11_ctx->session, pub, attr, 1),
543 (pk11_ctx->session, priv, attr, 1),
550 (pk11_ctx->session, priv, attr, 1),
553 (void) pkcs_C_DestroyObject(pk11_ctx->session, priv);
554 (void) pkcs_C_DestroyObject(pk11_ctx->session, pub);
555 pk11_return_session(pk11_ctx);
556 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
557 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));
569 (void) pkcs_C_DestroyObject(pk11_ctx->session, priv);
571 (void) pkcs_C_DestroyObject(pk11_ctx->session, pub);
572 pk11_return_session(pk11_ctx);
573 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
574 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));
815 pk11_context_t *pk11_ctx = NULL;
855 pk11_ctx = (pk11_context_t *) isc_mem_get(key->mctx,
856 sizeof(*pk11_ctx));
857 if (pk11_ctx == NULL)
859 ret = pk11_get_session(pk11_ctx, OP_EC, ISC_TRUE, ISC_FALSE,
874 (pk11_ctx->session, searchTemplate, (CK_ULONG) 4),
877 (pk11_ctx->session, &ec->object, (CK_ULONG) 1, &cnt),
879 (void) pkcs_C_FindObjectsFinal(pk11_ctx->session);
895 pk11_return_session(pk11_ctx);
896 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
897 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));
901 if (pk11_ctx != NULL) {
902 pk11_return_session(pk11_ctx);
903 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
904 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));
1040 pk11_context_t *pk11_ctx = NULL;
1068 pk11_ctx = (pk11_context_t *) isc_mem_get(key->mctx,
1069 sizeof(*pk11_ctx));
1070 if (pk11_ctx == NULL)
1072 ret = pk11_get_session(pk11_ctx, OP_EC, ISC_TRUE, ISC_FALSE,
1087 (pk11_ctx->session, searchTemplate, (CK_ULONG) 4),
1090 (pk11_ctx->session, &hKey, (CK_ULONG) 1, &cnt),
1092 (void) pkcs_C_FindObjectsFinal(pk11_ctx->session);
1100 (pk11_ctx->session, hKey, attr, 2),
1109 (pk11_ctx->session, hKey, attr, 2),
1114 (pk11_ctx->session, searchTemplate, (CK_ULONG) 4),
1117 (pk11_ctx->session, &ec->object, (CK_ULONG) 1, &cnt),
1119 (void) pkcs_C_FindObjectsFinal(pk11_ctx->session);
1139 pk11_return_session(pk11_ctx);
1140 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
1141 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));
1146 if (pk11_ctx != NULL) {
1147 pk11_return_session(pk11_ctx);
1148 memset(pk11_ctx, 0, sizeof(*pk11_ctx));
1149 isc_mem_put(key->mctx, pk11_ctx, sizeof(*pk11_ctx));