|
Jan F |
003cb0 |
diff -up openssh-5.8p1/authfile.c.fips openssh-5.8p1/authfile.c
|
|
Jan F |
003cb0 |
--- openssh-5.8p1/authfile.c.fips 2010-12-01 02:03:39.000000000 +0100
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/authfile.c 2011-04-01 09:34:12.136698711 +0200
|
|
Jan F |
003cb0 |
@@ -145,8 +145,14 @@ key_private_rsa1_to_blob(Key *key, Buffe
|
|
Tomáš Mráz |
76f329 |
/* Allocate space for the private part of the key in the buffer. */
|
|
Tomáš Mráz |
76f329 |
cp = buffer_append_space(&encrypted, buffer_len(&buffer));
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
- cipher_set_key_string(&ciphercontext, cipher, passphrase,
|
|
Tomáš Mráz |
76f329 |
- CIPHER_ENCRYPT);
|
|
Tomáš Mráz |
76f329 |
+ if (cipher_set_key_string(&ciphercontext, cipher, passphrase,
|
|
Tomáš Mráz |
76f329 |
+ CIPHER_ENCRYPT) < 0) {
|
|
Tomáš Mráz |
76f329 |
+ error("cipher_set_key_string failed.");
|
|
Tomáš Mráz |
76f329 |
+ buffer_free(&encrypted);
|
|
Tomáš Mráz |
76f329 |
+ buffer_free(&buffer);
|
|
Tomáš Mráz |
76f329 |
+ return 0;
|
|
Tomáš Mráz |
76f329 |
+ }
|
|
Tomáš Mráz |
76f329 |
+
|
|
Tomáš Mráz |
76f329 |
cipher_crypt(&ciphercontext, cp,
|
|
Tomáš Mráz |
76f329 |
buffer_ptr(&buffer), buffer_len(&buffer));
|
|
Tomáš Mráz |
76f329 |
cipher_cleanup(&ciphercontext);
|
|
Jan F |
003cb0 |
@@ -447,8 +453,13 @@ key_parse_private_rsa1(Buffer *blob, con
|
|
Jan F |
003cb0 |
cp = buffer_append_space(&decrypted, buffer_len(blob));
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
/* Rest of the buffer is encrypted. Decrypt it using the passphrase. */
|
|
Tomáš Mráz |
76f329 |
- cipher_set_key_string(&ciphercontext, cipher, passphrase,
|
|
Tomáš Mráz |
76f329 |
- CIPHER_DECRYPT);
|
|
Tomáš Mráz |
76f329 |
+ if (cipher_set_key_string(&ciphercontext, cipher, passphrase,
|
|
Tomáš Mráz |
76f329 |
+ CIPHER_DECRYPT) < 0) {
|
|
Tomáš Mráz |
76f329 |
+ error("cipher_set_key_string failed.");
|
|
Tomáš Mráz |
76f329 |
+ buffer_free(&decrypted);
|
|
Tomáš Mráz |
76f329 |
+ goto fail;
|
|
Tomáš Mráz |
76f329 |
+ }
|
|
Tomáš Mráz |
76f329 |
+
|
|
Tomáš Mráz |
76f329 |
cipher_crypt(&ciphercontext, cp,
|
|
Jan F |
003cb0 |
buffer_ptr(blob), buffer_len(blob));
|
|
Tomáš Mráz |
76f329 |
cipher_cleanup(&ciphercontext);
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/cipher.c.fips openssh-5.8p1/cipher.c
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/cipher.c.fips 2011-04-01 09:34:05.444648701 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/cipher.c 2011-04-01 09:34:12.184648648 +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>
|
|
Jan F |
af8738 |
@@ -85,6 +86,22 @@ struct Cipher ciphers[] = {
|
|
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
|
|
Jan F |
af8738 |
@@ -127,7 +144,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;
|
|
Jan F |
af8738 |
@@ -137,7 +154,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;
|
|
Jan F |
af8738 |
@@ -181,7 +198,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;
|
|
Jan F |
af8738 |
@@ -288,14 +305,15 @@ cipher_cleanup(CipherContext *cc)
|
|
Tomáš Mráz |
76f329 |
* passphrase and using the resulting 16 bytes as the key.
|
|
Tomáš Mráz |
76f329 |
*/
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
-void
|
|
Tomáš Mráz |
76f329 |
+int
|
|
Tomáš Mráz |
76f329 |
cipher_set_key_string(CipherContext *cc, Cipher *cipher,
|
|
Tomáš Mráz |
76f329 |
const char *passphrase, int do_encrypt)
|
|
Tomáš Mráz |
76f329 |
{
|
|
Tomáš Mráz |
76f329 |
MD5_CTX md;
|
|
Tomáš Mráz |
76f329 |
u_char digest[16];
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
- MD5_Init(&md);
|
|
Tomáš Mráz |
76f329 |
+ if (MD5_Init(&md) <= 0)
|
|
Tomáš Mráz |
76f329 |
+ return -1;
|
|
Tomáš Mráz |
76f329 |
MD5_Update(&md, (const u_char *)passphrase, strlen(passphrase));
|
|
Tomáš Mráz |
76f329 |
MD5_Final(digest, &md);
|
|
Tomáš Mráz |
76f329 |
|
|
Jan F |
af8738 |
@@ -303,6 +321,7 @@ cipher_set_key_string(CipherContext *cc,
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
memset(digest, 0, sizeof(digest));
|
|
Tomáš Mráz |
76f329 |
memset(&md, 0, sizeof(md));
|
|
Tomáš Mráz |
76f329 |
+ return 0;
|
|
Tomáš Mráz |
76f329 |
}
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
/*
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/cipher-ctr.c.fips openssh-5.8p1/cipher-ctr.c
|
|
Jan F |
003cb0 |
--- openssh-5.8p1/cipher-ctr.c.fips 2010-10-07 13:06:42.000000000 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/cipher-ctr.c 2011-04-01 09:34:12.228648747 +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 |
003cb0 |
diff -up openssh-5.8p1/cipher.h.fips openssh-5.8p1/cipher.h
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/cipher.h.fips 2011-04-01 09:34:05.488648661 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/cipher.h 2011-04-01 09:34:12.270648743 +0200
|
|
Jan F |
af8738 |
@@ -87,7 +87,7 @@ void cipher_init(CipherContext *, Ciphe
|
|
Tomáš Mráz |
76f329 |
const u_char *, u_int, int);
|
|
Tomáš Mráz |
76f329 |
void cipher_crypt(CipherContext *, u_char *, const u_char *, u_int);
|
|
Tomáš Mráz |
76f329 |
void cipher_cleanup(CipherContext *);
|
|
Tomáš Mráz |
76f329 |
-void cipher_set_key_string(CipherContext *, Cipher *, const char *, int);
|
|
Tomáš Mráz |
76f329 |
+int cipher_set_key_string(CipherContext *, Cipher *, const char *, int);
|
|
Tomáš Mráz |
76f329 |
u_int cipher_blocksize(const Cipher *);
|
|
Tomáš Mráz |
76f329 |
u_int cipher_keylen(const Cipher *);
|
|
Tomáš Mráz |
76f329 |
u_int cipher_is_cbc(const Cipher *);
|
|
Jan F |
f9ff10 |
diff -up openssh-5.8p1/key.c.fips openssh-5.8p1/key.c
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/key.c.fips 2011-04-01 09:34:07.105648513 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/key.c 2011-04-01 09:34:12.329648473 +0200
|
|
Jan F |
f9ff10 |
@@ -40,6 +40,7 @@
|
|
Jan F |
f9ff10 |
#include <sys/types.h>
|
|
Jan F |
f9ff10 |
|
|
Jan F |
f9ff10 |
#include <openssl/evp.h>
|
|
Jan F |
f9ff10 |
+#include <openssl/fips.h>
|
|
Jan F |
f9ff10 |
#include <openbsd-compat/openssl-compat.h>
|
|
Jan F |
f9ff10 |
|
|
Jan F |
f9ff10 |
#include <stdarg.h>
|
|
Jan F |
48446f |
@@ -602,9 +603,13 @@ key_fingerprint_selection(void)
|
|
Jan F |
48446f |
char *env;
|
|
Jan F |
f9ff10 |
|
|
Jan F |
48446f |
if (!rv_defined) {
|
|
Jan F |
48446f |
- env = getenv("SSH_FINGERPRINT_TYPE");
|
|
Jan F |
48446f |
- rv = (env && !strcmp (env, "sha")) ?
|
|
Jan F |
48446f |
- SSH_FP_SHA1 : SSH_FP_MD5;
|
|
Jan F |
f9ff10 |
+ if (FIPS_mode())
|
|
Jan F |
48446f |
+ rv = SSH_FP_SHA1;
|
|
Jan F |
48446f |
+ else {
|
|
Jan F |
48446f |
+ env = getenv("SSH_FINGERPRINT_TYPE");
|
|
Jan F |
48446f |
+ rv = (env && !strcmp (env, "sha")) ?
|
|
Jan F |
48446f |
+ SSH_FP_SHA1 : SSH_FP_MD5;
|
|
Jan F |
48446f |
+ }
|
|
Jan F |
48446f |
rv_defined = 1;
|
|
Jan F |
f9ff10 |
}
|
|
Jan F |
48446f |
return rv;
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/mac.c.fips openssh-5.8p1/mac.c
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/mac.c.fips 2011-04-01 09:34:06.204648928 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/mac.c 2011-04-01 09:34:12.379648663 +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) {
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/Makefile.in.fips openssh-5.8p1/Makefile.in
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/Makefile.in.fips 2011-04-01 09:34:09.725648593 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/Makefile.in 2011-04-01 09:34:12.422658984 +0200
|
|
Jan F |
8ecc9b |
@@ -146,25 +146,25 @@ libssh.a: $(LIBSSH_OBJS)
|
|
Tomáš Mráz |
0a4fa5 |
$(RANLIB) $@
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
0a4fa5 |
ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
|
|
Jan F |
003cb0 |
- $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS)
|
|
Jan F |
003cb0 |
+ $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(SSHLIBS) $(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)
|
|
Jan F. Chadima |
c54a8b |
+ $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(SSHDLIBS) $(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 |
|
|
Jan F. Chadima |
974c89 |
ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o ssh-pkcs11-client.o
|
|
Jan F. Chadima |
974c89 |
- $(LD) -o $@ ssh-agent.o ssh-pkcs11-client.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Jan F. Chadima |
82bc82 |
+ $(LD) -o $@ ssh-agent.o ssh-pkcs11-client.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 |
|
|
Jan F. Chadima |
974c89 |
ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o readconf.o
|
|
Jan F. Chadima |
c54a8b |
- $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
|
|
Jan F. Chadima |
c54a8b |
+ $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Jan F. Chadima |
974c89 |
ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o
|
|
Jan F. Chadima |
1b8a26 |
$(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
|
|
Jan F |
8ecc9b |
@@ -173,7 +173,7 @@ ssh-ldap-helper$(EXEEXT): $(LIBCOMPAT) l
|
|
Jan F. Chadima |
3fdf10 |
$(LD) -o $@ ldapconf.o ldapbody.o ldapmisc.o ldap-helper.o $(LDFLAGS) -lssh -lopenbsd-compat -lfipscheck $(LIBS)
|
|
Jan F. Chadima |
974c89 |
|
|
Jan F. Chadima |
c54a8b |
ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o
|
|
Jan F. Chadima |
c54a8b |
- $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
|
|
Jan F. Chadima |
c54a8b |
+ $(LD) -o $@ ssh-keyscan.o roaming_dummy.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)
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/myproposal.h.fips openssh-5.8p1/myproposal.h
|
|
Jan F |
003cb0 |
--- openssh-5.8p1/myproposal.h.fips 2011-01-13 12:00:22.000000000 +0100
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/myproposal.h 2011-04-01 09:34:12.583648839 +0200
|
|
Jan F |
003cb0 |
@@ -81,7 +81,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 |
003cb0 |
diff -up openssh-5.8p1/openbsd-compat/bsd-arc4random.c.fips openssh-5.8p1/openbsd-compat/bsd-arc4random.c
|
|
Jan F |
003cb0 |
--- openssh-5.8p1/openbsd-compat/bsd-arc4random.c.fips 2010-03-25 22:52:02.000000000 +0100
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/openbsd-compat/bsd-arc4random.c 2011-04-01 09:36:17.282648749 +0200
|
|
Jan F |
8ecc9b |
@@ -37,25 +37,18 @@
|
|
Jan F |
8ecc9b |
#define REKEY_BYTES (1 << 24)
|
|
Jan F |
8ecc9b |
|
|
Tomáš Mráz |
d93958 |
static int rc4_ready = 0;
|
|
Jan F |
8ecc9b |
-static RC4_KEY rc4;
|
|
Tomáš Mráz |
d93958 |
|
|
Tomáš Mráz |
d93958 |
unsigned int
|
|
Tomáš Mráz |
d93958 |
arc4random(void)
|
|
Tomáš Mráz |
d93958 |
{
|
|
Jan F |
8ecc9b |
unsigned int r = 0;
|
|
Jan F |
8ecc9b |
- static int first_time = 1;
|
|
Tomáš Mráz |
d93958 |
+ void *rp = &r;
|
|
Jan F |
8ecc9b |
|
|
Jan F |
8ecc9b |
- if (rc4_ready <= 0) {
|
|
Jan F |
8ecc9b |
- if (first_time)
|
|
Jan F |
8ecc9b |
- seed_rng();
|
|
Jan F |
8ecc9b |
- first_time = 0;
|
|
Tomáš Mráz |
d93958 |
+ if (!rc4_ready) {
|
|
Jan F |
8ecc9b |
arc4random_stir();
|
|
Jan F |
8ecc9b |
}
|
|
Tomáš Mráz |
d93958 |
+ RAND_bytes(rp, sizeof(r));
|
|
Jan F |
8ecc9b |
|
|
Jan F |
8ecc9b |
- RC4(&rc4, sizeof(r), (unsigned char *)&r, (unsigned char *)&r);
|
|
Jan F |
8ecc9b |
-
|
|
Jan F |
8ecc9b |
- rc4_ready -= sizeof(r);
|
|
Jan F |
8ecc9b |
-
|
|
Jan F |
8ecc9b |
return(r);
|
|
Jan F |
8ecc9b |
}
|
|
Jan F |
8ecc9b |
|
|
Jan F |
8ecc9b |
@@ -63,24 +56,11 @@ void
|
|
Jan F |
8ecc9b |
arc4random_stir(void)
|
|
Jan F |
8ecc9b |
{
|
|
Jan F |
8ecc9b |
unsigned char rand_buf[SEED_SIZE];
|
|
Jan F |
8ecc9b |
- int i;
|
|
Jan F |
8ecc9b |
|
|
Jan F |
8ecc9b |
- memset(&rc4, 0, sizeof(rc4));
|
|
Jan F |
8ecc9b |
if (RAND_bytes(rand_buf, sizeof(rand_buf)) <= 0)
|
|
Jan F |
8ecc9b |
fatal("Couldn't obtain random bytes (error %ld)",
|
|
Jan F |
8ecc9b |
ERR_get_error());
|
|
Jan F |
8ecc9b |
- RC4_set_key(&rc4, sizeof(rand_buf), rand_buf);
|
|
Jan F |
8ecc9b |
-
|
|
Jan F |
8ecc9b |
- /*
|
|
Jan F |
8ecc9b |
- * Discard early keystream, as per recommendations in:
|
|
Jan F |
8ecc9b |
- * http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
|
|
Jan F |
8ecc9b |
- */
|
|
Jan F |
8ecc9b |
- for(i = 0; i <= 256; i += sizeof(rand_buf))
|
|
Jan F |
8ecc9b |
- RC4(&rc4, sizeof(rand_buf), rand_buf, rand_buf);
|
|
Jan F |
8ecc9b |
-
|
|
Jan F |
8ecc9b |
- memset(rand_buf, 0, sizeof(rand_buf));
|
|
Jan F |
8ecc9b |
-
|
|
Jan F |
8ecc9b |
- rc4_ready = REKEY_BYTES;
|
|
Tomáš Mráz |
d93958 |
+ rc4_ready = 1;
|
|
Jan F |
8ecc9b |
}
|
|
Tomáš Mráz |
d93958 |
#endif /* !HAVE_ARC4RANDOM */
|
|
Tomáš Mráz |
d93958 |
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/ssh.c.fips openssh-5.8p1/ssh.c
|
|
Jan F |
003cb0 |
--- openssh-5.8p1/ssh.c.fips 2011-02-04 01:42:15.000000000 +0100
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/ssh.c 2011-04-01 09:34:12.689648154 +0200
|
|
Jan F |
003cb0 |
@@ -73,6 +73,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 |
|
|
Jan F |
003cb0 |
@@ -234,6 +236,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 |
/*
|
|
Jan F |
003cb0 |
@@ -300,6 +306,9 @@ main(int ac, char **av)
|
|
Jan F. Chadima |
974c89 |
"ACD:F:I:KL:MNO:PR:S:TVw:W:XYy")) != -1) {
|
|
Tomáš Mráz |
76f329 |
switch (opt) {
|
|
Tomáš Mráz |
76f329 |
case '1':
|
|
Tomáš Mráz |
76f329 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
76f329 |
+ fatal("Protocol 1 not allowed in the FIPS mode.");
|
|
Tomáš Mráz |
76f329 |
+ }
|
|
Tomáš Mráz |
76f329 |
options.protocol = SSH_PROTO_1;
|
|
Tomáš Mráz |
76f329 |
break;
|
|
Tomáš Mráz |
76f329 |
case '2':
|
|
Jan F |
003cb0 |
@@ -598,7 +607,6 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
if (!host)
|
|
Tomáš Mráz |
0a4fa5 |
usage();
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Jan F |
003cb0 |
- OpenSSL_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. */
|
|
Jan F |
003cb0 |
@@ -684,6 +692,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 |
|
|
Jan F |
003cb0 |
@@ -753,6 +765,12 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
timeout_ms = options.connection_timeout * 1000;
|
|
Tomáš Mráz |
76f329 |
|
|
Tomáš Mráz |
76f329 |
+ if (FIPS_mode()) {
|
|
Tomáš Mráz |
76f329 |
+ options.protocol &= SSH_PROTO_2;
|
|
Tomáš Mráz |
76f329 |
+ if (options.protocol == 0)
|
|
Tomáš Mráz |
76f329 |
+ fatal("Protocol 2 disabled by configuration but required in the FIPS mode.");
|
|
Tomáš Mráz |
76f329 |
+ }
|
|
Tomáš Mráz |
76f329 |
+
|
|
Tomáš Mráz |
76f329 |
/* Open a connection to the remote host. */
|
|
Tomáš Mráz |
76f329 |
if (ssh_connect(host, &hostaddr, options.port,
|
|
Tomáš Mráz |
76f329 |
options.address_family, options.connection_attempts, &timeout_ms,
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/sshconnect2.c.fips openssh-5.8p1/sshconnect2.c
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/sshconnect2.c.fips 2011-04-01 09:34:03.780648205 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/sshconnect2.c 2011-04-01 09:34:12.739648223 +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"
|
|
Jan F |
003cb0 |
@@ -169,6 +171,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]);
|
|
Jan F |
003cb0 |
@@ -184,7 +190,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;
|
|
Jan F |
003cb0 |
diff -up openssh-5.8p1/sshd.c.fips openssh-5.8p1/sshd.c
|
|
Jan F |
8ecc9b |
--- openssh-5.8p1/sshd.c.fips 2011-04-01 09:34:11.218648712 +0200
|
|
Jan F |
8ecc9b |
+++ openssh-5.8p1/sshd.c 2011-04-01 09:34:12.835695243 +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
|
|
Jan F |
8ecc9b |
@@ -1368,6 +1370,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 */
|
|
Jan F |
8ecc9b |
@@ -1529,8 +1537,6 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
0a4fa5 |
else
|
|
Tomáš Mráz |
0a4fa5 |
closefrom(REEXEC_DEVCRYPTO_RESERVED_FD);
|
|
Tomáš Mráz |
0a4fa5 |
|
|
Jan F |
003cb0 |
- OpenSSL_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)
|
|
Jan F |
8ecc9b |
@@ -1649,6 +1655,10 @@ main(int ac, char **av)
|
|
Tomáš Mráz |
76f329 |
debug("private host key: #%d type %d %s", i, key->type,
|
|
Tomáš Mráz |
76f329 |
key_type(key));
|
|
Tomáš Mráz |
76f329 |
}
|
|
Tomáš Mráz |
76f329 |
+ if ((options.protocol & SSH_PROTO_1) && FIPS_mode()) {
|
|
Tomáš Mráz |
76f329 |
+ logit("Disabling protocol version 1. Not allowed in the FIPS mode.");
|
|
Tomáš Mráz |
76f329 |
+ options.protocol &= ~SSH_PROTO_1;
|
|
Tomáš Mráz |
76f329 |
+ }
|
|
Tomáš Mráz |
76f329 |
if ((options.protocol & SSH_PROTO_1) && !sensitive_data.have_ssh1_key) {
|
|
Tomáš Mráz |
76f329 |
logit("Disabling protocol version 1. Could not load host key");
|
|
Tomáš Mráz |
76f329 |
options.protocol &= ~SSH_PROTO_1;
|
|
Jan F |
8ecc9b |
@@ -1813,6 +1823,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("/");
|
|
Jan F |
8ecc9b |
@@ -2355,6 +2369,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]);
|
|
Jan F |
8ecc9b |
@@ -2364,6 +2381,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] =
|