From 9b33e0a4893772bd3689c8403a7754593410469a Mon Sep 17 00:00:00 2001 From: djm <> Date: Wed, 6 Oct 2010 22:57:46 +0000 Subject: 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@ --- src/lib/libcrypto/engine/hw_cryptodev.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/lib/libcrypto/engine/hw_cryptodev.c') diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 03022f2fd3..6ac2f9be30 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c @@ -56,13 +56,13 @@ ENGINE_load_cryptodev(void) #include #include -#include -#include #include +#include #include -#include -#include +#include #include +#include +#include #if defined(__i386__) || defined(__amd64__) #include @@ -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); -- cgit v1.2.3-55-g6feb