diff options
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index 46a744f4e..b5c565271 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.164 2010/02/09 00:50:36 djm Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.165 2010/02/26 20:29:54 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -468,6 +468,8 @@ process_add_identity(SocketEntry *e, int version) | |||
468 | int type, success = 0, death = 0, confirm = 0; | 468 | int type, success = 0, death = 0, confirm = 0; |
469 | char *type_name, *comment; | 469 | char *type_name, *comment; |
470 | Key *k = NULL; | 470 | Key *k = NULL; |
471 | u_char *cert; | ||
472 | u_int len; | ||
471 | 473 | ||
472 | switch (version) { | 474 | switch (version) { |
473 | case 1: | 475 | case 1: |
@@ -498,6 +500,14 @@ process_add_identity(SocketEntry *e, int version) | |||
498 | buffer_get_bignum2(&e->request, k->dsa->pub_key); | 500 | buffer_get_bignum2(&e->request, k->dsa->pub_key); |
499 | buffer_get_bignum2(&e->request, k->dsa->priv_key); | 501 | buffer_get_bignum2(&e->request, k->dsa->priv_key); |
500 | break; | 502 | break; |
503 | case KEY_DSA_CERT: | ||
504 | cert = buffer_get_string(&e->request, &len); | ||
505 | if ((k = key_from_blob(cert, len)) == NULL) | ||
506 | fatal("Certificate parse failed"); | ||
507 | xfree(cert); | ||
508 | key_add_private(k); | ||
509 | buffer_get_bignum2(&e->request, k->dsa->priv_key); | ||
510 | break; | ||
501 | case KEY_RSA: | 511 | case KEY_RSA: |
502 | k = key_new_private(type); | 512 | k = key_new_private(type); |
503 | buffer_get_bignum2(&e->request, k->rsa->n); | 513 | buffer_get_bignum2(&e->request, k->rsa->n); |
@@ -510,6 +520,17 @@ process_add_identity(SocketEntry *e, int version) | |||
510 | /* Generate additional parameters */ | 520 | /* Generate additional parameters */ |
511 | rsa_generate_additional_parameters(k->rsa); | 521 | rsa_generate_additional_parameters(k->rsa); |
512 | break; | 522 | break; |
523 | case KEY_RSA_CERT: | ||
524 | cert = buffer_get_string(&e->request, &len); | ||
525 | if ((k = key_from_blob(cert, len)) == NULL) | ||
526 | fatal("Certificate parse failed"); | ||
527 | xfree(cert); | ||
528 | key_add_private(k); | ||
529 | buffer_get_bignum2(&e->request, k->rsa->d); | ||
530 | buffer_get_bignum2(&e->request, k->rsa->iqmp); | ||
531 | buffer_get_bignum2(&e->request, k->rsa->p); | ||
532 | buffer_get_bignum2(&e->request, k->rsa->q); | ||
533 | break; | ||
513 | default: | 534 | default: |
514 | buffer_clear(&e->request); | 535 | buffer_clear(&e->request); |
515 | goto send; | 536 | goto send; |
@@ -519,6 +540,7 @@ process_add_identity(SocketEntry *e, int version) | |||
519 | /* enable blinding */ | 540 | /* enable blinding */ |
520 | switch (k->type) { | 541 | switch (k->type) { |
521 | case KEY_RSA: | 542 | case KEY_RSA: |
543 | case KEY_RSA_CERT: | ||
522 | case KEY_RSA1: | 544 | case KEY_RSA1: |
523 | if (RSA_blinding_on(k->rsa, NULL) != 1) { | 545 | if (RSA_blinding_on(k->rsa, NULL) != 1) { |
524 | error("process_add_identity: RSA_blinding_on failed"); | 546 | error("process_add_identity: RSA_blinding_on failed"); |