summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/cipher.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2020-02-26 13:40:09 +0000
committerjsg <jsg@openbsd.org>2020-02-26 13:40:09 +0000
commitc9831b39c7f05cf54db0775dea423b6be448db6e (patch)
treef50d8c53bee8b027f393d63b6867f7cdcf2c7a4b /usr.bin/ssh/cipher.c
parentHave sftp reject "-1" in the same way as ssh(1) and scp(1) do instead (diff)
downloadwireguard-openbsd-c9831b39c7f05cf54db0775dea423b6be448db6e.tar.xz
wireguard-openbsd-c9831b39c7f05cf54db0775dea423b6be448db6e.zip
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@
Diffstat (limited to 'usr.bin/ssh/cipher.c')
-rw-r--r--usr.bin/ssh/cipher.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c
index 714d4591554..3f497e9585d 100644
--- a/usr.bin/ssh/cipher.c
+++ b/usr.bin/ssh/cipher.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cipher.c,v 1.114 2020/01/23 10:24:29 dtucker Exp $ */
+/* $OpenBSD: cipher.c,v 1.115 2020/02/26 13:40:09 jsg Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -320,8 +320,7 @@ cipher_init(struct sshcipher_ctx **ccp, const struct sshcipher *cipher,
#ifdef WITH_OPENSSL
EVP_CIPHER_CTX_free(cc->evp);
#endif /* WITH_OPENSSL */
- explicit_bzero(cc, sizeof(*cc));
- free(cc);
+ freezero(cc, sizeof(*cc));
}
}
return ret;
@@ -426,8 +425,7 @@ cipher_free(struct sshcipher_ctx *cc)
EVP_CIPHER_CTX_free(cc->evp);
cc->evp = NULL;
#endif
- explicit_bzero(cc, sizeof(*cc));
- free(cc);
+ freezero(cc, sizeof(*cc));
}
/*