diff options
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 22 |
1 files changed, 20 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,21 @@ 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 | #ifdef OPENSSL_HAS_ECC | ||
513 | case KEY_ECDSA: | ||
514 | buffer_put_cstring(b, key_curve_nid_to_name(key->ecdsa_nid)); | ||
515 | buffer_put_ecpoint(b, EC_KEY_get0_group(key->ecdsa), | ||
516 | EC_KEY_get0_public_key(key->ecdsa)); | ||
517 | buffer_put_bignum2(b, EC_KEY_get0_private_key(key->ecdsa)); | ||
518 | break; | ||
519 | case KEY_ECDSA_CERT: | ||
520 | if (key->cert == NULL || buffer_len(&key->cert->certblob) == 0) | ||
521 | fatal("%s: no cert/certblob", __func__); | ||
522 | buffer_put_string(b, buffer_ptr(&key->cert->certblob), | ||
523 | buffer_len(&key->cert->certblob)); | ||
524 | buffer_put_bignum2(b, EC_KEY_get0_private_key(key->ecdsa)); | ||
525 | break; | ||
526 | #endif | ||
512 | } | 527 | } |
513 | buffer_put_cstring(b, comment); | 528 | buffer_put_cstring(b, comment); |
514 | } | 529 | } |
@@ -541,6 +556,8 @@ ssh_add_identity_constrained(AuthenticationConnection *auth, Key *key, | |||
541 | case KEY_DSA: | 556 | case KEY_DSA: |
542 | case KEY_DSA_CERT: | 557 | case KEY_DSA_CERT: |
543 | case KEY_DSA_CERT_V00: | 558 | case KEY_DSA_CERT_V00: |
559 | case KEY_ECDSA: | ||
560 | case KEY_ECDSA_CERT: | ||
544 | type = constrained ? | 561 | type = constrained ? |
545 | SSH2_AGENTC_ADD_ID_CONSTRAINED : | 562 | SSH2_AGENTC_ADD_ID_CONSTRAINED : |
546 | SSH2_AGENTC_ADD_IDENTITY; | 563 | SSH2_AGENTC_ADD_IDENTITY; |
@@ -589,7 +606,8 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key) | |||
589 | buffer_put_bignum(&msg, key->rsa->e); | 606 | buffer_put_bignum(&msg, key->rsa->e); |
590 | buffer_put_bignum(&msg, key->rsa->n); | 607 | buffer_put_bignum(&msg, key->rsa->n); |
591 | } else if (key_type_plain(key->type) == KEY_DSA || | 608 | } else if (key_type_plain(key->type) == KEY_DSA || |
592 | key_type_plain(key->type) == KEY_RSA) { | 609 | key_type_plain(key->type) == KEY_RSA || |
610 | key_type_plain(key->type) == KEY_ECDSA) { | ||
593 | key_to_blob(key, &blob, &blen); | 611 | key_to_blob(key, &blob, &blen); |
594 | buffer_put_char(&msg, SSH2_AGENTC_REMOVE_IDENTITY); | 612 | buffer_put_char(&msg, SSH2_AGENTC_REMOVE_IDENTITY); |
595 | buffer_put_string(&msg, blob, blen); | 613 | buffer_put_string(&msg, blob, blen); |