diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ssh-agent.c | 24 |
2 files changed, 21 insertions, 9 deletions
@@ -34,6 +34,10 @@ | |||
34 | - djm@cvs.openbsd.org 2008/06/28 07:25:07 | 34 | - djm@cvs.openbsd.org 2008/06/28 07:25:07 |
35 | [PROTOCOL] | 35 | [PROTOCOL] |
36 | spelling fixes | 36 | spelling fixes |
37 | - djm@cvs.openbsd.org 2008/06/28 13:58:23 | ||
38 | [ssh-agent.c] | ||
39 | refuse to add a key that has unknown constraints specified; | ||
40 | ok markus | ||
37 | 41 | ||
38 | 20080628 | 42 | 20080628 |
39 | - (djm) [RFC.nroff contrib/cygwin/Makefile contrib/suse/openssh.spec] | 43 | - (djm) [RFC.nroff contrib/cygwin/Makefile contrib/suse/openssh.spec] |
@@ -4454,4 +4458,4 @@ | |||
4454 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4458 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4455 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4459 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4456 | 4460 | ||
4457 | $Id: ChangeLog,v 1.5031 2008/06/29 14:04:57 djm Exp $ | 4461 | $Id: ChangeLog,v 1.5032 2008/06/29 14:05:21 djm Exp $ |
diff --git a/ssh-agent.c b/ssh-agent.c index 6f8727b33..8f9e2e8ce 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.157 2007/09/25 23:48:57 canacar Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.158 2008/06/28 13:58:23 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 |
@@ -526,9 +526,8 @@ process_add_identity(SocketEntry *e, int version) | |||
526 | xfree(comment); | 526 | xfree(comment); |
527 | goto send; | 527 | goto send; |
528 | } | 528 | } |
529 | success = 1; | ||
530 | while (buffer_len(&e->request)) { | 529 | while (buffer_len(&e->request)) { |
531 | switch (buffer_get_char(&e->request)) { | 530 | switch ((type = buffer_get_char(&e->request))) { |
532 | case SSH_AGENT_CONSTRAIN_LIFETIME: | 531 | case SSH_AGENT_CONSTRAIN_LIFETIME: |
533 | death = time(NULL) + buffer_get_int(&e->request); | 532 | death = time(NULL) + buffer_get_int(&e->request); |
534 | break; | 533 | break; |
@@ -536,9 +535,14 @@ process_add_identity(SocketEntry *e, int version) | |||
536 | confirm = 1; | 535 | confirm = 1; |
537 | break; | 536 | break; |
538 | default: | 537 | default: |
539 | break; | 538 | error("process_add_identity: " |
539 | "Unknown constraint type %d", type); | ||
540 | xfree(comment); | ||
541 | key_free(k); | ||
542 | goto send; | ||
540 | } | 543 | } |
541 | } | 544 | } |
545 | success = 1; | ||
542 | if (lifetime && !death) | 546 | if (lifetime && !death) |
543 | death = time(NULL) + lifetime; | 547 | death = time(NULL) + lifetime; |
544 | if ((id = lookup_identity(k, version)) == NULL) { | 548 | if ((id = lookup_identity(k, version)) == NULL) { |
@@ -604,10 +608,10 @@ no_identities(SocketEntry *e, u_int type) | |||
604 | 608 | ||
605 | #ifdef SMARTCARD | 609 | #ifdef SMARTCARD |
606 | static void | 610 | static void |
607 | process_add_smartcard_key (SocketEntry *e) | 611 | process_add_smartcard_key(SocketEntry *e) |
608 | { | 612 | { |
609 | char *sc_reader_id = NULL, *pin; | 613 | char *sc_reader_id = NULL, *pin; |
610 | int i, version, success = 0, death = 0, confirm = 0; | 614 | int i, type, version, success = 0, death = 0, confirm = 0; |
611 | Key **keys, *k; | 615 | Key **keys, *k; |
612 | Identity *id; | 616 | Identity *id; |
613 | Idtab *tab; | 617 | Idtab *tab; |
@@ -616,7 +620,7 @@ process_add_smartcard_key (SocketEntry *e) | |||
616 | pin = buffer_get_string(&e->request, NULL); | 620 | pin = buffer_get_string(&e->request, NULL); |
617 | 621 | ||
618 | while (buffer_len(&e->request)) { | 622 | while (buffer_len(&e->request)) { |
619 | switch (buffer_get_char(&e->request)) { | 623 | switch ((type = buffer_get_char(&e->request))) { |
620 | case SSH_AGENT_CONSTRAIN_LIFETIME: | 624 | case SSH_AGENT_CONSTRAIN_LIFETIME: |
621 | death = time(NULL) + buffer_get_int(&e->request); | 625 | death = time(NULL) + buffer_get_int(&e->request); |
622 | break; | 626 | break; |
@@ -624,7 +628,11 @@ process_add_smartcard_key (SocketEntry *e) | |||
624 | confirm = 1; | 628 | confirm = 1; |
625 | break; | 629 | break; |
626 | default: | 630 | default: |
627 | break; | 631 | error("process_add_smartcard_key: " |
632 | "Unknown constraint type %d", type); | ||
633 | xfree(sc_reader_id); | ||
634 | xfree(pin); | ||
635 | goto send; | ||
628 | } | 636 | } |
629 | } | 637 | } |
630 | if (lifetime && !death) | 638 | if (lifetime && !death) |