summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2007-05-24 22:07:50 +0000
committerKevin P. Fleming <kpfleming@digium.com>2007-05-24 22:07:50 +0000
commit4573b36af13859cb634585af6786f4585dc9d61f (patch)
treef7d460f19cb2b61dfa1bd6eca49cf1e3afb09fcc /main
parenta3d04ce638c204be6ebcfad1e5bfd01c9dc0f30a (diff)
use the OpenSSL AES implementation if it's available (unless configured not to)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/aescrypt.c8
-rw-r--r--main/aeskey.c8
-rw-r--r--main/aestab.c4
3 files changed, 16 insertions, 4 deletions
diff --git a/main/aescrypt.c b/main/aescrypt.c
index 1ccddf3f5..7b34809bb 100644
--- a/main/aescrypt.c
+++ b/main/aescrypt.c
@@ -42,13 +42,15 @@
* \author Dr Brian Gladman <brg@gladman.me.uk>
*/
-#include "aesopt.h"
-
#if defined(__cplusplus)
extern "C"
{
#endif
+#ifndef HAVE_CRYPTO
+
+#include "aesopt.h"
+
#define si(y,x,k,c) (s(y,c) = word_in(x, c) ^ (k)[c])
#define so(y,x,c) word_out(y, c, s(x,c))
@@ -312,6 +314,8 @@ aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx
#endif
+#endif /* !HAVE_CRYPTO */
+
#if defined(__cplusplus)
}
#endif
diff --git a/main/aeskey.c b/main/aeskey.c
index d34badc6b..cd0c7faf8 100644
--- a/main/aeskey.c
+++ b/main/aeskey.c
@@ -41,13 +41,15 @@
* \author Dr Brian Gladman <brg@gladman.me.uk>
*/
-#include "aesopt.h"
-
#if defined(__cplusplus)
extern "C"
{
#endif
+#ifndef HAVE_CRYPTO
+
+#include "aesopt.h"
+
/* Initialise the key schedule from the user supplied key. The key
length can be specified in bytes, with legal values of 16, 24
and 32, or in bits, with legal values of 128, 192 and 256. These
@@ -464,6 +466,8 @@ aes_rval aes_decrypt_key(const void *in_key, int key_len, aes_decrypt_ctx cx[1])
#endif
+#endif /* !HAVE_CRYPTO */
+
#if defined(__cplusplus)
}
#endif
diff --git a/main/aestab.c b/main/aestab.c
index c84a480af..b134d22d8 100644
--- a/main/aestab.c
+++ b/main/aestab.c
@@ -37,6 +37,8 @@ extern "C"
{
#endif
+#ifndef HAVE_CRYPTO
+
#define DO_TABLES
#include "aesopt.h"
@@ -226,6 +228,8 @@ void gen_tabs(void)
#endif
+#endif /* !HAVE_CRYPTO */
+
#if defined(__cplusplus)
}
#endif