diff options
-rw-r--r-- | sshkey.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey.c,v 1.9 2015/01/12 13:29:27 markus Exp $ */ | 1 | /* $OpenBSD: sshkey.c,v 1.10 2015/01/12 20:13:27 markus Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Alexander von Gernler. All rights reserved. | 4 | * Copyright (c) 2008 Alexander von Gernler. All rights reserved. |
@@ -1277,8 +1277,14 @@ sshkey_read(struct sshkey *ret, char **cpp) | |||
1277 | return SSH_ERR_ALLOC_FAIL; | 1277 | return SSH_ERR_ALLOC_FAIL; |
1278 | /* trim comment */ | 1278 | /* trim comment */ |
1279 | space = strchr(cp, ' '); | 1279 | space = strchr(cp, ' '); |
1280 | if (space) | 1280 | if (space) { |
1281 | *space = '\0'; | 1281 | /* advance 'space': skip whitespace */ |
1282 | *space++ = '\0'; | ||
1283 | while (*space == ' ' || *space == '\t') | ||
1284 | space++; | ||
1285 | *cpp = space; | ||
1286 | } else | ||
1287 | *cpp = cp + strlen(cp); | ||
1282 | if ((r = sshbuf_b64tod(blob, cp)) != 0) { | 1288 | if ((r = sshbuf_b64tod(blob, cp)) != 0) { |
1283 | sshbuf_free(blob); | 1289 | sshbuf_free(blob); |
1284 | return r; | 1290 | return r; |
@@ -1355,12 +1361,6 @@ sshkey_read(struct sshkey *ret, char **cpp) | |||
1355 | sshkey_free(k); | 1361 | sshkey_free(k); |
1356 | if (retval != 0) | 1362 | if (retval != 0) |
1357 | break; | 1363 | break; |
1358 | /* advance cp: skip whitespace and data */ | ||
1359 | while (*cp == ' ' || *cp == '\t') | ||
1360 | cp++; | ||
1361 | while (*cp != '\0' && *cp != ' ' && *cp != '\t') | ||
1362 | cp++; | ||
1363 | *cpp = cp; | ||
1364 | break; | 1364 | break; |
1365 | default: | 1365 | default: |
1366 | return SSH_ERR_INVALID_ARGUMENT; | 1366 | return SSH_ERR_INVALID_ARGUMENT; |