diff options
Diffstat (limited to 'sshkey.c')
-rw-r--r-- | sshkey.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey.c,v 1.11 2015/01/13 07:39:19 djm Exp $ */ | 1 | /* $OpenBSD: sshkey.c,v 1.12 2015/01/14 10:46:28 djm 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. |
@@ -31,9 +31,11 @@ | |||
31 | #include <sys/types.h> | 31 | #include <sys/types.h> |
32 | #include <netinet/in.h> | 32 | #include <netinet/in.h> |
33 | 33 | ||
34 | #ifdef WITH_OPENSSL | ||
34 | #include <openssl/evp.h> | 35 | #include <openssl/evp.h> |
35 | #include <openssl/err.h> | 36 | #include <openssl/err.h> |
36 | #include <openssl/pem.h> | 37 | #include <openssl/pem.h> |
38 | #endif | ||
37 | 39 | ||
38 | #include "crypto_api.h" | 40 | #include "crypto_api.h" |
39 | 41 | ||
@@ -1954,7 +1956,7 @@ sshkey_from_blob_internal(const u_char *blob, size_t blen, | |||
1954 | struct sshkey **keyp, int allow_cert) | 1956 | struct sshkey **keyp, int allow_cert) |
1955 | { | 1957 | { |
1956 | struct sshbuf *b = NULL; | 1958 | struct sshbuf *b = NULL; |
1957 | int type, nid = -1, ret = SSH_ERR_INTERNAL_ERROR; | 1959 | int type, ret = SSH_ERR_INTERNAL_ERROR; |
1958 | char *ktype = NULL, *curve = NULL; | 1960 | char *ktype = NULL, *curve = NULL; |
1959 | struct sshkey *key = NULL; | 1961 | struct sshkey *key = NULL; |
1960 | size_t len; | 1962 | size_t len; |
@@ -1975,8 +1977,6 @@ sshkey_from_blob_internal(const u_char *blob, size_t blen, | |||
1975 | } | 1977 | } |
1976 | 1978 | ||
1977 | type = sshkey_type_from_name(ktype); | 1979 | type = sshkey_type_from_name(ktype); |
1978 | if (sshkey_type_plain(type) == KEY_ECDSA) | ||
1979 | nid = sshkey_ecdsa_nid_from_name(ktype); | ||
1980 | if (!allow_cert && sshkey_type_is_cert(type)) { | 1980 | if (!allow_cert && sshkey_type_is_cert(type)) { |
1981 | ret = SSH_ERR_KEY_CERT_INVALID_SIGN_KEY; | 1981 | ret = SSH_ERR_KEY_CERT_INVALID_SIGN_KEY; |
1982 | goto out; | 1982 | goto out; |
@@ -2039,7 +2039,7 @@ sshkey_from_blob_internal(const u_char *blob, size_t blen, | |||
2039 | ret = SSH_ERR_ALLOC_FAIL; | 2039 | ret = SSH_ERR_ALLOC_FAIL; |
2040 | goto out; | 2040 | goto out; |
2041 | } | 2041 | } |
2042 | key->ecdsa_nid = nid; | 2042 | key->ecdsa_nid = sshkey_ecdsa_nid_from_name(ktype); |
2043 | if (sshbuf_get_cstring(b, &curve, NULL) != 0) { | 2043 | if (sshbuf_get_cstring(b, &curve, NULL) != 0) { |
2044 | ret = SSH_ERR_INVALID_FORMAT; | 2044 | ret = SSH_ERR_INVALID_FORMAT; |
2045 | goto out; | 2045 | goto out; |