Lines Matching refs:k11
175 struct pkcs11_key *k11; in pkcs11_rsa_finish() local
178 if ((k11 = RSA_get_app_data(rsa)) != NULL) { in pkcs11_rsa_finish()
179 if (k11->orig_finish) in pkcs11_rsa_finish()
180 rv = k11->orig_finish(rsa); in pkcs11_rsa_finish()
181 if (k11->provider) in pkcs11_rsa_finish()
182 pkcs11_provider_unref(k11->provider); in pkcs11_rsa_finish()
183 if (k11->keyid) in pkcs11_rsa_finish()
184 xfree(k11->keyid); in pkcs11_rsa_finish()
185 xfree(k11); in pkcs11_rsa_finish()
223 struct pkcs11_key *k11; in pkcs11_rsa_private_encrypt() local
247 if ((k11 = RSA_get_app_data(rsa)) == NULL) { in pkcs11_rsa_private_encrypt()
251 if (!k11->provider || !k11->provider->valid) { in pkcs11_rsa_private_encrypt()
255 f = k11->provider->function_list; in pkcs11_rsa_private_encrypt()
256 si = &k11->provider->slotinfo[k11->slotidx]; in pkcs11_rsa_private_encrypt()
276 key_filter[1].pValue = k11->keyid; in pkcs11_rsa_private_encrypt()
277 key_filter[1].ulValueLen = k11->keyid_len; in pkcs11_rsa_private_encrypt()
279 if (pkcs11_find(k11->provider, k11->slotidx, key_filter, 3, &obj) < 0 && in pkcs11_rsa_private_encrypt()
280 pkcs11_find(k11->provider, k11->slotidx, key_filter, 2, &obj) < 0) { in pkcs11_rsa_private_encrypt()
308 struct pkcs11_key *k11; in pkcs11_rsa_wrap() local
311 k11 = xcalloc(1, sizeof(*k11)); in pkcs11_rsa_wrap()
312 k11->provider = provider; in pkcs11_rsa_wrap()
314 k11->slotidx = slotidx; in pkcs11_rsa_wrap()
316 k11->keyid_len = keyid_attrib->ulValueLen; in pkcs11_rsa_wrap()
317 k11->keyid = xmalloc(k11->keyid_len); in pkcs11_rsa_wrap()
318 memcpy(k11->keyid, keyid_attrib->pValue, k11->keyid_len); in pkcs11_rsa_wrap()
319 k11->orig_finish = def->finish; in pkcs11_rsa_wrap()
320 memcpy(&k11->rsa_method, def, sizeof(k11->rsa_method)); in pkcs11_rsa_wrap()
321 k11->rsa_method.name = "pkcs11"; in pkcs11_rsa_wrap()
322 k11->rsa_method.rsa_priv_enc = pkcs11_rsa_private_encrypt; in pkcs11_rsa_wrap()
323 k11->rsa_method.rsa_priv_dec = pkcs11_rsa_private_decrypt; in pkcs11_rsa_wrap()
324 k11->rsa_method.finish = pkcs11_rsa_finish; in pkcs11_rsa_wrap()
325 RSA_set_method(rsa, &k11->rsa_method); in pkcs11_rsa_wrap()
326 RSA_set_app_data(rsa, k11); in pkcs11_rsa_wrap()