summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2011-02-04 00:44:22 +0000
committerDamien Miller <djm@cvs.openbsd.org>2011-02-04 00:44:22 +0000
commit14ac75fece79f512ecec7e0b65ec57261be6b693 (patch)
treef7e84c17f336d7232e4782095602f8c137b0c6bf /usr.bin
parentad979218ae91be0abd09fab4a59f844cbe7bbb22 (diff)
fix uninitialised nonce variable; reported by Mateusz Kocielski
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/key.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index a15578bd8ad..d37c832a021 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.95 2010/11/10 01:33:07 djm Exp $ */
+/* $OpenBSD: key.c,v 1.96 2011/02/04 00:44:21 djm Exp $ */
/*
* read_bignum():
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1823,10 +1823,9 @@ key_certify(Key *k, Key *ca)
buffer_put_cstring(&k->cert->certblob, key_ssh_name(k));
/* -v01 certs put nonce first */
- if (!key_cert_is_legacy(k)) {
- arc4random_buf(&nonce, sizeof(nonce));
+ arc4random_buf(&nonce, sizeof(nonce));
+ if (!key_cert_is_legacy(k))
buffer_put_string(&k->cert->certblob, nonce, sizeof(nonce));
- }
switch (k->type) {
case KEY_DSA_CERT_V00: