From 036a6b28c9ef5a237e2fbd7d73ca94af3d24e897 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Wed, 4 Jul 2001 03:50:02 +0000 Subject: - markus@cvs.openbsd.org 2001/06/26 04:59:59 [authfd.c authfd.h ssh-add.c] initial support for smartcards in the agent --- authfd.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'authfd.c') diff --git a/authfd.c b/authfd.c index dfa33a978..b3c0d9d87 100644 --- a/authfd.c +++ b/authfd.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.41 2001/06/23 15:12:17 itojun Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.42 2001/06/26 04:59:59 markus Exp $"); #include @@ -534,6 +534,25 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key) return decode_reply(type); } +int +ssh_update_card(AuthenticationConnection *auth, int add, int reader_id) +{ + Buffer msg; + int type; + + buffer_init(&msg); + buffer_put_char(&msg, add ? SSH_AGENTC_ADD_SMARTCARD_KEY : + SSH_AGENTC_REMOVE_SMARTCARD_KEY); + buffer_put_int(&msg, reader_id); + if (ssh_request_reply(auth, &msg, &msg) == 0) { + buffer_free(&msg); + return 0; + } + type = buffer_get_char(&msg); + buffer_free(&msg); + return decode_reply(type); +} + /* * Removes all identities from the agent. This call is not meant to be used * by normal applications. -- cgit v1.2.3