summaryrefslogtreecommitdiff
path: root/authfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfd.c')
-rw-r--r--authfd.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/authfd.c b/authfd.c
index c9c22d46d..0f84e321c 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.50 2002/06/05 19:57:12 markus Exp $"); 38RCSID("$OpenBSD: authfd.c,v 1.51 2002/06/05 21:55:44 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -552,6 +552,41 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key)
552} 552}
553 553
554int 554int
555ssh_lifetime_identity(AuthenticationConnection *auth, Key *key, u_int life)
556{
557 Buffer msg;
558 int type;
559 u_char *blob;
560 u_int blen;
561
562 buffer_init(&msg);
563
564 if (key->type == KEY_RSA1) {
565 buffer_put_char(&msg, SSH_AGENTC_LIFETIME_IDENTITY1);
566 buffer_put_int(&msg, life);
567 buffer_put_int(&msg, BN_num_bits(key->rsa->n));
568 buffer_put_bignum(&msg, key->rsa->e);
569 buffer_put_bignum(&msg, key->rsa->n);
570 } else if (key->type == KEY_DSA || key->type == KEY_RSA) {
571 key_to_blob(key, &blob, &blen);
572 buffer_put_char(&msg, SSH_AGENTC_LIFETIME_IDENTITY);
573 buffer_put_int(&msg, life);
574 buffer_put_string(&msg, blob, blen);
575 xfree(blob);
576 } else {
577 buffer_free(&msg);
578 return 0;
579 }
580 if (ssh_request_reply(auth, &msg, &msg) == 0) {
581 buffer_free(&msg);
582 return 0;
583 }
584 type = buffer_get_char(&msg);
585 buffer_free(&msg);
586 return decode_reply(type);
587}
588
589int
555ssh_update_card(AuthenticationConnection *auth, int add, const char *reader_id, const char *pin) 590ssh_update_card(AuthenticationConnection *auth, int add, const char *reader_id, const char *pin)
556{ 591{
557 Buffer msg; 592 Buffer msg;