summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-10-06 22:57:46 +0000
committerdjm <djm@openbsd.org>2010-10-06 22:57:46 +0000
commit3e8f98598f0cd4f2742253e449c699b509ce02f9 (patch)
tree743134cc6a39c5f71a76ffafa2e1467e2e9a41bd /lib/libssl/src
parentRetire Skipjack (diff)
downloadwireguard-openbsd-3e8f98598f0cd4f2742253e449c699b509ce02f9.tar.xz
wireguard-openbsd-3e8f98598f0cd4f2742253e449c699b509ce02f9.zip
More OpenSSL fixes:
- Update local engines for the EVP API change (len u_int => size_t) - Use hw_cryptodev.c instead of eng_cryptodev.c - Make x86_64-xlate.pl always write to the output file and not stdout, fixing "make -j" builds (spotted by naddy@) ok naddy@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/engine/eng_aesni.c8
-rw-r--r--lib/libssl/src/crypto/engine/hw_cryptodev.c16
-rwxr-xr-xlib/libssl/src/crypto/perlasm/x86_64-xlate.pl2
3 files changed, 14 insertions, 12 deletions
diff --git a/lib/libssl/src/crypto/engine/eng_aesni.c b/lib/libssl/src/crypto/engine/eng_aesni.c
index eeded1eefa7..5fdb33bfded 100644
--- a/lib/libssl/src/crypto/engine/eng_aesni.c
+++ b/lib/libssl/src/crypto/engine/eng_aesni.c
@@ -438,20 +438,20 @@ aesni_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *user_key,
}
static int aesni_cipher_ecb(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{ AES_KEY *key = AESNI_ALIGN(ctx->cipher_data);
aesni_ecb_encrypt(in, out, inl, key, ctx->encrypt);
return 1;
}
static int aesni_cipher_cbc(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{ AES_KEY *key = AESNI_ALIGN(ctx->cipher_data);
aesni_cbc_encrypt(in, out, inl, key,
ctx->iv, ctx->encrypt);
return 1;
}
static int aesni_cipher_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{ AES_KEY *key = AESNI_ALIGN(ctx->cipher_data);
aesni_cfb128_encrypt(in, out, inl, key, ctx->iv,
@@ -459,7 +459,7 @@ static int aesni_cipher_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out,
return 1;
}
static int aesni_cipher_ofb(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{ AES_KEY *key = AESNI_ALIGN(ctx->cipher_data);
aesni_ofb128_encrypt(in, out, inl, key, ctx->iv, &ctx->num);
return 1;
diff --git a/lib/libssl/src/crypto/engine/hw_cryptodev.c b/lib/libssl/src/crypto/engine/hw_cryptodev.c
index 03022f2fd39..6ac2f9be300 100644
--- a/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -56,13 +56,13 @@ ENGINE_load_cryptodev(void)
#include <sys/ioctl.h>
#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
#include <fcntl.h>
+#include <limits.h>
#include <stdarg.h>
-#include <syslog.h>
-#include <errno.h>
+#include <stdio.h>
#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
#if defined(__i386__) || defined(__amd64__)
#include <sys/sysctl.h>
@@ -97,7 +97,7 @@ static int get_cryptodev_ciphers(const int **cnids);
static int cryptodev_usable_ciphers(const int **nids);
static int cryptodev_usable_digests(const int **nids);
static int cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl);
+ const unsigned char *in, size_t inl);
static int cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc);
static int cryptodev_cleanup(EVP_CIPHER_CTX *ctx);
@@ -381,7 +381,7 @@ cryptodev_usable_digests(const int **nids)
static int
cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{
struct crypt_op cryp;
struct dev_crypto_state *state = ctx->cipher_data;
@@ -644,7 +644,7 @@ viac3_xcrypt_cbc(int *cw, const void *src, void *dst, void *key, int rep,
static int
xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{
unsigned char *save_iv_store[EVP_MAX_IV_LENGTH + 15];
unsigned char *save_iv = DOALIGN(save_iv_store);
@@ -659,6 +659,8 @@ xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
return (1);
if ((inl % ctx->cipher->block_size) != 0)
return (0);
+ if (inl > UINT_MAX)
+ return (0);
if (ISUNALIGNED(in) || ISUNALIGNED(out)) {
spare = malloc(inl);
diff --git a/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl b/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl
index 8153a92a7ba..d66ad240959 100755
--- a/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl
+++ b/lib/libssl/src/crypto/perlasm/x86_64-xlate.pl
@@ -66,7 +66,7 @@ if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
my ($outdev,$outino,@junk)=stat($output);
open STDOUT,">$output" || die "can't open $output: $!"
- if ($stddev!=$outdev || $stdino!=$outino);
+ if (1 || $stddev!=$outdev || $stdino!=$outino);
}
my $gas=1; $gas=0 if ($output =~ /\.asm$/);