|
Jan F. Chadima |
a3ba41 |
diff -up openssh-5.2p1/auth2-pubkey.c.fips openssh-5.2p1/auth2-pubkey.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/auth2-pubkey.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/auth2-pubkey.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
d93958 |
@@ -33,6 +33,7 @@
|
|
Tomáš Mráz |
d93958 |
#include <stdio.h>
|
|
Tomáš Mráz |
d93958 |
#include <stdarg.h>
|
|
Tomáš Mráz |
d93958 |
#include <unistd.h>
|
|
Tomáš Mráz |
d93958 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
#include "xmalloc.h"
|
|
Tomáš Mráz |
d93958 |
#include "ssh.h"
|
|
Tomáš Mráz |
d93958 |
@@ -243,7 +244,7 @@ user_key_allowed2(struct passwd *pw, Key
|
|
Tomáš Mráz |
d93958 |
found_key = 1;
|
|
Tomáš Mráz |
d93958 |
debug("matching key found: file %s, line %lu",
|
|
Tomáš Mráz |
d93958 |
file, linenum);
|
|
Tomáš Mráz |
d93958 |
- fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
+ fp = key_fingerprint(found, FIPS_mode() ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
verbose("Found matching %s key: %s",
|
|
Tomáš Mráz |
d93958 |
key_type(found), fp);
|
|
Tomáš Mráz |
d93958 |
xfree(fp);
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/cipher.c.fips openssh-5.2p1/cipher.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/cipher.c.fips 2009-03-06 18:23:21.000000000 +0100
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/cipher.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -40,6 +40,7 @@
|
|
Tomáš Mráz |
0a4fa5 |
#include <sys/types.h>
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/md5.h>
|
|
Tomáš Mráz |
d93958 |
+#include <openssl/fips.h>
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
#include <string.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <stdarg.h>
|
|
Tomáš Mráz |
0a4fa5 |
@@ -93,6 +94,22 @@ struct Cipher {
|
|
Tomáš Mráz |
0a4fa5 |
{ NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, NULL }
|
|
Tomáš Mráz |
0a4fa5 |
};
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
+struct Cipher fips_ciphers[] = {
|
|
Tomáš Mráz |
0a4fa5 |
+ { "none", SSH_CIPHER_NONE, 8, 0, 0, 0, EVP_enc_null },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "3des", SSH_CIPHER_3DES, 8, 16, 0, 1, evp_ssh1_3des },
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
0a4fa5 |
+ { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 1, EVP_des_ede3_cbc },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "aes128-cbc", SSH_CIPHER_SSH2, 16, 16, 0, 1, EVP_aes_128_cbc },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "aes192-cbc", SSH_CIPHER_SSH2, 16, 24, 0, 1, EVP_aes_192_cbc },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "aes256-cbc", SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "rijndael-cbc@lysator.liu.se",
|
|
Tomáš Mráz |
0a4fa5 |
+ SSH_CIPHER_SSH2, 16, 32, 0, 1, EVP_aes_256_cbc },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, 0, 0, evp_aes_128_ctr },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, 0, 0, evp_aes_128_ctr },
|
|
Tomáš Mráz |
0a4fa5 |
+ { "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, 0, 0, evp_aes_128_ctr },
|
|
Tomáš Mráz |
0a4fa5 |
+ { NULL, SSH_CIPHER_INVALID, 0, 0, 0, 0, NULL }
|
|
Tomáš Mráz |
0a4fa5 |
+};
|
|
Jan F. Chadima |
adad2a |
+
|
|
Tomáš Mráz |
0a4fa5 |
/*--*/
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
u_int
|
|
Tomáš Mráz |
0a4fa5 |
@@ -135,7 +152,7 @@ Cipher *
|
|
Tomáš Mráz |
0a4fa5 |
cipher_by_name(const char *name)
|
|
Tomáš Mráz |
0a4fa5 |
{
|
|
Tomáš Mráz |
0a4fa5 |
Cipher *c;
|
|
Tomáš Mráz |
0a4fa5 |
- for (c = ciphers; c->name != NULL; c++)
|
|
Tomáš Mráz |
0a4fa5 |
+ for (c = FIPS_mode() ? fips_ciphers : ciphers; c->name != NULL; c++)
|
|
Tomáš Mráz |
0a4fa5 |
if (strcmp(c->name, name) == 0)
|
|
Tomáš Mráz |
0a4fa5 |
return c;
|
|
Tomáš Mráz |
0a4fa5 |
return NULL;
|
|
Tomáš Mráz |
0a4fa5 |
@@ -145,7 +162,7 @@ Cipher *
|
|
Tomáš Mráz |
0a4fa5 |
cipher_by_number(int id)
|
|
Tomáš Mráz |
0a4fa5 |
{
|
|
Tomáš Mráz |
0a4fa5 |
Cipher *c;
|
|
Tomáš Mráz |
0a4fa5 |
- for (c = ciphers; c->name != NULL; c++)
|
|
Tomáš Mráz |
0a4fa5 |
+ for (c = FIPS_mode() ? fips_ciphers : ciphers; c->name != NULL; c++)
|
|
Tomáš Mráz |
0a4fa5 |
if (c->number == id)
|
|
Tomáš Mráz |
0a4fa5 |
return c;
|
|
Tomáš Mráz |
0a4fa5 |
return NULL;
|
|
Tomáš Mráz |
0a4fa5 |
@@ -189,7 +206,7 @@ cipher_number(const char *name)
|
|
Tomáš Mráz |
0a4fa5 |
Cipher *c;
|
|
Tomáš Mráz |
0a4fa5 |
if (name == NULL)
|
|
Tomáš Mráz |
0a4fa5 |
return -1;
|
|
Tomáš Mráz |
0a4fa5 |
- for (c = ciphers; c->name != NULL; c++)
|
|
Tomáš Mráz |
0a4fa5 |
+ for (c = FIPS_mode() ? fips_ciphers : ciphers; c->name != NULL; c++)
|
|
Tomáš Mráz |
0a4fa5 |
if (strcasecmp(c->name, name) == 0)
|
|
Tomáš Mráz |
0a4fa5 |
return c->number;
|
|
Tomáš Mráz |
0a4fa5 |
return -1;
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/cipher-ctr.c.fips openssh-5.2p1/cipher-ctr.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/cipher-ctr.c.fips 2007-06-14 15:21:33.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/cipher-ctr.c 2009-04-17 23:23:06.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -140,7 +140,8 @@ evp_aes_128_ctr(void)
|
|
Tomáš Mráz |
0a4fa5 |
aes_ctr.do_cipher = ssh_aes_ctr;
|
|
Tomáš Mráz |
0a4fa5 |
#ifndef SSH_OLD_EVP
|
|
Tomáš Mráz |
0a4fa5 |
aes_ctr.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH |
|
|
Tomáš Mráz |
0a4fa5 |
- EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV;
|
|
Tomáš Mráz |
0a4fa5 |
+ EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV |
|
|
Tomáš Mráz |
0a4fa5 |
+ EVP_CIPH_FLAG_FIPS;
|
|
Jan F. Chadima |
adad2a |
#endif
|
|
Tomáš Mráz |
0a4fa5 |
return (&aes_ctr);
|
|
Tomáš Mráz |
0a4fa5 |
}
|
|
Jan F. Chadima |
a3ba41 |
diff -up openssh-5.2p1/mac.c.fips openssh-5.2p1/mac.c
|
|
Jan F. Chadima |
a3ba41 |
--- openssh-5.2p1/mac.c.fips 2008-06-13 02:58:50.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/mac.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
d93958 |
@@ -28,6 +28,7 @@
|
|
Tomáš Mráz |
d93958 |
#include <sys/types.h>
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
#include <openssl/hmac.h>
|
|
Tomáš Mráz |
d93958 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
#include <stdarg.h>
|
|
Tomáš Mráz |
d93958 |
#include <string.h>
|
|
Tomáš Mráz |
d93958 |
@@ -47,14 +48,14 @@
|
|
Tomáš Mráz |
d93958 |
#define SSH_EVP 1 /* OpenSSL EVP-based MAC */
|
|
Tomáš Mráz |
d93958 |
#define SSH_UMAC 2 /* UMAC (not integrated with OpenSSL) */
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
-struct {
|
|
Tomáš Mráz |
d93958 |
+struct Macs {
|
|
Tomáš Mráz |
d93958 |
char *name;
|
|
Tomáš Mráz |
d93958 |
int type;
|
|
Tomáš Mráz |
d93958 |
const EVP_MD * (*mdfunc)(void);
|
|
Tomáš Mráz |
d93958 |
int truncatebits; /* truncate digest if != 0 */
|
|
Tomáš Mráz |
d93958 |
int key_len; /* just for UMAC */
|
|
Tomáš Mráz |
d93958 |
int len; /* just for UMAC */
|
|
Tomáš Mráz |
d93958 |
-} macs[] = {
|
|
Tomáš Mráz |
d93958 |
+} all_macs[] = {
|
|
Tomáš Mráz |
d93958 |
{ "hmac-sha1", SSH_EVP, EVP_sha1, 0, -1, -1 },
|
|
Tomáš Mráz |
d93958 |
{ "hmac-sha1-96", SSH_EVP, EVP_sha1, 96, -1, -1 },
|
|
Tomáš Mráz |
d93958 |
{ "hmac-md5", SSH_EVP, EVP_md5, 0, -1, -1 },
|
|
Tomáš Mráz |
d93958 |
@@ -65,9 +66,15 @@ struct {
|
|
Tomáš Mráz |
d93958 |
{ NULL, 0, NULL, 0, -1, -1 }
|
|
Tomáš Mráz |
d93958 |
};
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
+struct Macs fips_macs[] = {
|
|
Tomáš Mráz |
d93958 |
+ { "hmac-sha1", SSH_EVP, EVP_sha1, 0, -1, -1 },
|
|
Tomáš Mráz |
d93958 |
+ { NULL, 0, NULL, 0, -1, -1 }
|
|
Tomáš Mráz |
d93958 |
+};
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
d93958 |
static void
|
|
Tomáš Mráz |
d93958 |
mac_setup_by_id(Mac *mac, int which)
|
|
Tomáš Mráz |
d93958 |
{
|
|
Tomáš Mráz |
d93958 |
+ struct Macs *macs = FIPS_mode() ? fips_macs : all_macs;
|
|
Tomáš Mráz |
d93958 |
int evp_len;
|
|
Tomáš Mráz |
d93958 |
mac->type = macs[which].type;
|
|
Tomáš Mráz |
d93958 |
if (mac->type == SSH_EVP) {
|
|
Tomáš Mráz |
d93958 |
@@ -88,6 +95,7 @@ int
|
|
Tomáš Mráz |
d93958 |
mac_setup(Mac *mac, char *name)
|
|
Tomáš Mráz |
d93958 |
{
|
|
Tomáš Mráz |
d93958 |
int i;
|
|
Tomáš Mráz |
d93958 |
+ struct Macs *macs = FIPS_mode() ? fips_macs : all_macs;
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
for (i = 0; macs[i].name; i++) {
|
|
Tomáš Mráz |
d93958 |
if (strcmp(name, macs[i].name) == 0) {
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/Makefile.in.fips openssh-5.2p1/Makefile.in
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/Makefile.in.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/Makefile.in 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -134,28 +134,28 @@ libssh.a: $(LIBSSH_OBJS)
|
|
Tomáš Mráz |
0a4fa5 |
$(RANLIB) $@
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS)
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) -lfipscheck $(LIBS)
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o
|
|
Tomáš Mráz |
0a4fa5 |
$(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Jan F. Chadima |
a3ba41 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Jan F. Chadima |
a3ba41 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Jan F. Chadima |
a3ba41 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o
|
|
Tomáš Mráz |
0a4fa5 |
- $(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
+ $(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lfipscheck $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o
|
|
Tomáš Mráz |
0a4fa5 |
$(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/myproposal.h.fips openssh-5.2p1/myproposal.h
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/myproposal.h.fips 2009-01-28 06:33:31.000000000 +0100
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/myproposal.h 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -53,7 +53,12 @@
|
|
Tomáš Mráz |
0a4fa5 |
"hmac-sha1-96,hmac-md5-96"
|
|
Tomáš Mráz |
0a4fa5 |
#define KEX_DEFAULT_COMP "none,zlib@openssh.com,zlib"
|
|
Tomáš Mráz |
0a4fa5 |
#define KEX_DEFAULT_LANG ""
|
|
Tomáš Mráz |
0a4fa5 |
-
|
|
Tomáš Mráz |
0a4fa5 |
+#define KEX_FIPS_ENCRYPT \
|
|
Tomáš Mráz |
0a4fa5 |
+ "aes128-ctr,aes192-ctr,aes256-ctr," \
|
|
Tomáš Mráz |
0a4fa5 |
+ "aes128-cbc,3des-cbc," \
|
|
Tomáš Mráz |
0a4fa5 |
+ "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se"
|
|
Tomáš Mráz |
0a4fa5 |
+#define KEX_FIPS_MAC \
|
|
Tomáš Mráz |
0a4fa5 |
+ "hmac-sha1"
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
static char *myproposal[PROPOSAL_MAX] = {
|
|
Tomáš Mráz |
0a4fa5 |
KEX_DEFAULT_KEX,
|
|
Jan F. Chadima |
a3ba41 |
diff -up openssh-5.2p1/nsskeys.c.fips openssh-5.2p1/nsskeys.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/nsskeys.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/nsskeys.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
d93958 |
@@ -183,8 +183,8 @@ nss_convert_pubkey(Key *k)
|
|
Tomáš Mráz |
d93958 |
break;
|
|
Tomáš Mráz |
d93958 |
}
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
- p = key_fingerprint(k, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
- debug("fingerprint %u %s", key_size(k), p);
|
|
Tomáš Mráz |
d93958 |
+ p = key_fingerprint(k, SSH_FP_SHA1, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
+ debug("SHA1 fingerprint %u %s", key_size(k), p);
|
|
Tomáš Mráz |
d93958 |
xfree(p);
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
return 0;
|
|
Jan F. Chadima |
a3ba41 |
diff -up openssh-5.2p1/openbsd-compat/bsd-arc4random.c.fips openssh-5.2p1/openbsd-compat/bsd-arc4random.c
|
|
Jan F. Chadima |
a3ba41 |
--- openssh-5.2p1/openbsd-compat/bsd-arc4random.c.fips 2008-06-04 02:54:00.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/openbsd-compat/bsd-arc4random.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
d93958 |
@@ -39,6 +39,7 @@
|
|
Tomáš Mráz |
d93958 |
static int rc4_ready = 0;
|
|
Tomáš Mráz |
d93958 |
static RC4_KEY rc4;
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
+#if 0
|
|
Tomáš Mráz |
d93958 |
unsigned int
|
|
Tomáš Mráz |
d93958 |
arc4random(void)
|
|
Tomáš Mráz |
d93958 |
{
|
|
Tomáš Mráz |
d93958 |
@@ -82,6 +83,32 @@ arc4random_stir(void)
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
rc4_ready = REKEY_BYTES;
|
|
Tomáš Mráz |
d93958 |
}
|
|
Tomáš Mráz |
d93958 |
+#else
|
|
Tomáš Mráz |
d93958 |
+unsigned int
|
|
Tomáš Mráz |
d93958 |
+arc4random(void)
|
|
Tomáš Mráz |
d93958 |
+{
|
|
Tomáš Mráz |
d93958 |
+ unsigned int r = 0;
|
|
Tomáš Mráz |
d93958 |
+ void *rp = &r;
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
d93958 |
+ if (!rc4_ready) {
|
|
Tomáš Mráz |
d93958 |
+ arc4random_stir();
|
|
Tomáš Mráz |
d93958 |
+ }
|
|
Tomáš Mráz |
d93958 |
+ RAND_bytes(rp, sizeof(r));
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
d93958 |
+ return(r);
|
|
Tomáš Mráz |
d93958 |
+}
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
d93958 |
+void
|
|
Tomáš Mráz |
d93958 |
+arc4random_stir(void)
|
|
Tomáš Mráz |
d93958 |
+{
|
|
Tomáš Mráz |
d93958 |
+ unsigned char rand_buf[SEED_SIZE];
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
d93958 |
+ if (RAND_bytes(rand_buf, sizeof(rand_buf)) <= 0)
|
|
Tomáš Mráz |
d93958 |
+ fatal("Couldn't obtain random bytes (error %ld)",
|
|
Tomáš Mráz |
d93958 |
+ ERR_get_error());
|
|
Tomáš Mráz |
d93958 |
+ rc4_ready = 1;
|
|
Tomáš Mráz |
d93958 |
+}
|
|
Tomáš Mráz |
d93958 |
+#endif
|
|
Tomáš Mráz |
d93958 |
#endif /* !HAVE_ARC4RANDOM */
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
#ifndef ARC4RANDOM_BUF
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/ssh-add.c.fips openssh-5.2p1/ssh-add.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/ssh-add.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/ssh-add.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -42,6 +42,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
#include <sys/param.h>
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
#include <openssl/evp.h>
|
|
Tomáš Mráz |
d93958 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
d93958 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/openssl-compat.h"
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
#ifdef HAVE_LIBNSS
|
|
Tomáš Mráz |
0a4fa5 |
@@ -254,7 +256,7 @@ list_identities(AuthenticationConnection
|
|
Tomáš Mráz |
0a4fa5 |
key = ssh_get_next_identity(ac, &comment, version)) {
|
|
Tomáš Mráz |
0a4fa5 |
had_identities = 1;
|
|
Tomáš Mráz |
0a4fa5 |
if (do_fp) {
|
|
Tomáš Mráz |
0a4fa5 |
- fp = key_fingerprint(key, SSH_FP_MD5,
|
|
Tomáš Mráz |
0a4fa5 |
+ fp = key_fingerprint(key, FIPS_mode() ? SSH_FP_SHA1 : SSH_FP_MD5,
|
|
Tomáš Mráz |
0a4fa5 |
SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
printf("%d %s %s (%s)\n",
|
|
Tomáš Mráz |
0a4fa5 |
key_size(key), fp, comment, key_type(key));
|
|
Tomáš Mráz |
0a4fa5 |
@@ -463,10 +465,19 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
sanitise_stdfd();
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
__progname = ssh_get_progname(argv[0]);
|
|
Tomáš Mráz |
0a4fa5 |
+ SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fprintf(stderr,
|
|
Tomáš Mráz |
0a4fa5 |
+ "FIPS integrity verification test failed.\n");
|
|
Tomáš Mráz |
0a4fa5 |
+ exit(3);
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Jan F. Chadima |
a3ba41 |
+
|
|
Jan F. Chadima |
a3ba41 |
init_rng();
|
|
Jan F. Chadima |
a3ba41 |
seed_rng();
|
|
Tomáš Mráz |
d93958 |
|
|
Jan F. Chadima |
a3ba41 |
- SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
/* At first, get a connection to the authentication agent. */
|
|
Tomáš Mráz |
0a4fa5 |
ac = ssh_get_authentication_connection();
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/ssh-agent.c.fips openssh-5.2p1/ssh-agent.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/ssh-agent.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/ssh-agent.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -51,6 +51,8 @@
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/evp.h>
|
|
Jan F. Chadima |
adad2a |
#include <openssl/md5.h>
|
|
Jan F. Chadima |
adad2a |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/openssl-compat.h"
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
#include <errno.h>
|
|
Tomáš Mráz |
0a4fa5 |
@@ -200,9 +202,9 @@ confirm_key(Identity *id)
|
|
Tomáš Mráz |
0a4fa5 |
char *p;
|
|
Tomáš Mráz |
0a4fa5 |
int ret = -1;
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
- p = key_fingerprint(id->key, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
- if (ask_permission("Allow use of key %s?\nKey fingerprint %s.",
|
|
Tomáš Mráz |
0a4fa5 |
- id->comment, p))
|
|
Tomáš Mráz |
0a4fa5 |
+ p = key_fingerprint(id->key, FIPS_mode() ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
+ if (ask_permission("Allow use of key %s?\nKey %sfingerprint %s.",
|
|
Tomáš Mráz |
0a4fa5 |
+ id->comment, FIPS_mode() ? "SHA1 " : "", p))
|
|
Tomáš Mráz |
0a4fa5 |
ret = 0;
|
|
Tomáš Mráz |
0a4fa5 |
xfree(p);
|
|
Jan F. Chadima |
adad2a |
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1196,6 +1198,11 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
#endif
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fprintf(stderr,
|
|
Tomáš Mráz |
0a4fa5 |
+ "FIPS integrity verification test failed.\n");
|
|
Tomáš Mráz |
0a4fa5 |
+ exit(3);
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
__progname = ssh_get_progname(av[0]);
|
|
Tomáš Mráz |
0a4fa5 |
init_rng();
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1356,6 +1363,10 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
/* child */
|
|
Tomáš Mráz |
0a4fa5 |
log_init(__progname, SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_AUTH, 0);
|
|
Jan F. Chadima |
a3ba41 |
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
if (setsid() == -1) {
|
|
Tomáš Mráz |
0a4fa5 |
error("setsid: %s", strerror(errno));
|
|
Tomáš Mráz |
0a4fa5 |
cleanup_exit(1);
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/ssh.c.fips openssh-5.2p1/ssh.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/ssh.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/ssh.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -71,6 +71,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/evp.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/err.h>
|
|
Tomáš Mráz |
d93958 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
d93958 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/openssl-compat.h"
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/sys-queue.h"
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
@@ -220,6 +222,10 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
sanitise_stdfd();
|
|
Jan F. Chadima |
a3ba41 |
|
|
Tomáš Mráz |
0a4fa5 |
__progname = ssh_get_progname(av[0]);
|
|
Jan F. Chadima |
adad2a |
+ SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
d93958 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fatal("FIPS integrity verification test failed.");
|
|
Tomáš Mráz |
d93958 |
+ }
|
|
Jan F. Chadima |
adad2a |
init_rng();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
/*
|
|
Tomáš Mráz |
0a4fa5 |
@@ -550,7 +556,6 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
if (!host)
|
|
Tomáš Mráz |
0a4fa5 |
usage();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
- SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
ERR_load_crypto_strings();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
/* Initialize the command to execute on remote host. */
|
|
Tomáš Mráz |
0a4fa5 |
@@ -635,6 +640,10 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Jan F. Chadima |
adad2a |
seed_rng();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
if (options.user == NULL)
|
|
Tomáš Mráz |
0a4fa5 |
options.user = xstrdup(pw->pw_name);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/sshconnect2.c.fips openssh-5.2p1/sshconnect2.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/sshconnect2.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/sshconnect2.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -44,6 +44,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
#include <vis.h>
|
|
Tomáš Mráz |
0a4fa5 |
#endif
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/sys-queue.h"
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include "xmalloc.h"
|
|
Tomáš Mráz |
0a4fa5 |
@@ -115,6 +117,10 @@ ssh_kex2(char *host, struct sockaddr *ho
|
|
Tomáš Mráz |
0a4fa5 |
if (options.ciphers != NULL) {
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers;
|
|
Tomáš Mráz |
0a4fa5 |
+ } else if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_ENC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_ENC_ALGS_STOC] = KEX_FIPS_ENCRYPT;
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
}
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_CTOS]);
|
|
Tomáš Mráz |
0a4fa5 |
@@ -130,7 +136,11 @@ ssh_kex2(char *host, struct sockaddr *ho
|
|
Tomáš Mráz |
0a4fa5 |
if (options.macs != NULL) {
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_MAC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_MAC_ALGS_STOC] = options.macs;
|
|
Tomáš Mráz |
0a4fa5 |
+ } else if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_MAC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_MAC_ALGS_STOC] = KEX_FIPS_MAC;
|
|
Tomáš Mráz |
0a4fa5 |
}
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
if (options.hostkeyalgorithms != NULL)
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] =
|
|
Tomáš Mráz |
0a4fa5 |
options.hostkeyalgorithms;
|
|
Tomáš Mráz |
0a4fa5 |
@@ -507,8 +517,8 @@ input_userauth_pk_ok(int type, u_int32_t
|
|
Tomáš Mráz |
0a4fa5 |
key->type, pktype);
|
|
Tomáš Mráz |
0a4fa5 |
goto done;
|
|
Tomáš Mráz |
0a4fa5 |
}
|
|
Tomáš Mráz |
0a4fa5 |
- fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
- debug2("input_userauth_pk_ok: fp %s", fp);
|
|
Tomáš Mráz |
0a4fa5 |
+ fp = key_fingerprint(key, SSH_FP_SHA1, SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
+ debug2("input_userauth_pk_ok: SHA1 fp %s", fp);
|
|
Tomáš Mráz |
0a4fa5 |
xfree(fp);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
/*
|
|
Jan F. Chadima |
a3ba41 |
diff -up openssh-5.2p1/sshconnect.c.fips openssh-5.2p1/sshconnect.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/sshconnect.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/sshconnect.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
d93958 |
@@ -40,6 +40,8 @@
|
|
Tomáš Mráz |
d93958 |
#include <unistd.h>
|
|
Tomáš Mráz |
d93958 |
#include <fcntl.h>
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
d93958 |
+
|
|
Tomáš Mráz |
d93958 |
#include "xmalloc.h"
|
|
Tomáš Mráz |
d93958 |
#include "key.h"
|
|
Tomáš Mráz |
d93958 |
#include "hostfile.h"
|
|
Tomáš Mráz |
0f07b4 |
@@ -761,6 +763,7 @@ check_host_key(char *hostname, struct so
|
|
Tomáš Mráz |
d93958 |
goto fail;
|
|
Tomáš Mráz |
d93958 |
} else if (options.strict_host_key_checking == 2) {
|
|
Tomáš Mráz |
d93958 |
char msg1[1024], msg2[1024];
|
|
Tomáš Mráz |
d93958 |
+ int fips_on = FIPS_mode();
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
if (show_other_keys(host, host_key))
|
|
Tomáš Mráz |
d93958 |
snprintf(msg1, sizeof(msg1),
|
|
Tomáš Mráz |
0f07b4 |
@@ -769,8 +772,8 @@ check_host_key(char *hostname, struct so
|
|
Tomáš Mráz |
d93958 |
else
|
|
Tomáš Mráz |
d93958 |
snprintf(msg1, sizeof(msg1), ".");
|
|
Tomáš Mráz |
d93958 |
/* The default */
|
|
Tomáš Mráz |
d93958 |
- fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
- ra = key_fingerprint(host_key, SSH_FP_MD5,
|
|
Tomáš Mráz |
d93958 |
+ fp = key_fingerprint(host_key, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
+ ra = key_fingerprint(host_key, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5,
|
|
Tomáš Mráz |
d93958 |
SSH_FP_RANDOMART);
|
|
Tomáš Mráz |
d93958 |
msg2[0] = '\0';
|
|
Tomáš Mráz |
d93958 |
if (options.verify_host_key_dns) {
|
|
Tomáš Mráz |
0f07b4 |
@@ -786,10 +789,10 @@ check_host_key(char *hostname, struct so
|
|
Tomáš Mráz |
d93958 |
snprintf(msg, sizeof(msg),
|
|
Tomáš Mráz |
d93958 |
"The authenticity of host '%.200s (%s)' can't be "
|
|
Tomáš Mráz |
d93958 |
"established%s\n"
|
|
Tomáš Mráz |
d93958 |
- "%s key fingerprint is %s.%s%s\n%s"
|
|
Tomáš Mráz |
d93958 |
+ "%s key %sfingerprint is %s.%s%s\n%s"
|
|
Tomáš Mráz |
d93958 |
"Are you sure you want to continue connecting "
|
|
Tomáš Mráz |
d93958 |
"(yes/no)? ",
|
|
Tomáš Mráz |
d93958 |
- host, ip, msg1, type, fp,
|
|
Tomáš Mráz |
d93958 |
+ host, ip, msg1, type, fips_on ? "SHA1 " : "", fp,
|
|
Tomáš Mráz |
d93958 |
options.visual_host_key ? "\n" : "",
|
|
Tomáš Mráz |
d93958 |
options.visual_host_key ? ra : "",
|
|
Tomáš Mráz |
d93958 |
msg2);
|
|
Tomáš Mráz |
0f07b4 |
@@ -1077,17 +1080,18 @@ show_key_from_file(const char *file, con
|
|
Tomáš Mráz |
d93958 |
Key *found;
|
|
Tomáš Mráz |
d93958 |
char *fp, *ra;
|
|
Tomáš Mráz |
d93958 |
int line, ret;
|
|
Tomáš Mráz |
d93958 |
+ int fips_on = FIPS_mode();
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
found = key_new(keytype);
|
|
Tomáš Mráz |
d93958 |
if ((ret = lookup_key_in_hostfile_by_type(file, host,
|
|
Tomáš Mráz |
d93958 |
keytype, found, &line))) {
|
|
Tomáš Mráz |
d93958 |
- fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
- ra = key_fingerprint(found, SSH_FP_MD5, SSH_FP_RANDOMART);
|
|
Tomáš Mráz |
d93958 |
+ fp = key_fingerprint(found, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
+ ra = key_fingerprint(found, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_RANDOMART);
|
|
Tomáš Mráz |
d93958 |
logit("WARNING: %s key found for host %s\n"
|
|
Tomáš Mráz |
d93958 |
"in %s:%d\n"
|
|
Tomáš Mráz |
d93958 |
- "%s key fingerprint %s.\n%s\n",
|
|
Tomáš Mráz |
d93958 |
+ "%s key %sfingerprint %s.\n%s\n",
|
|
Tomáš Mráz |
d93958 |
key_type(found), host, file, line,
|
|
Tomáš Mráz |
d93958 |
- key_type(found), fp, ra);
|
|
Tomáš Mráz |
d93958 |
+ key_type(found), fips_on ? "SHA1 ":"", fp, ra);
|
|
Tomáš Mráz |
d93958 |
xfree(ra);
|
|
Tomáš Mráz |
d93958 |
xfree(fp);
|
|
Tomáš Mráz |
d93958 |
}
|
|
Tomáš Mráz |
0f07b4 |
@@ -1133,8 +1137,9 @@ warn_changed_key(Key *host_key)
|
|
Tomáš Mráz |
d93958 |
{
|
|
Tomáš Mráz |
d93958 |
char *fp;
|
|
Tomáš Mráz |
d93958 |
const char *type = key_type(host_key);
|
|
Tomáš Mráz |
d93958 |
+ int fips_on = FIPS_mode();
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
- fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
+ fp = key_fingerprint(host_key, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
|
|
Tomáš Mráz |
d93958 |
error("@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @");
|
|
Tomáš Mráz |
0f07b4 |
@@ -1142,8 +1147,8 @@ warn_changed_key(Key *host_key)
|
|
Tomáš Mráz |
d93958 |
error("IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!");
|
|
Tomáš Mráz |
d93958 |
error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!");
|
|
Tomáš Mráz |
d93958 |
error("It is also possible that the %s host key has just been changed.", type);
|
|
Tomáš Mráz |
d93958 |
- error("The fingerprint for the %s key sent by the remote host is\n%s.",
|
|
Tomáš Mráz |
d93958 |
- type, fp);
|
|
Tomáš Mráz |
d93958 |
+ error("The %sfingerprint for the %s key sent by the remote host is\n%s.",
|
|
Tomáš Mráz |
d93958 |
+ fips_on ? "SHA1 ":"", type, fp);
|
|
Tomáš Mráz |
d93958 |
error("Please contact your system administrator.");
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
xfree(fp);
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/sshd.c.fips openssh-5.2p1/sshd.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/sshd.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/sshd.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -76,6 +76,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/bn.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/md5.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/rand.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/openssl-compat.h"
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#ifdef HAVE_SECUREWARE
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1260,6 +1262,12 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
(void)set_auth_parameters(ac, av);
|
|
Tomáš Mráz |
0a4fa5 |
#endif
|
|
Tomáš Mráz |
0a4fa5 |
__progname = ssh_get_progname(av[0]);
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
+ SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fatal("FIPS integrity verification test failed.");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
init_rng();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
/* Save argv. Duplicate so setproctitle emulation doesn't clobber it */
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1412,8 +1420,6 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
else
|
|
Tomáš Mráz |
0a4fa5 |
closefrom(REEXEC_DEVCRYPTO_RESERVED_FD);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
- SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
-
|
|
Tomáš Mráz |
0a4fa5 |
/*
|
|
Tomáš Mráz |
0a4fa5 |
* Force logging to stderr until we have loaded the private host
|
|
Tomáš Mráz |
0a4fa5 |
* key (unless started from inetd)
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1655,6 +1661,10 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
/* Initialize the random number generator. */
|
|
Tomáš Mráz |
0a4fa5 |
arc4random_stir();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
/* Chdir to the root directory so that the current disk can be
|
|
Tomáš Mráz |
0a4fa5 |
unmounted if desired. */
|
|
Tomáš Mráz |
0a4fa5 |
chdir("/");
|
|
Tomáš Mráz |
0a4fa5 |
@@ -2182,6 +2192,9 @@ do_ssh2_kex(void)
|
|
Tomáš Mráz |
0a4fa5 |
if (options.ciphers != NULL) {
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers;
|
|
Tomáš Mráz |
0a4fa5 |
+ } else if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_ENC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_ENC_ALGS_STOC] = KEX_FIPS_ENCRYPT;
|
|
Tomáš Mráz |
0a4fa5 |
}
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_CTOS]);
|
|
Tomáš Mráz |
0a4fa5 |
@@ -2191,6 +2204,9 @@ do_ssh2_kex(void)
|
|
Tomáš Mráz |
0a4fa5 |
if (options.macs != NULL) {
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_MAC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_MAC_ALGS_STOC] = options.macs;
|
|
Tomáš Mráz |
0a4fa5 |
+ } else if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_MAC_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
+ myproposal[PROPOSAL_MAC_ALGS_STOC] = KEX_FIPS_MAC;
|
|
Tomáš Mráz |
0a4fa5 |
}
|
|
Tomáš Mráz |
0a4fa5 |
if (options.compression == COMP_NONE) {
|
|
Tomáš Mráz |
0a4fa5 |
myproposal[PROPOSAL_COMP_ALGS_CTOS] =
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/ssh-keygen.c.fips openssh-5.2p1/ssh-keygen.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/ssh-keygen.c.fips 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/ssh-keygen.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -21,6 +21,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/evp.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/pem.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include "openbsd-compat/openssl-compat.h"
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include <errno.h>
|
|
Tomáš Mráz |
0a4fa5 |
@@ -537,7 +539,7 @@ do_fingerprint(struct passwd *pw)
|
|
Tomáš Mráz |
0a4fa5 |
enum fp_type fptype;
|
|
Tomáš Mráz |
0a4fa5 |
struct stat st;
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
- fptype = print_bubblebabble ? SSH_FP_SHA1 : SSH_FP_MD5;
|
|
Tomáš Mráz |
0a4fa5 |
+ fptype = print_bubblebabble ? SSH_FP_SHA1 : FIPS_mode() ? SSH_FP_SHA1 : SSH_FP_MD5;
|
|
Tomáš Mráz |
0a4fa5 |
rep = print_bubblebabble ? SSH_FP_BUBBLEBABBLE : SSH_FP_HEX;
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
if (!have_identity)
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1125,11 +1127,21 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
__progname = ssh_get_progname(argv[0]);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fprintf(stderr,
|
|
Tomáš Mráz |
0a4fa5 |
+ "FIPS integrity verification test failed.\n");
|
|
Tomáš Mráz |
0a4fa5 |
+ exit(3);
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
init_rng();
|
|
Tomáš Mráz |
0a4fa5 |
seed_rng();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
/* we need this for the home * directory. */
|
|
Tomáš Mráz |
0a4fa5 |
pw = getpwuid(getuid());
|
|
Tomáš Mráz |
0a4fa5 |
if (!pw) {
|
|
Tomáš Mráz |
0a4fa5 |
@@ -1506,14 +1518,15 @@ passphrase_again:
|
|
Tomáš Mráz |
0a4fa5 |
fclose(f);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
if (!quiet) {
|
|
Tomáš Mráz |
0a4fa5 |
- char *fp = key_fingerprint(public, SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
- char *ra = key_fingerprint(public, SSH_FP_MD5,
|
|
Tomáš Mráz |
0a4fa5 |
+ int fips_on = FIPS_mode();
|
|
Tomáš Mráz |
0a4fa5 |
+ char *fp = key_fingerprint(public, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5, SSH_FP_HEX);
|
|
Tomáš Mráz |
0a4fa5 |
+ char *ra = key_fingerprint(public, fips_on ? SSH_FP_SHA1 : SSH_FP_MD5,
|
|
Tomáš Mráz |
0a4fa5 |
SSH_FP_RANDOMART);
|
|
Tomáš Mráz |
0a4fa5 |
printf("Your public key has been saved in %s.\n",
|
|
Tomáš Mráz |
0a4fa5 |
identity_file);
|
|
Tomáš Mráz |
0a4fa5 |
- printf("The key fingerprint is:\n");
|
|
Tomáš Mráz |
0a4fa5 |
+ printf("The key %sfingerprint is:\n", fips_on ? "SHA1 " : "");
|
|
Tomáš Mráz |
0a4fa5 |
printf("%s %s\n", fp, comment);
|
|
Tomáš Mráz |
0a4fa5 |
- printf("The key's randomart image is:\n");
|
|
Tomáš Mráz |
0a4fa5 |
+ printf("The key's %srandomart image is:\n", fips_on ? "SHA1 " :"");
|
|
Tomáš Mráz |
0a4fa5 |
printf("%s\n", ra);
|
|
Tomáš Mráz |
0a4fa5 |
xfree(ra);
|
|
Tomáš Mráz |
0a4fa5 |
xfree(fp);
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/ssh-keyscan.c.fips openssh-5.2p1/ssh-keyscan.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/ssh-keyscan.c.fips 2009-01-28 06:31:23.000000000 +0100
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/ssh-keyscan.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -19,6 +19,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
#include <arpa/inet.h>
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/bn.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include <netdb.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <errno.h>
|
|
Tomáš Mráz |
0a4fa5 |
@@ -731,6 +733,13 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
extern char *optarg;
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
__progname = ssh_get_progname(argv[0]);
|
|
Tomáš Mráz |
0a4fa5 |
+ SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fprintf(stderr,
|
|
Tomáš Mráz |
0a4fa5 |
+ "FIPS integrity verification test failed.\n");
|
|
Tomáš Mráz |
0a4fa5 |
+ exit(3);
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
init_rng();
|
|
Tomáš Mráz |
0a4fa5 |
seed_rng();
|
|
Tomáš Mráz |
0a4fa5 |
TAILQ_INIT(&tq;;
|
|
Tomáš Mráz |
0a4fa5 |
@@ -812,6 +821,10 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
log_init("ssh-keyscan", log_level, SYSLOG_FACILITY_USER, 1);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
maxfd = fdlim_get(1);
|
|
Tomáš Mráz |
0a4fa5 |
if (maxfd < 0)
|
|
Tomáš Mráz |
0a4fa5 |
fatal("%s: fdlim_get: bad value", __progname);
|
|
Tomáš Mráz |
0a4fa5 |
diff -up openssh-5.2p1/ssh-keysign.c.fips openssh-5.2p1/ssh-keysign.c
|
|
Tomáš Mráz |
0a4fa5 |
--- openssh-5.2p1/ssh-keysign.c.fips 2006-09-01 07:38:37.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
+++ openssh-5.2p1/ssh-keysign.c 2009-04-17 14:52:11.000000000 +0200
|
|
Tomáš Mráz |
0a4fa5 |
@@ -38,6 +38,8 @@
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/evp.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/rand.h>
|
|
Tomáš Mráz |
0a4fa5 |
#include <openssl/rsa.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <openssl/fips.h>
|
|
Tomáš Mráz |
0a4fa5 |
+#include <fipscheck.h>
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
#include "xmalloc.h"
|
|
Tomáš Mráz |
0a4fa5 |
#include "log.h"
|
|
Tomáš Mráz |
0a4fa5 |
@@ -175,6 +177,11 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
permanently_set_uid(pw);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+ SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode() && !FIPSCHECK_verify(NULL, NULL)) {
|
|
Tomáš Mráz |
0a4fa5 |
+ fatal("FIPS integrity verification test failed");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
init_rng();
|
|
Tomáš Mráz |
0a4fa5 |
seed_rng();
|
|
Tomáš Mráz |
0a4fa5 |
arc4random_stir();
|
|
Tomáš Mráz |
0a4fa5 |
@@ -183,6 +190,10 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0);
|
|
Tomáš Mráz |
0a4fa5 |
#endif
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
0a4fa5 |
+ logit("FIPS mode initialized");
|
|
Tomáš Mráz |
0a4fa5 |
+ }
|
|
Tomáš Mráz |
0a4fa5 |
+
|
|
Tomáš Mráz |
0a4fa5 |
/* verify that ssh-keysign is enabled by the admin */
|
|
Tomáš Mráz |
0a4fa5 |
initialize_options(&options);
|
|
Tomáš Mráz |
0a4fa5 |
(void)read_config_file(_PATH_HOST_CONFIG_FILE, "", &options, 0);
|
|
Tomáš Mráz |
0a4fa5 |
@@ -194,7 +205,6 @@ main(int argc, char **argv)
|
|
Tomáš Mráz |
0a4fa5 |
if (key_fd[0] == -1 && key_fd[1] == -1)
|
|
Tomáš Mráz |
0a4fa5 |
fatal("could not open any host key");
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Tomáš Mráz |
0a4fa5 |
- SSLeay_add_all_algorithms();
|
|
Tomáš Mráz |
0a4fa5 |
for (i = 0; i < 256; i++)
|
|
Tomáš Mráz |
0a4fa5 |
rnd[i] = arc4random();
|
|
Tomáš Mráz |
0a4fa5 |
RAND_seed(rnd, sizeof(rnd));
|