openssh/openssh-4.6p1-engines.diff

129 lines
2.9 KiB
Diff

--- openssh-4.6p1/ssh-add.c
+++ openssh-4.6p1/ssh-add.c
@@ -42,6 +42,7 @@
#include <sys/param.h>
#include <openssl/evp.h>
+#include <openssl/engine.h>
#include <fcntl.h>
#include <pwd.h>
@@ -343,6 +344,10 @@
SSLeay_add_all_algorithms();
+ /* Init available hardware crypto engines. */
+ ENGINE_load_builtin_engines();
+ ENGINE_register_all_complete();
+
/* At first, get a connection to the authentication agent. */
ac = ssh_get_authentication_connection();
if (ac == NULL) {
--- openssh-4.6p1/ssh-agent.c
+++ openssh-4.6p1/ssh-agent.c
@@ -51,6 +51,7 @@
#include <openssl/evp.h>
#include <openssl/md5.h>
+#include <openssl/engine.h>
#include <errno.h>
#include <fcntl.h>
@@ -1043,6 +1044,10 @@
SSLeay_add_all_algorithms();
+ /* Init available hardware crypto engines. */
+ ENGINE_load_builtin_engines();
+ ENGINE_register_all_complete();
+
__progname = ssh_get_progname(av[0]);
init_rng();
seed_rng();
--- openssh-4.6p1/ssh-keygen.c
+++ openssh-4.6p1/ssh-keygen.c
@@ -21,6 +21,7 @@
#include <openssl/evp.h>
#include <openssl/pem.h>
+#include <openssl/engine.h>
#include <errno.h>
#include <fcntl.h>
@@ -1073,6 +1074,11 @@
__progname = ssh_get_progname(argv[0]);
SSLeay_add_all_algorithms();
+
+ /* Init available hardware crypto engines. */
+ ENGINE_load_builtin_engines();
+ ENGINE_register_all_complete();
+
log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
init_rng();
--- openssh-4.6p1/ssh-keysign.c
+++ openssh-4.6p1/ssh-keysign.c
@@ -38,6 +38,7 @@
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/rsa.h>
+#include <openssl/engine.h>
#include "xmalloc.h"
#include "log.h"
@@ -195,6 +196,11 @@
fatal("could not open any host key");
SSLeay_add_all_algorithms();
+
+ /* Init available hardware crypto engines. */
+ ENGINE_load_builtin_engines();
+ ENGINE_register_all_complete();
+
for (i = 0; i < 256; i++)
rnd[i] = arc4random();
RAND_seed(rnd, sizeof(rnd));
--- openssh-4.6p1/ssh.c
+++ openssh-4.6p1/ssh.c
@@ -72,6 +72,7 @@
#include <openssl/evp.h>
#include <openssl/err.h>
+#include <openssl/engine.h>
#include "xmalloc.h"
#include "ssh.h"
@@ -556,6 +557,10 @@
SSLeay_add_all_algorithms();
ERR_load_crypto_strings();
+ /* Init available hardware crypto engines. */
+ ENGINE_load_builtin_engines();
+ ENGINE_register_all_complete();
+
/* Initialize the command to execute on remote host. */
buffer_init(&command);
--- openssh-4.6p1/sshd.c
+++ openssh-4.6p1/sshd.c
@@ -75,6 +75,7 @@
#include <openssl/bn.h>
#include <openssl/md5.h>
#include <openssl/rand.h>
+#include <openssl/engine.h>
#ifdef HAVE_SECUREWARE
#include <sys/security.h>
#include <prot.h>
@@ -1445,6 +1446,10 @@
SSLeay_add_all_algorithms();
+ /* Init available hardware crypto engines. */
+ ENGINE_load_builtin_engines();
+ ENGINE_register_all_complete();
+
/*
* Force logging to stderr until we have loaded the private host
* key (unless started from inetd)