diff options
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: authfd.c,v 1.83 2010/04/16 01:47:26 djm Exp $ */ | 1 | /* $OpenBSD: authfd.c,v 1.84 2010/08/31 11:54:45 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 |
@@ -509,6 +509,19 @@ ssh_encode_identity_ssh2(Buffer *b, Key *key, const char *comment) | |||
509 | buffer_len(&key->cert->certblob)); | 509 | buffer_len(&key->cert->certblob)); |
510 | buffer_put_bignum2(b, key->dsa->priv_key); | 510 | buffer_put_bignum2(b, key->dsa->priv_key); |
511 | break; | 511 | break; |
512 | case KEY_ECDSA: | ||
513 | buffer_put_cstring(b, key_curve_nid_to_name(key->ecdsa_nid)); | ||
514 | buffer_put_ecpoint(b, EC_KEY_get0_group(key->ecdsa), | ||
515 | EC_KEY_get0_public_key(key->ecdsa)); | ||
516 | buffer_put_bignum2(b, EC_KEY_get0_private_key(key->ecdsa)); | ||
517 | break; | ||
518 | case KEY_ECDSA_CERT: | ||
519 | if (key->cert == NULL || buffer_len(&key->cert->certblob) == 0) | ||
520 | fatal("%s: no cert/certblob", __func__); | ||
521 | buffer_put_string(b, buffer_ptr(&key->cert->certblob), | ||
522 | buffer_len(&key->cert->certblob)); | ||
523 | buffer_put_bignum2(b, EC_KEY_get0_private_key(key->ecdsa)); | ||
524 | break; | ||
512 | } | 525 | } |
513 | buffer_put_cstring(b, comment); | 526 | buffer_put_cstring(b, comment); |
514 | } | 527 | } |
@@ -541,6 +554,8 @@ ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key, | |||
541 | case KEY_DSA: | 554 | case KEY_DSA: |
542 | case KEY_DSA_CERT: | 555 | case KEY_DSA_CERT: |
543 | case KEY_DSA_CERT_V00: | 556 | case KEY_DSA_CERT_V00: |
557 | case KEY_ECDSA: | ||
558 | case KEY_ECDSA_CERT: | ||
544 | type = constrained ? | 559 | type = constrained ? |
545 | SSH2_AGENTC_ADD_ID_CONSTRAINED : | 560 | SSH2_AGENTC_ADD_ID_CONSTRAINED : |
546 | SSH2_AGENTC_ADD_IDENTITY; | 561 | SSH2_AGENTC_ADD_IDENTITY; |
@@ -589,7 +604,8 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key) | |||
589 | buffer_put_bignum(&msg, key->rsa->e); | 604 | buffer_put_bignum(&msg, key->rsa->e); |
590 | buffer_put_bignum(&msg, key->rsa->n); | 605 | buffer_put_bignum(&msg, key->rsa->n); |
591 | } else if (key_type_plain(key->type) == KEY_DSA || | 606 | } else if (key_type_plain(key->type) == KEY_DSA || |
592 | key_type_plain(key->type) == KEY_RSA) { | 607 | key_type_plain(key->type) == KEY_RSA || |
608 | key_type_plain(key->type) == KEY_ECDSA) { | ||
593 | key_to_blob(key, &blob, &blen); | 609 | key_to_blob(key, &blob, &blen); |
594 | buffer_put_char(&msg, SSH2_AGENTC_REMOVE_IDENTITY); | 610 | buffer_put_char(&msg, SSH2_AGENTC_REMOVE_IDENTITY); |
595 | buffer_put_string(&msg, blob, blen); | 611 | buffer_put_string(&msg, blob, blen); |