diff options
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: authfd.c,v 1.49 2002/03/21 22:44:05 rees Exp $"); | 38 | RCSID("$OpenBSD: authfd.c,v 1.50 2002/06/05 19:57:12 markus Exp $"); |
39 | 39 | ||
40 | #include <openssl/evp.h> | 40 | #include <openssl/evp.h> |
41 | 41 | ||
@@ -207,6 +207,26 @@ ssh_close_authentication_connection(AuthenticationConnection *auth) | |||
207 | xfree(auth); | 207 | xfree(auth); |
208 | } | 208 | } |
209 | 209 | ||
210 | /* Lock/unlock agent */ | ||
211 | int | ||
212 | ssh_lock_agent(AuthenticationConnection *auth, int lock, const char *password) | ||
213 | { | ||
214 | int type; | ||
215 | Buffer msg; | ||
216 | |||
217 | buffer_init(&msg); | ||
218 | buffer_put_char(&msg, lock ? SSH_AGENTC_LOCK : SSH_AGENTC_UNLOCK); | ||
219 | buffer_put_cstring(&msg, password); | ||
220 | |||
221 | if (ssh_request_reply(auth, &msg, &msg) == 0) { | ||
222 | buffer_free(&msg); | ||
223 | return 0; | ||
224 | } | ||
225 | type = buffer_get_char(&msg); | ||
226 | buffer_free(&msg); | ||
227 | return decode_reply(type); | ||
228 | } | ||
229 | |||
210 | /* | 230 | /* |
211 | * Returns the first authentication identity held by the agent. | 231 | * Returns the first authentication identity held by the agent. |
212 | */ | 232 | */ |