1 /* $OpenBSD: ssh-pkcs11-client.c,v 1.20 2024/08/15 00:51:51 djm Exp $ */
3 * Copyright (c) 2010 Markus Friedl. All rights reserved.
4 * Copyright (c) 2014 Pedro Martelletto. All rights reserved.
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #include <sys/types.h>
24 #ifdef HAVE_SYS_TIME_H
25 # include <sys/time.h>
27 #include <sys/socket.h>
35 #include <openssl/ecdsa.h>
36 #include <openssl/rsa.h>
38 #include "pathnames.h"
46 #include "ssh-pkcs11.h"
49 #include "openbsd-compat/openssl-compat.h"
51 #if !defined(OPENSSL_HAS_ECC) || !defined(HAVE_EC_KEY_METHOD_NEW)
52 #define EC_KEY_METHOD void
56 /* borrows code from sftp-server and ssh-agent */
59 * Maintain a list of ssh-pkcs11-helper subprocesses. These may be looked up
60 * by provider path or their unique EC/RSA METHOD pointers.
67 EC_KEY_METHOD
*ec_meth
;
68 int (*rsa_finish
)(RSA
*rsa
);
69 void (*ec_finish
)(EC_KEY
*key
);
70 size_t nrsa
, nec
; /* number of active keys of each type */
72 static struct helper
**helpers
;
73 static size_t nhelpers
;
75 static struct helper
*
76 helper_by_provider(const char *path
)
80 for (i
= 0; i
< nhelpers
; i
++) {
81 if (helpers
[i
] == NULL
|| helpers
[i
]->path
== NULL
||
84 if (strcmp(helpers
[i
]->path
, path
) == 0)
90 static struct helper
*
91 helper_by_rsa(const RSA
*rsa
)
94 const RSA_METHOD
*meth
;
96 if ((meth
= RSA_get_method(rsa
)) == NULL
)
98 for (i
= 0; i
< nhelpers
; i
++) {
99 if (helpers
[i
] != NULL
&& helpers
[i
]->rsa_meth
== meth
)
106 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
107 static struct helper
*
108 helper_by_ec(const EC_KEY
*ec
)
111 const EC_KEY_METHOD
*meth
;
113 if ((meth
= EC_KEY_get_method(ec
)) == NULL
)
115 for (i
= 0; i
< nhelpers
; i
++) {
116 if (helpers
[i
] != NULL
&& helpers
[i
]->ec_meth
== meth
)
122 #endif /* defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW) */
125 helper_free(struct helper
*helper
)
132 if (helper
->path
== NULL
|| helper
->ec_meth
== NULL
||
133 helper
->rsa_meth
== NULL
)
134 fatal_f("inconsistent helper");
135 debug3_f("free helper for provider %s", helper
->path
);
136 for (i
= 0; i
< nhelpers
; i
++) {
137 if (helpers
[i
] == helper
) {
139 fatal_f("helper recorded more than once");
143 helpers
[i
- 1] = helpers
[i
];
146 helpers
= xrecallocarray(helpers
, nhelpers
,
147 nhelpers
- 1, sizeof(*helpers
));
151 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
152 EC_KEY_METHOD_free(helper
->ec_meth
);
154 RSA_meth_free(helper
->rsa_meth
);
159 helper_terminate(struct helper
*helper
)
161 if (helper
== NULL
) {
163 } else if (helper
->fd
== -1) {
164 debug3_f("already terminated");
166 debug3_f("terminating helper for %s; "
167 "remaining %zu RSA %zu ECDSA",
168 helper
->path
, helper
->nrsa
, helper
->nec
);
175 * Don't delete the helper entry until there are no remaining keys
176 * that reference it. Otherwise, any signing operation would call
177 * a free'd METHOD pointer and that would be bad.
179 if (helper
->nrsa
== 0 && helper
->nec
== 0)
184 send_msg(int fd
, struct sshbuf
*m
)
187 size_t mlen
= sshbuf_len(m
);
193 if (atomicio(vwrite
, fd
, buf
, 4) != 4 ||
194 atomicio(vwrite
, fd
, sshbuf_mutable_ptr(m
),
195 sshbuf_len(m
)) != sshbuf_len(m
))
196 error("write to helper failed");
197 if ((r
= sshbuf_consume(m
, mlen
)) != 0)
198 fatal_fr(r
, "consume");
202 recv_msg(int fd
, struct sshbuf
*m
)
211 if ((len
= atomicio(read
, fd
, buf
, 4)) != 4) {
212 error("read from helper failed: %u", len
);
213 return (0); /* XXX */
216 if (len
> 256 * 1024)
217 fatal("response too long: %u", len
);
218 /* read len bytes into m */
223 if (atomicio(read
, fd
, buf
, l
) != l
) {
224 error("response from helper failed.");
225 return (0); /* XXX */
227 if ((r
= sshbuf_put(m
, buf
, l
)) != 0)
228 fatal_fr(r
, "sshbuf_put");
231 if ((r
= sshbuf_get_u8(m
, &c
)) != 0)
232 fatal_fr(r
, "parse type");
237 pkcs11_init(int interactive
)
243 pkcs11_terminate(void)
247 debug3_f("terminating %zu helpers", nhelpers
);
248 for (i
= 0; i
< nhelpers
; i
++)
249 helper_terminate(helpers
[i
]);
253 rsa_encrypt(int flen
, const u_char
*from
, u_char
*to
, RSA
*rsa
, int padding
)
255 struct sshkey
*key
= NULL
;
256 struct sshbuf
*msg
= NULL
;
257 u_char
*blob
= NULL
, *signature
= NULL
;
258 size_t blen
, slen
= 0;
260 struct helper
*helper
;
262 if ((helper
= helper_by_rsa(rsa
)) == NULL
|| helper
->fd
== -1)
263 fatal_f("no helper for PKCS11 key");
264 debug3_f("signing with PKCS11 provider %s", helper
->path
);
265 if (padding
!= RSA_PKCS1_PADDING
)
267 if ((key
= sshkey_new(KEY_UNSPEC
)) == NULL
) {
268 error_f("sshkey_new failed");
271 if ((key
->pkey
= EVP_PKEY_new()) == NULL
||
272 EVP_PKEY_set1_RSA(key
->pkey
, rsa
) != 1) {
273 error_f("pkey setup failed");
278 if ((r
= sshkey_to_blob(key
, &blob
, &blen
)) != 0) {
279 error_fr(r
, "encode key");
282 if ((msg
= sshbuf_new()) == NULL
)
283 fatal_f("sshbuf_new failed");
284 if ((r
= sshbuf_put_u8(msg
, SSH2_AGENTC_SIGN_REQUEST
)) != 0 ||
285 (r
= sshbuf_put_string(msg
, blob
, blen
)) != 0 ||
286 (r
= sshbuf_put_string(msg
, from
, flen
)) != 0 ||
287 (r
= sshbuf_put_u32(msg
, 0)) != 0)
288 fatal_fr(r
, "compose");
289 send_msg(helper
->fd
, msg
);
292 if (recv_msg(helper
->fd
, msg
) == SSH2_AGENT_SIGN_RESPONSE
) {
293 if ((r
= sshbuf_get_string(msg
, &signature
, &slen
)) != 0)
294 fatal_fr(r
, "parse");
295 if (slen
<= (size_t)RSA_size(rsa
)) {
296 memcpy(to
, signature
, slen
);
311 struct helper
*helper
;
313 if ((helper
= helper_by_rsa(rsa
)) == NULL
)
314 fatal_f("no helper for PKCS11 key");
315 debug3_f("free PKCS11 RSA key for provider %s", helper
->path
);
316 if (helper
->rsa_finish
!= NULL
)
317 helper
->rsa_finish(rsa
);
318 if (helper
->nrsa
== 0)
319 fatal_f("RSA refcount error");
321 debug3_f("provider %s remaining keys: %zu RSA %zu ECDSA",
322 helper
->path
, helper
->nrsa
, helper
->nec
);
323 if (helper
->nrsa
== 0 && helper
->nec
== 0)
324 helper_terminate(helper
);
328 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
330 ecdsa_do_sign(const unsigned char *dgst
, int dgst_len
, const BIGNUM
*inv
,
331 const BIGNUM
*rp
, EC_KEY
*ec
)
333 struct sshkey
*key
= NULL
;
334 struct sshbuf
*msg
= NULL
;
335 ECDSA_SIG
*ret
= NULL
;
337 u_char
*blob
= NULL
, *signature
= NULL
;
338 size_t blen
, slen
= 0;
340 struct helper
*helper
;
342 if ((helper
= helper_by_ec(ec
)) == NULL
|| helper
->fd
== -1)
343 fatal_f("no helper for PKCS11 key");
344 debug3_f("signing with PKCS11 provider %s", helper
->path
);
346 if ((key
= sshkey_new(KEY_UNSPEC
)) == NULL
) {
347 error_f("sshkey_new failed");
350 if ((key
->pkey
= EVP_PKEY_new()) == NULL
||
351 EVP_PKEY_set1_EC_KEY(key
->pkey
, ec
) != 1) {
352 error("pkey setup failed");
355 if ((nid
= sshkey_ecdsa_pkey_to_nid(key
->pkey
)) < 0) {
356 error("couldn't get curve nid");
359 key
->ecdsa_nid
= nid
;
360 key
->type
= KEY_ECDSA
;
362 if ((r
= sshkey_to_blob(key
, &blob
, &blen
)) != 0) {
363 error_fr(r
, "encode key");
366 if ((msg
= sshbuf_new()) == NULL
)
367 fatal_f("sshbuf_new failed");
368 if ((r
= sshbuf_put_u8(msg
, SSH2_AGENTC_SIGN_REQUEST
)) != 0 ||
369 (r
= sshbuf_put_string(msg
, blob
, blen
)) != 0 ||
370 (r
= sshbuf_put_string(msg
, dgst
, dgst_len
)) != 0 ||
371 (r
= sshbuf_put_u32(msg
, 0)) != 0)
372 fatal_fr(r
, "compose");
373 send_msg(helper
->fd
, msg
);
376 if (recv_msg(helper
->fd
, msg
) == SSH2_AGENT_SIGN_RESPONSE
) {
377 if ((r
= sshbuf_get_string(msg
, &signature
, &slen
)) != 0)
378 fatal_fr(r
, "parse");
380 ret
= d2i_ECDSA_SIG(NULL
, &cp
, slen
);
392 ecdsa_do_finish(EC_KEY
*ec
)
394 struct helper
*helper
;
396 if ((helper
= helper_by_ec(ec
)) == NULL
)
397 fatal_f("no helper for PKCS11 key");
398 debug3_f("free PKCS11 ECDSA key for provider %s", helper
->path
);
399 if (helper
->ec_finish
!= NULL
)
400 helper
->ec_finish(ec
);
401 if (helper
->nec
== 0)
402 fatal_f("ECDSA refcount error");
404 debug3_f("provider %s remaining keys: %zu RSA %zu ECDSA",
405 helper
->path
, helper
->nrsa
, helper
->nec
);
406 if (helper
->nrsa
== 0 && helper
->nec
== 0)
407 helper_terminate(helper
);
409 #endif /* defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW) */
411 /* redirect private key crypto operations to the ssh-pkcs11-helper */
413 wrap_key(struct helper
*helper
, struct sshkey
*k
)
416 EC_KEY
*ecdsa
= NULL
;
418 debug3_f("wrap %s for provider %s", sshkey_type(k
), helper
->path
);
419 if (k
->type
== KEY_RSA
) {
420 if ((rsa
= EVP_PKEY_get1_RSA(k
->pkey
)) == NULL
)
421 fatal_f("no RSA key");
422 if (RSA_set_method(rsa
, helper
->rsa_meth
) != 1)
423 fatal_f("RSA_set_method failed");
424 if (helper
->nrsa
++ >= INT_MAX
)
425 fatal_f("RSA refcount error");
426 if (EVP_PKEY_set1_RSA(k
->pkey
, rsa
) != 1)
427 fatal_f("EVP_PKEY_set1_RSA failed");
429 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
430 } else if (k
->type
== KEY_ECDSA
) {
431 if ((ecdsa
= EVP_PKEY_get1_EC_KEY(k
->pkey
)) == NULL
)
432 fatal_f("no ECDSA key");
433 if (EC_KEY_set_method(ecdsa
, helper
->ec_meth
) != 1)
434 fatal_f("EC_KEY_set_method failed");
435 if (helper
->nec
++ >= INT_MAX
)
436 fatal_f("EC refcount error");
437 if (EVP_PKEY_set1_EC_KEY(k
->pkey
, ecdsa
) != 1)
438 fatal_f("EVP_PKEY_set1_EC_KEY failed");
442 fatal_f("unknown key type");
443 k
->flags
|= SSHKEY_FLAG_EXT
;
444 debug3_f("provider %s remaining keys: %zu RSA %zu ECDSA",
445 helper
->path
, helper
->nrsa
, helper
->nec
);
449 * Make a private PKCS#11-backed certificate by grafting a previously-loaded
450 * PKCS#11 private key and a public certificate key.
453 pkcs11_make_cert(const struct sshkey
*priv
,
454 const struct sshkey
*certpub
, struct sshkey
**certprivp
)
456 struct helper
*helper
= NULL
;
459 RSA
*rsa_priv
= NULL
, *rsa_cert
= NULL
;
460 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
461 EC_KEY
*ec_priv
= NULL
, *ec_cert
= NULL
;
464 debug3_f("private key type %s cert type %s", sshkey_type(priv
),
465 sshkey_type(certpub
));
467 if (!sshkey_is_cert(certpub
) || sshkey_is_cert(priv
) ||
468 !sshkey_equal_public(priv
, certpub
)) {
469 error_f("private key %s doesn't match cert %s",
470 sshkey_type(priv
), sshkey_type(certpub
));
471 return SSH_ERR_INVALID_ARGUMENT
;
474 if (priv
->type
== KEY_RSA
) {
475 if ((rsa_priv
= EVP_PKEY_get1_RSA(priv
->pkey
)) == NULL
)
476 fatal_f("no RSA pkey");
477 if ((helper
= helper_by_rsa(rsa_priv
)) == NULL
||
479 fatal_f("no helper for PKCS11 RSA key");
480 if ((r
= sshkey_from_private(priv
, &ret
)) != 0)
481 fatal_fr(r
, "copy key");
482 if ((rsa_cert
= EVP_PKEY_get1_RSA(ret
->pkey
)) == NULL
)
483 fatal_f("no RSA cert pkey");
484 if (RSA_set_method(rsa_cert
, helper
->rsa_meth
) != 1)
485 fatal_f("RSA_set_method failed");
486 if (helper
->nrsa
++ >= INT_MAX
)
487 fatal_f("RSA refcount error");
488 if (EVP_PKEY_set1_RSA(ret
->pkey
, rsa_cert
) != 1)
489 fatal_f("EVP_PKEY_set1_RSA failed");
492 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
493 } else if (priv
->type
== KEY_ECDSA
) {
494 if ((ec_priv
= EVP_PKEY_get1_EC_KEY(priv
->pkey
)) == NULL
)
495 fatal_f("no EC pkey");
496 if ((helper
= helper_by_ec(ec_priv
)) == NULL
||
498 fatal_f("no helper for PKCS11 EC key");
499 if ((r
= sshkey_from_private(priv
, &ret
)) != 0)
500 fatal_fr(r
, "copy key");
501 if ((ec_cert
= EVP_PKEY_get1_EC_KEY(ret
->pkey
)) == NULL
)
502 fatal_f("no EC cert pkey");
503 if (EC_KEY_set_method(ec_cert
, helper
->ec_meth
) != 1)
504 fatal_f("EC_KEY_set_method failed");
505 if (helper
->nec
++ >= INT_MAX
)
506 fatal_f("EC refcount error");
507 if (EVP_PKEY_set1_EC_KEY(ret
->pkey
, ec_cert
) != 1)
508 fatal_f("EVP_PKEY_set1_EC_KEY failed");
509 EC_KEY_free(ec_priv
);
510 EC_KEY_free(ec_cert
);
513 fatal_f("unknown key type %s", sshkey_type(priv
));
515 ret
->flags
|= SSHKEY_FLAG_EXT
;
516 if ((r
= sshkey_to_certified(ret
)) != 0 ||
517 (r
= sshkey_cert_copy(certpub
, ret
)) != 0)
518 fatal_fr(r
, "graft certificate");
519 debug3_f("provider %s remaining keys: %zu RSA %zu ECDSA",
520 helper
->path
, helper
->nrsa
, helper
->nec
);
527 pkcs11_start_helper_methods(struct helper
*helper
)
529 RSA_METHOD
*rsa_meth
= NULL
;
530 EC_KEY_METHOD
*ec_meth
= NULL
;
531 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
532 int (*ec_init
)(EC_KEY
*key
);
533 int (*ec_copy
)(EC_KEY
*dest
, const EC_KEY
*src
);
534 int (*ec_set_group
)(EC_KEY
*key
, const EC_GROUP
*grp
);
535 int (*ec_set_private
)(EC_KEY
*key
, const BIGNUM
*priv_key
);
536 int (*ec_set_public
)(EC_KEY
*key
, const EC_POINT
*pub_key
);
537 int (*ec_sign
)(int, const unsigned char *, int, unsigned char *,
538 unsigned int *, const BIGNUM
*, const BIGNUM
*, EC_KEY
*) = NULL
;
540 if ((ec_meth
= EC_KEY_METHOD_new(EC_KEY_OpenSSL())) == NULL
)
542 EC_KEY_METHOD_get_sign(ec_meth
, &ec_sign
, NULL
, NULL
);
543 EC_KEY_METHOD_set_sign(ec_meth
, ec_sign
, NULL
, ecdsa_do_sign
);
544 EC_KEY_METHOD_get_init(ec_meth
, &ec_init
, &helper
->ec_finish
,
545 &ec_copy
, &ec_set_group
, &ec_set_private
, &ec_set_public
);
546 EC_KEY_METHOD_set_init(ec_meth
, ec_init
, ecdsa_do_finish
,
547 ec_copy
, ec_set_group
, ec_set_private
, ec_set_public
);
548 #endif /* defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW) */
550 if ((rsa_meth
= RSA_meth_dup(RSA_get_default_method())) == NULL
)
551 fatal_f("RSA_meth_dup failed");
552 helper
->rsa_finish
= RSA_meth_get_finish(rsa_meth
);
553 if (!RSA_meth_set1_name(rsa_meth
, "ssh-pkcs11-helper") ||
554 !RSA_meth_set_priv_enc(rsa_meth
, rsa_encrypt
) ||
555 !RSA_meth_set_finish(rsa_meth
, rsa_finish
))
556 fatal_f("failed to prepare method");
558 helper
->ec_meth
= ec_meth
;
559 helper
->rsa_meth
= rsa_meth
;
563 static struct helper
*
564 pkcs11_start_helper(const char *path
)
567 char *prog
, *verbosity
= NULL
;
568 struct helper
*helper
;
571 if (nhelpers
>= INT_MAX
)
572 fatal_f("too many helpers");
573 debug3_f("start helper for %s", path
);
574 if (socketpair(AF_UNIX
, SOCK_STREAM
, 0, pair
) == -1) {
575 error_f("socketpair: %s", strerror(errno
));
578 helper
= xcalloc(1, sizeof(*helper
));
579 if (pkcs11_start_helper_methods(helper
) == -1) {
580 error_f("pkcs11_start_helper_methods failed");
583 if ((pid
= fork()) == -1) {
584 error_f("fork: %s", strerror(errno
));
588 RSA_meth_free(helper
->rsa_meth
);
589 #if defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW)
590 EC_KEY_METHOD_free(helper
->ec_meth
);
594 } else if (pid
== 0) {
595 if ((dup2(pair
[1], STDIN_FILENO
) == -1) ||
596 (dup2(pair
[1], STDOUT_FILENO
) == -1)) {
597 fprintf(stderr
, "dup2: %s\n", strerror(errno
));
602 prog
= getenv("SSH_PKCS11_HELPER");
603 if (prog
== NULL
|| strlen(prog
) == 0)
604 prog
= _PATH_SSH_PKCS11_HELPER
;
605 if (log_level_get() >= SYSLOG_LEVEL_DEBUG1
)
607 debug_f("starting %s %s", prog
,
608 verbosity
== NULL
? "" : verbosity
);
609 execlp(prog
, prog
, verbosity
, (char *)NULL
);
610 fprintf(stderr
, "exec: %s: %s\n", prog
, strerror(errno
));
614 helper
->fd
= pair
[0];
615 helper
->path
= xstrdup(path
);
617 debug3_f("helper %zu for \"%s\" on fd %d pid %ld", nhelpers
,
618 helper
->path
, helper
->fd
, (long)helper
->pid
);
619 helpers
= xrecallocarray(helpers
, nhelpers
,
620 nhelpers
+ 1, sizeof(*helpers
));
621 helpers
[nhelpers
++] = helper
;
626 pkcs11_add_provider(char *name
, char *pin
, struct sshkey
***keysp
,
636 struct helper
*helper
;
638 if ((helper
= helper_by_provider(name
)) == NULL
&&
639 (helper
= pkcs11_start_helper(name
)) == NULL
)
642 if ((msg
= sshbuf_new()) == NULL
)
643 fatal_f("sshbuf_new failed");
644 if ((r
= sshbuf_put_u8(msg
, SSH_AGENTC_ADD_SMARTCARD_KEY
)) != 0 ||
645 (r
= sshbuf_put_cstring(msg
, name
)) != 0 ||
646 (r
= sshbuf_put_cstring(msg
, pin
)) != 0)
647 fatal_fr(r
, "compose");
648 send_msg(helper
->fd
, msg
);
651 type
= recv_msg(helper
->fd
, msg
);
652 if (type
== SSH2_AGENT_IDENTITIES_ANSWER
) {
653 if ((r
= sshbuf_get_u32(msg
, &nkeys
)) != 0)
654 fatal_fr(r
, "parse nkeys");
655 *keysp
= xcalloc(nkeys
, sizeof(struct sshkey
*));
657 *labelsp
= xcalloc(nkeys
, sizeof(char *));
658 for (i
= 0; i
< nkeys
; i
++) {
659 /* XXX clean up properly instead of fatal() */
660 if ((r
= sshbuf_get_string(msg
, &blob
, &blen
)) != 0 ||
661 (r
= sshbuf_get_cstring(msg
, &label
, NULL
)) != 0)
662 fatal_fr(r
, "parse key");
663 if ((r
= sshkey_from_blob(blob
, blen
, &k
)) != 0)
664 fatal_fr(r
, "decode key");
668 (*labelsp
)[i
] = label
;
673 } else if (type
== SSH2_AGENT_FAILURE
) {
674 if ((r
= sshbuf_get_u32(msg
, &nkeys
)) != 0)
684 pkcs11_del_provider(char *name
)
686 struct helper
*helper
;
689 * ssh-agent deletes keys before calling this, so the helper entry
690 * should be gone before we get here.
692 debug3_f("delete %s", name
);
693 if ((helper
= helper_by_provider(name
)) != NULL
)
694 helper_terminate(helper
);
697 #endif /* ENABLE_PKCS11 */