diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2023-10-16 08:40:01 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2023-10-16 08:40:01 +0000 |
commit | c1bafcaf96364760ab0636e68cf4c12050fe8404 (patch) | |
tree | baab784e15222e4f2e8180d545aef601f191c962 | |
parent | 728ab87c3edeedcc6557277277959b8e32d8bcdd (diff) |
Move declaration of "len" into the block where it's used. This lets
us compile Portable with -Werror with when OpenSSL doesn't have Ed25519
support.
-rw-r--r-- | usr.bin/ssh/sshkey.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c index f41018c1872..24be04e1102 100644 --- a/usr.bin/ssh/sshkey.c +++ b/usr.bin/ssh/sshkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshkey.c,v 1.139 2023/10/11 22:41:05 djm Exp $ */ +/* $OpenBSD: sshkey.c,v 1.140 2023/10/16 08:40:00 dtucker Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Alexander von Gernler. All rights reserved. @@ -3367,7 +3367,6 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, struct sshkey *prv = NULL; BIO *bio = NULL; int r; - size_t len; if (keyp != NULL) *keyp = NULL; @@ -3446,6 +3445,8 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type, #endif } else if (EVP_PKEY_base_id(pk) == EVP_PKEY_ED25519 && (type == KEY_UNSPEC || type == KEY_ED25519)) { + size_t len; + if ((prv = sshkey_new(KEY_UNSPEC)) == NULL || (prv->ed25519_sk = calloc(1, ED25519_SK_SZ)) == NULL || (prv->ed25519_pk = calloc(1, ED25519_PK_SZ)) == NULL) { |