summaryrefslogtreecommitdiff
path: root/authfd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-08-31 22:41:14 +1000
committerDamien Miller <djm@mindrot.org>2010-08-31 22:41:14 +1000
commiteb8b60e320cdade9f4c07e2abacfb92c52e01348 (patch)
tree4e5bc25790566402e5b7ae00cefd2c57e867ef09 /authfd.c
parentda108ece6843f1268aa36d7c8ed0030dc53acd15 (diff)
- djm@cvs.openbsd.org 2010/08/31 11:54:45
[PROTOCOL PROTOCOL.agent PROTOCOL.certkeys auth2-jpake.c authfd.c] [authfile.c buffer.h dns.c kex.c kex.h key.c key.h monitor.c] [monitor_wrap.c myproposal.h packet.c packet.h pathnames.h readconf.c] [ssh-add.1 ssh-add.c ssh-agent.1 ssh-agent.c ssh-keygen.1 ssh-keygen.c] [ssh-keyscan.1 ssh-keyscan.c ssh-keysign.8 ssh.1 ssh.c ssh2.h] [ssh_config.5 sshconnect.c sshconnect2.c sshd.8 sshd.c sshd_config.5] [uuencode.c uuencode.h bufec.c kexecdh.c kexecdhc.c kexecdhs.c ssh-ecdsa.c] Implement Elliptic Curve Cryptography modes for key exchange (ECDH) and host/user keys (ECDSA) as specified by RFC5656. ECDH and ECDSA offer better performance than plain DH and DSA at the same equivalent symmetric key length, as well as much shorter keys. Only the mandatory sections of RFC5656 are implemented, specifically the three REQUIRED curves nistp256, nistp384 and nistp521 and only ECDH and ECDSA. Point compression (optional in RFC5656 is NOT implemented). Certificate host and user keys using the new ECDSA key types are supported. Note that this code has not been tested for interoperability and may be subject to change. feedback and ok markus@
Diffstat (limited to 'authfd.c')
-rw-r--r--authfd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/authfd.c b/authfd.c
index 739722fbf..ec537d2e9 100644
--- a/authfd.c
+++ b/authfd.c
@@ -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);