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