summaryrefslogtreecommitdiff
path: root/authfd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-01-24 11:36:23 +1100
committerDamien Miller <djm@mindrot.org>2003-01-24 11:36:23 +1100
commit6c71179f6839ab49e4e8a91209eef85dc190d5f1 (patch)
tree199fd690f2933dc18a687d5b86be467a2250f2d1 /authfd.c
parent5a93add673a68d9ef67504b17913254498f4deb9 (diff)
- markus@cvs.openbsd.org 2003/01/23 13:50:27
[authfd.c authfd.h readpass.c ssh-add.1 ssh-add.c ssh-agent.c] ssh-add -c, prompt user for confirmation (using ssh-askpass) when private agent key is used; with djm@; test by dugsong@, djm@; ok deraadt@
Diffstat (limited to 'authfd.c')
-rw-r--r--authfd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/authfd.c b/authfd.c
index f04e0858b..a186e0117 100644
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: authfd.c,v 1.57 2002/09/11 18:27:26 stevesk Exp $"); 38RCSID("$OpenBSD: authfd.c,v 1.58 2003/01/23 13:50:27 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -499,10 +499,10 @@ ssh_encode_identity_ssh2(Buffer *b, Key *key, const char *comment)
499 499
500int 500int
501ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key, 501ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key,
502 const char *comment, u_int life) 502 const char *comment, u_int life, u_int confirm)
503{ 503{
504 Buffer msg; 504 Buffer msg;
505 int type, constrained = (life != 0); 505 int type, constrained = (life || confirm);
506 506
507 buffer_init(&msg); 507 buffer_init(&msg);
508 508
@@ -532,6 +532,8 @@ ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key,
532 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME); 532 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME);
533 buffer_put_int(&msg, life); 533 buffer_put_int(&msg, life);
534 } 534 }
535 if (confirm != 0)
536 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_CONFIRM);
535 } 537 }
536 if (ssh_request_reply(auth, &msg, &msg) == 0) { 538 if (ssh_request_reply(auth, &msg, &msg) == 0) {
537 buffer_free(&msg); 539 buffer_free(&msg);
@@ -545,7 +547,7 @@ ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key,
545int 547int
546ssh_add_identity(AuthenticationConnection *auth, Key *key, const char *comment) 548ssh_add_identity(AuthenticationConnection *auth, Key *key, const char *comment)
547{ 549{
548 return ssh_add_identity_constrained(auth, key, comment, 0); 550 return ssh_add_identity_constrained(auth, key, comment, 0, 0);
549} 551}
550 552
551/* 553/*