mirror of git://anongit.mindrot.org/openssh.git
- djm@cvs.openbsd.org 2014/04/01 02:05:27
[ssh-keysign.c] include fingerprint of key not found use arc4random_buf() instead of loop+arc4random()
This commit is contained in:
parent
43b156cf72
commit
fcd62c0b66
|
@ -69,6 +69,10 @@
|
|||
[ssh-keygen.1]
|
||||
the text for the -K option was inserted in the wrong place in -r1.108;
|
||||
fix From: Matthew Clarke
|
||||
- djm@cvs.openbsd.org 2014/04/01 02:05:27
|
||||
[ssh-keysign.c]
|
||||
include fingerprint of key not found
|
||||
use arc4random_buf() instead of loop+arc4random()
|
||||
|
||||
20140401
|
||||
- (djm) On platforms that support it, use prctl() to prevent sftp-server
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ssh-keysign.c,v 1.39 2013/12/06 13:39:49 markus Exp $ */
|
||||
/* $OpenBSD: ssh-keysign.c,v 1.40 2014/04/01 02:05:27 djm Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2002 Markus Friedl. All rights reserved.
|
||||
*
|
||||
|
@ -155,7 +155,7 @@ main(int argc, char **argv)
|
|||
struct passwd *pw;
|
||||
int key_fd[NUM_KEYTYPES], i, found, version = 2, fd;
|
||||
u_char *signature, *data;
|
||||
char *host;
|
||||
char *host, *fp;
|
||||
u_int slen, dlen;
|
||||
u_int32_t rnd[256];
|
||||
|
||||
|
@ -201,8 +201,7 @@ main(int argc, char **argv)
|
|||
fatal("could not open any host key");
|
||||
|
||||
OpenSSL_add_all_algorithms();
|
||||
for (i = 0; i < 256; i++)
|
||||
rnd[i] = arc4random();
|
||||
arc4random_buf(rnd, sizeof(rnd));
|
||||
RAND_seed(rnd, sizeof(rnd));
|
||||
|
||||
found = 0;
|
||||
|
@ -243,8 +242,11 @@ main(int argc, char **argv)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
fatal("no matching hostkey found");
|
||||
if (!found) {
|
||||
fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
|
||||
fatal("no matching hostkey found for key %s %s",
|
||||
key_type(key), fp);
|
||||
}
|
||||
|
||||
if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)
|
||||
fatal("key_sign failed");
|
||||
|
|
Loading…
Reference in New Issue