]> andersk Git - openssh.git/commitdiff
- (dtucker) [cipher-aes.c cipher-ctr.c cipher.c configure.ac
authordtucker <dtucker>
Mon, 19 Dec 2005 06:40:40 +0000 (06:40 +0000)
committerdtucker <dtucker>
Mon, 19 Dec 2005 06:40:40 +0000 (06:40 +0000)
   openbsd-compat/openssl-compat.h] Check for and work around broken AES
   ciphers >128bit on (some) Solaris 10 systems.  ok djm@

ChangeLog
cipher-aes.c
cipher-ctr.c
cipher.c
configure.ac
openbsd-compat/openssl-compat.h

index 248a61831f0280868e09d35685bca0308ff4104c..f9db6ddb75dd9065e8c261b9ebb16e1fdb912718 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20051219
+ - (dtucker) [cipher-aes.c cipher-ctr.c cipher.c configure.ac
+   openbsd-compat/openssl-compat.h] Check for and work around broken AES
+   ciphers >128bit on (some) Solaris 10 systems.  ok djm@
+
 20051217
  - (dtucker) [defines.h] HP-UX system headers define "YES" and "NO" which
    scp.c also uses, so undef them here.
index 22d500d4290ab47cdd48bab52fde278d8dc8005c..228ddb1044174990ce80e9b2f97aee4ef1134ee0 100644 (file)
  */
 
 #include "includes.h"
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
+
+/* compatibility with old or broken OpenSSL versions */
+#include "openbsd-compat/openssl-compat.h"
+
+#ifdef USE_BUILTIN_RIJNDAEL
 RCSID("$OpenBSD: cipher-aes.c,v 1.2 2003/11/26 21:44:29 djm Exp $");
 
 #include <openssl/evp.h>
@@ -31,10 +35,6 @@ RCSID("$OpenBSD: cipher-aes.c,v 1.2 2003/11/26 21:44:29 djm Exp $");
 #include "xmalloc.h"
 #include "log.h"
 
-#if OPENSSL_VERSION_NUMBER < 0x00906000L
-#define SSH_OLD_EVP
-#endif
-
 #define RIJNDAEL_BLOCKSIZE 16
 struct ssh_rijndael_ctx
 {
@@ -157,4 +157,4 @@ evp_rijndael(void)
 #endif
        return (&rijndal_cbc);
 }
-#endif /* OPENSSL_VERSION_NUMBER */
+#endif /* USE_BUILTIN_RIJNDAEL */
index 856177349d1757dd20ec6113517fa80fb2001a7b..8a98f3c42559148a188ba813fe525098826f9e3d 100644 (file)
@@ -21,11 +21,10 @@ RCSID("$OpenBSD: cipher-ctr.c,v 1.6 2005/07/17 07:17:55 djm Exp $");
 #include "log.h"
 #include "xmalloc.h"
 
-#if OPENSSL_VERSION_NUMBER < 0x00906000L
-#define SSH_OLD_EVP
-#endif
+/* compatibility with old or broken OpenSSL versions */
+#include "openbsd-compat/openssl-compat.h"
 
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
+#ifdef USE_BUILTIN_RIJNDAEL
 #include "rijndael.h"
 #define AES_KEY rijndael_ctx
 #define AES_BLOCK_SIZE 16
index 0dddf270af90186fca423bd3f953afe7ba0b4f3c..1434d5524029a7743f93319c384c3f6c6c426961 100644 (file)
--- a/cipher.c
+++ b/cipher.c
@@ -334,7 +334,7 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
                if ((u_int)evplen != len)
                        fatal("%s: wrong iv length %d != %d", __func__,
                            evplen, len);
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
+#ifdef USE_BUILTIN_RIJNDAEL
                if (c->evptype == evp_rijndael)
                        ssh_rijndael_iv(&cc->evp, 0, iv, len);
                else
@@ -365,7 +365,7 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
                evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
                if (evplen == 0)
                        return;
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
+#ifdef USE_BUILTIN_RIJNDAEL
                if (c->evptype == evp_rijndael)
                        ssh_rijndael_iv(&cc->evp, 1, iv, evplen);
                else
index 7e4c2e04de202469100719003d0e898c0173a85e..9cd5344fc58dc1a847ee74081005eee0dd1c0395 100644 (file)
@@ -1803,6 +1803,24 @@ Also see contrib/findssl.sh for help identifying header/library mismatches.])
        ]
 )
 
+# Check for OpenSSL without EVP_aes_{192,256}_cbc
+AC_MSG_CHECKING([whether OpenSSL has crippled AES support])
+AC_COMPILE_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <string.h>
+#include <openssl/evp.h>
+int main(void) { exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL)}
+       ]])],
+       [
+               AC_MSG_RESULT(no)
+       ],
+       [
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(OPENSSL_LOBOTOMISED_AES, 1,
+                   [libcrypto is missing AES 192 and 256 bit functions])
+       ]
+)
+
 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
 # because the system crypt() is more featureful.
 if test "x$check_for_libcrypt_before" = "x1"; then
index c7380fc723cb47b525efe83ae74bc771b3e5bbb6..09e2e7ebfbfe6174aebef04425f4cbb5a8c2424f 100644 (file)
 # define EVP_CIPHER_CTX_get_app_data(e)                ((e)->app_data)
 #endif
 
-#if OPENSSL_VERSION_NUMBER < 0x00907000L
+#if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES)
+# define USE_BUILTIN_RIJNDAEL
+#endif
+
+#ifdef USE_BUILTIN_RIJNDAEL
 # define EVP_aes_128_cbc evp_rijndael
 # define EVP_aes_192_cbc evp_rijndael
 # define EVP_aes_256_cbc evp_rijndael
This page took 0.056951 seconds and 5 git commands to generate.