diff options
author | jsg@openbsd.org <jsg@openbsd.org> | 2020-02-26 14:40:09 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-02-28 02:26:28 +0100 |
commit | d5ba1c03278eb079438bb038266d80d7477d49cb (patch) | |
tree | 6d8dd2d802af796bcb7c9d6d018196a448bb9ff6 /ssh-ed25519-sk.c | |
parent | upstream: Have sftp reject "-1" in the same way as ssh(1) and (diff) | |
download | openssh-d5ba1c03278eb079438bb038266d80d7477d49cb.tar.xz openssh-d5ba1c03278eb079438bb038266d80d7477d49cb.zip |
upstream: change explicit_bzero();free() to freezero()
While freezero() returns early if the pointer is NULL the tests for
NULL in callers are left to avoid warnings about passing an
uninitialised size argument across a function boundry.
ok deraadt@ djm@
OpenBSD-Commit-ID: 2660fa334fcc7cd05ec74dd99cb036f9ade6384a
Diffstat (limited to 'ssh-ed25519-sk.c')
-rw-r--r-- | ssh-ed25519-sk.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ssh-ed25519-sk.c b/ssh-ed25519-sk.c index b6f28c09a..f784776d4 100644 --- a/ssh-ed25519-sk.c +++ b/ssh-ed25519-sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-ed25519-sk.c,v 1.4 2019/11/26 03:04:27 djm Exp $ */ +/* $OpenBSD: ssh-ed25519-sk.c,v 1.5 2020/02/26 13:40:09 jsg Exp $ */ /* * Copyright (c) 2019 Markus Friedl. All rights reserved. * @@ -154,10 +154,8 @@ ssh_ed25519_sk_verify(const struct sshkey *key, details = NULL; } out: - if (m != NULL) { - explicit_bzero(m, smlen); /* NB mlen may be invalid if r != 0 */ - free(m); - } + if (m != NULL) + freezero(m, smlen); /* NB mlen may be invalid if r != 0 */ sshkey_sig_details_free(details); sshbuf_free(b); sshbuf_free(encoded); |