summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--auth.c1
-rw-r--r--key.c18
-rw-r--r--misc.c1
-rw-r--r--packet.c2
-rw-r--r--ssh-add.c3
6 files changed, 7 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 4928e20b6..3133fff23 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,9 @@
65 [key.c] 65 [key.c]
66 (really) last of the Coverity diffs: avoid possible NULL deref in 66 (really) last of the Coverity diffs: avoid possible NULL deref in
67 key_free. via elad AT netbsd.org; markus@ ok 67 key_free. via elad AT netbsd.org; markus@ ok
68 - deraadt@cvs.openbsd.org 2006/03/20 17:10:19
69 [auth.c key.c misc.c packet.c ssh-add.c]
70 in a switch (), break after return or goto is stupid
68 71
6920060325 7220060325
70 - OpenBSD CVS Sync 73 - OpenBSD CVS Sync
@@ -4322,4 +4325,4 @@
4322 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 4325 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
4323 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 4326 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
4324 4327
4325$Id: ChangeLog,v 1.4259 2006/03/26 03:02:16 djm Exp $ 4328$Id: ChangeLog,v 1.4260 2006/03/26 03:02:45 djm Exp $
diff --git a/auth.c b/auth.c
index 35bc5ea1d..85c6f8d1d 100644
--- a/auth.c
+++ b/auth.c
@@ -314,7 +314,6 @@ auth_root_allowed(char *method)
314 switch (options.permit_root_login) { 314 switch (options.permit_root_login) {
315 case PERMIT_YES: 315 case PERMIT_YES:
316 return 1; 316 return 1;
317 break;
318 case PERMIT_NO_PASSWD: 317 case PERMIT_NO_PASSWD:
319 if (strcmp(method, "password") != 0) 318 if (strcmp(method, "password") != 0)
320 return 1; 319 return 1;
diff --git a/key.c b/key.c
index 283aea99e..96619fe60 100644
--- a/key.c
+++ b/key.c
@@ -156,14 +156,12 @@ key_equal(const Key *a, const Key *b)
156 return a->rsa != NULL && b->rsa != NULL && 156 return a->rsa != NULL && b->rsa != NULL &&
157 BN_cmp(a->rsa->e, b->rsa->e) == 0 && 157 BN_cmp(a->rsa->e, b->rsa->e) == 0 &&
158 BN_cmp(a->rsa->n, b->rsa->n) == 0; 158 BN_cmp(a->rsa->n, b->rsa->n) == 0;
159 break;
160 case KEY_DSA: 159 case KEY_DSA:
161 return a->dsa != NULL && b->dsa != NULL && 160 return a->dsa != NULL && b->dsa != NULL &&
162 BN_cmp(a->dsa->p, b->dsa->p) == 0 && 161 BN_cmp(a->dsa->p, b->dsa->p) == 0 &&
163 BN_cmp(a->dsa->q, b->dsa->q) == 0 && 162 BN_cmp(a->dsa->q, b->dsa->q) == 0 &&
164 BN_cmp(a->dsa->g, b->dsa->g) == 0 && 163 BN_cmp(a->dsa->g, b->dsa->g) == 0 &&
165 BN_cmp(a->dsa->pub_key, b->dsa->pub_key) == 0; 164 BN_cmp(a->dsa->pub_key, b->dsa->pub_key) == 0;
166 break;
167 default: 165 default:
168 fatal("key_equal: bad key type %d", a->type); 166 fatal("key_equal: bad key type %d", a->type);
169 break; 167 break;
@@ -210,7 +208,6 @@ key_fingerprint_raw(const Key *k, enum fp_type dgst_type,
210 break; 208 break;
211 case KEY_UNSPEC: 209 case KEY_UNSPEC:
212 return retval; 210 return retval;
213 break;
214 default: 211 default:
215 fatal("key_fingerprint_raw: bad key type %d", k->type); 212 fatal("key_fingerprint_raw: bad key type %d", k->type);
216 break; 213 break;
@@ -531,13 +528,10 @@ key_type(const Key *k)
531 switch (k->type) { 528 switch (k->type) {
532 case KEY_RSA1: 529 case KEY_RSA1:
533 return "RSA1"; 530 return "RSA1";
534 break;
535 case KEY_RSA: 531 case KEY_RSA:
536 return "RSA"; 532 return "RSA";
537 break;
538 case KEY_DSA: 533 case KEY_DSA:
539 return "DSA"; 534 return "DSA";
540 break;
541 } 535 }
542 return "unknown"; 536 return "unknown";
543} 537}
@@ -548,10 +542,8 @@ key_ssh_name(const Key *k)
548 switch (k->type) { 542 switch (k->type) {
549 case KEY_RSA: 543 case KEY_RSA:
550 return "ssh-rsa"; 544 return "ssh-rsa";
551 break;
552 case KEY_DSA: 545 case KEY_DSA:
553 return "ssh-dss"; 546 return "ssh-dss";
554 break;
555 } 547 }
556 return "ssh-unknown"; 548 return "ssh-unknown";
557} 549}
@@ -563,10 +555,8 @@ key_size(const Key *k)
563 case KEY_RSA1: 555 case KEY_RSA1:
564 case KEY_RSA: 556 case KEY_RSA:
565 return BN_num_bits(k->rsa->n); 557 return BN_num_bits(k->rsa->n);
566 break;
567 case KEY_DSA: 558 case KEY_DSA:
568 return BN_num_bits(k->dsa->p); 559 return BN_num_bits(k->dsa->p);
569 break;
570 } 560 }
571 return 0; 561 return 0;
572} 562}
@@ -575,6 +565,7 @@ static RSA *
575rsa_generate_private_key(u_int bits) 565rsa_generate_private_key(u_int bits)
576{ 566{
577 RSA *private; 567 RSA *private;
568
578 private = RSA_generate_key(bits, 35, NULL, NULL); 569 private = RSA_generate_key(bits, 35, NULL, NULL);
579 if (private == NULL) 570 if (private == NULL)
580 fatal("rsa_generate_private_key: key generation failed."); 571 fatal("rsa_generate_private_key: key generation failed.");
@@ -585,6 +576,7 @@ static DSA*
585dsa_generate_private_key(u_int bits) 576dsa_generate_private_key(u_int bits)
586{ 577{
587 DSA *private = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, NULL, NULL); 578 DSA *private = DSA_generate_parameters(bits, NULL, 0, NULL, NULL, NULL, NULL);
579
588 if (private == NULL) 580 if (private == NULL)
589 fatal("dsa_generate_private_key: DSA_generate_parameters failed"); 581 fatal("dsa_generate_private_key: DSA_generate_parameters failed");
590 if (!DSA_generate_key(private)) 582 if (!DSA_generate_key(private))
@@ -794,14 +786,11 @@ key_sign(
794 switch (key->type) { 786 switch (key->type) {
795 case KEY_DSA: 787 case KEY_DSA:
796 return ssh_dss_sign(key, sigp, lenp, data, datalen); 788 return ssh_dss_sign(key, sigp, lenp, data, datalen);
797 break;
798 case KEY_RSA: 789 case KEY_RSA:
799 return ssh_rsa_sign(key, sigp, lenp, data, datalen); 790 return ssh_rsa_sign(key, sigp, lenp, data, datalen);
800 break;
801 default: 791 default:
802 error("key_sign: invalid key type %d", key->type); 792 error("key_sign: invalid key type %d", key->type);
803 return -1; 793 return -1;
804 break;
805 } 794 }
806} 795}
807 796
@@ -821,14 +810,11 @@ key_verify(
821 switch (key->type) { 810 switch (key->type) {
822 case KEY_DSA: 811 case KEY_DSA:
823 return ssh_dss_verify(key, signature, signaturelen, data, datalen); 812 return ssh_dss_verify(key, signature, signaturelen, data, datalen);
824 break;
825 case KEY_RSA: 813 case KEY_RSA:
826 return ssh_rsa_verify(key, signature, signaturelen, data, datalen); 814 return ssh_rsa_verify(key, signature, signaturelen, data, datalen);
827 break;
828 default: 815 default:
829 error("key_verify: invalid key type %d", key->type); 816 error("key_verify: invalid key type %d", key->type);
830 return -1; 817 return -1;
831 break;
832 } 818 }
833} 819}
834 820
diff --git a/misc.c b/misc.c
index 66b762b5a..1949dd4b3 100644
--- a/misc.c
+++ b/misc.c
@@ -297,6 +297,7 @@ convtime(const char *s)
297 switch (*endp++) { 297 switch (*endp++) {
298 case '\0': 298 case '\0':
299 endp--; 299 endp--;
300 break;
300 case 's': 301 case 's':
301 case 'S': 302 case 'S':
302 break; 303 break;
diff --git a/packet.c b/packet.c
index a1e7d32f6..65fb31d2e 100644
--- a/packet.c
+++ b/packet.c
@@ -1188,7 +1188,6 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1188 break; 1188 break;
1189 default: 1189 default:
1190 return type; 1190 return type;
1191 break;
1192 } 1191 }
1193 } else { 1192 } else {
1194 type = packet_read_poll1(); 1193 type = packet_read_poll1();
@@ -1211,7 +1210,6 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1211 if (type) 1210 if (type)
1212 DBG(debug("received packet type %d", type)); 1211 DBG(debug("received packet type %d", type));
1213 return type; 1212 return type;
1214 break;
1215 } 1213 }
1216 } 1214 }
1217 } 1215 }
diff --git a/ssh-add.c b/ssh-add.c
index 4c5cc5727..2944cceeb 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -346,13 +346,11 @@ main(int argc, char **argv)
346 if (list_identities(ac, ch == 'l' ? 1 : 0) == -1) 346 if (list_identities(ac, ch == 'l' ? 1 : 0) == -1)
347 ret = 1; 347 ret = 1;
348 goto done; 348 goto done;
349 break;
350 case 'x': 349 case 'x':
351 case 'X': 350 case 'X':
352 if (lock_agent(ac, ch == 'x' ? 1 : 0) == -1) 351 if (lock_agent(ac, ch == 'x' ? 1 : 0) == -1)
353 ret = 1; 352 ret = 1;
354 goto done; 353 goto done;
355 break;
356 case 'c': 354 case 'c':
357 confirm = 1; 355 confirm = 1;
358 break; 356 break;
@@ -363,7 +361,6 @@ main(int argc, char **argv)
363 if (delete_all(ac) == -1) 361 if (delete_all(ac) == -1)
364 ret = 1; 362 ret = 1;
365 goto done; 363 goto done;
366 break;
367 case 's': 364 case 's':
368 sc_reader_id = optarg; 365 sc_reader_id = optarg;
369 break; 366 break;