diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 03:50:02 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-07-04 03:50:02 +0000 |
commit | 036a6b28c9ef5a237e2fbd7d73ca94af3d24e897 (patch) | |
tree | 3968210d82563cc98a092737e5028319e4833d07 /authfd.c | |
parent | d94580c708175649f4e433451ac096425d3b81e2 (diff) | |
download | openssh-git-036a6b28c9ef5a237e2fbd7d73ca94af3d24e897.tar.gz |
- markus@cvs.openbsd.org 2001/06/26 04:59:59
[authfd.c authfd.h ssh-add.c]
initial support for smartcards in the agent
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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 <openssl/evp.h> @@ -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. |