]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Move declaration of "len" into the block where it's used.
authordtucker@openbsd.org <dtucker@openbsd.org>
Mon, 16 Oct 2023 08:40:00 +0000 (08:40 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Mon, 16 Oct 2023 09:13:41 +0000 (20:13 +1100)
This lets us compile Portable with -Werror with when OpenSSL doesn't have
Ed25519 support.

OpenBSD-Commit-ID: e02e4b4af351946562a7caee905da60eff16ba29

sshkey.c

index 33f5e734fbe00ed66d7b1c421a844fd2d88ab067..06db9b5da34b3aa2ebdba606d820005aff6ba0e4 100644 (file)
--- a/sshkey.c
+++ b/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.
@@ -3422,7 +3422,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;
@@ -3504,6 +3503,8 @@ sshkey_parse_private_pem_fileblob(struct sshbuf *blob, int type,
 #ifdef OPENSSL_HAS_ED25519
        } 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) {