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

(-)auth2-pubkey.c (-4 / +14 lines)
Lines 200-205 Link Here
200
200
201
	while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) {
201
	while (read_keyfile_line(f, file, line, sizeof(line), &linenum) != -1) {
202
		char *cp, *key_options = NULL;
202
		char *cp, *key_options = NULL;
203
		char *key_comment = NULL;
204
		char *i = NULL;
203
205
204
		/* Skip leading whitespace, empty and comment lines. */
206
		/* Skip leading whitespace, empty and comment lines. */
205
		for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
207
		for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
Lines 230-240 Link Here
230
		if (key_equal(found, key) &&
232
		if (key_equal(found, key) &&
231
		    auth_parse_options(pw, key_options, file, linenum) == 1) {
233
		    auth_parse_options(pw, key_options, file, linenum) == 1) {
232
			found_key = 1;
234
			found_key = 1;
233
			debug("matching key found: file %s, line %lu",
235
234
			    file, linenum);
236
			/* Skip remaining whitespace. */
237
			for (key_comment = cp; *key_comment == ' ' || *key_comment == '\t'; ++key_comment)
238
			    ;
239
			for (i = key_comment; *i && *i != ' ' && *i != '\t' && *i != '\r' && *i != '\n'; ++i)
240
				;
241
			*i = '\0';
242
243
			debug("matching key found: file %s, line %lu, comment %s",
244
			    file, linenum, key_comment);
235
			fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX);
245
			fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX);
236
			verbose("Found matching %s key: %s",
246
			verbose("Found matching %s key: %s (%s)",
237
			    key_type(found), fp);
247
			    key_type(found), fp, key_comment);
238
			xfree(fp);
248
			xfree(fp);
239
			break;
249
			break;
240
		}
250
		}

Return to bug 1674