View | Details | Raw Unified | Return to bug 2655
Collapse All | Expand All

(-)auth2-pubkey.c (-4 / +11 lines)
Lines 561-569 process_principals(FILE *f, char *file, Link Here
561
{
561
{
562
	char line[SSH_MAX_PUBKEY_BYTES], *cp, *ep, *line_opts;
562
	char line[SSH_MAX_PUBKEY_BYTES], *cp, *ep, *line_opts;
563
	u_long linenum = 0;
563
	u_long linenum = 0;
564
	u_int i;
564
	u_int i, found_principal = 0;
565
565
566
	while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) {
566
	while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) {
567
		/* Always consume entire input */
568
		if (found_principal)
569
			continue;
567
		/* Skip leading whitespace. */
570
		/* Skip leading whitespace. */
568
		for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
571
		for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
569
			;
572
			;
Lines 596-606 process_principals(FILE *f, char *file, Link Here
596
				if (auth_parse_options(pw, line_opts,
599
				if (auth_parse_options(pw, line_opts,
597
				    file, linenum) != 1)
600
				    file, linenum) != 1)
598
					continue;
601
					continue;
599
				return 1;
602
				found_principal = 1;
603
				continue;
600
			}
604
			}
601
		}
605
		}
602
	}
606
	}
603
	return 0;
607
	return found_principal;
604
}
608
}
605
609
606
static int
610
static int
Lines 768-773 check_authkeys_file(FILE *f, char *file, Link Here
768
		char *cp, *key_options = NULL, *fp = NULL;
772
		char *cp, *key_options = NULL, *fp = NULL;
769
		const char *reason = NULL;
773
		const char *reason = NULL;
770
774
775
		/* Always consume entrire file */
776
		if (found_key)
777
			continue;
771
		if (found != NULL)
778
		if (found != NULL)
772
			key_free(found);
779
			key_free(found);
773
		found = key_new(key_is_cert(key) ? KEY_UNSPEC : key->type);
780
		found = key_new(key_is_cert(key) ? KEY_UNSPEC : key->type);
Lines 854-860 check_authkeys_file(FILE *f, char *file, Link Here
854
			    file, linenum, key_type(found), fp);
861
			    file, linenum, key_type(found), fp);
855
			free(fp);
862
			free(fp);
856
			found_key = 1;
863
			found_key = 1;
857
			break;
864
			continue;
858
		}
865
		}
859
	}
866
	}
860
	if (found != NULL)
867
	if (found != NULL)

Return to bug 2655