-/* $OpenBSD: ssh-keysign.c,v 1.40 2014/04/01 02:05:27 djm Exp $ */
+/* $OpenBSD: ssh-keysign.c,v 1.41 2014/04/19 14:53:48 tedu Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
#include <sys/types.h>
#include <openssl/evp.h>
-#include <openssl/rand.h>
#include <openssl/rsa.h>
#include <fcntl.h>
u_char *signature, *data;
char *host, *fp;
u_int slen, dlen;
- u_int32_t rnd[256];
/* Ensure that stdin and stdout are connected */
if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2)
fatal("could not open any host key");
OpenSSL_add_all_algorithms();
- arc4random_buf(rnd, sizeof(rnd));
- RAND_seed(rnd, sizeof(rnd));
found = 0;
for (i = 0; i < NUM_KEYTYPES; i++) {
-/* $OpenBSD: sshd.c,v 1.424 2014/04/18 23:52:25 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.425 2014/04/19 14:53:48 tedu Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
#include <openssl/dh.h>
#include <openssl/bn.h>
-#include <openssl/rand.h>
#include "xmalloc.h"
#include "ssh.h"
static void
privsep_preauth_child(void)
{
- u_int32_t rnd[256];
gid_t gidset[1];
struct passwd *pw;
ssh_gssapi_prepare_supported_oids();
#endif
- arc4random_buf(rnd, sizeof(rnd));
- RAND_seed(rnd, sizeof(rnd));
- explicit_bzero(rnd, sizeof(rnd));
-
/* Demote the private keys to public keys. */
demote_sensitive_data();
static void
privsep_postauth(Authctxt *authctxt)
{
- u_int32_t rnd[256];
if (authctxt->pw->pw_uid == 0 || options.use_login) {
/* File descriptor passing is broken or root login */
/* Demote the private keys to public keys. */
demote_sensitive_data();
- arc4random_buf(rnd, sizeof(rnd));
- RAND_seed(rnd, sizeof(rnd));
- explicit_bzero(rnd, sizeof(rnd));
-
/* Drop privileges */
do_setusercontext(authctxt->pw);
struct sockaddr_storage from;
socklen_t fromlen;
pid_t pid;
- u_char rnd[256];
/* setup fd set for accept */
fdset = NULL;
}
close(*newsock);
-
- /*
- * Ensure that our random state differs
- * from that of the child
- */
- arc4random_buf(rnd, sizeof(rnd));
- RAND_seed(rnd, sizeof(rnd));
- explicit_bzero(rnd, sizeof(rnd));
}
/* child process check (or debug mode) */