diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2010-10-06 22:57:47 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2010-10-06 22:57:47 +0000 |
commit | c887d013e5cd3d01391a679b9c9e0f01a54028a3 (patch) | |
tree | 990af46ff8b1daee5f369b3dfbbb8e0ede738da6 /lib/libssl | |
parent | 17b1c63ba51e1c8f58ef89ffe4953e3a7a8144ed (diff) |
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')
-rw-r--r-- | lib/libssl/crypto/Makefile | 4 | ||||
-rw-r--r-- | lib/libssl/src/crypto/engine/eng_aesni.c | 8 | ||||
-rw-r--r-- | lib/libssl/src/crypto/engine/hw_cryptodev.c | 16 | ||||
-rwxr-xr-x | lib/libssl/src/crypto/perlasm/x86_64-xlate.pl | 2 |
4 files changed, 16 insertions, 14 deletions
diff --git a/lib/libssl/crypto/Makefile b/lib/libssl/crypto/Makefile index 93657a0bb8a..dfcfffe193c 100644 --- a/lib/libssl/crypto/Makefile +++ b/lib/libssl/crypto/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.56 2010/10/04 19:15:40 naddy Exp $ +# $OpenBSD: Makefile,v 1.57 2010/10/06 22:57:46 djm Exp $ LIB= crypto WANTLINT= @@ -150,7 +150,7 @@ SRCS+= eng_err.c eng_lib.c eng_list.c eng_init.c eng_ctrl.c SRCS+= eng_table.c eng_pkey.c eng_fat.c eng_all.c SRCS+= tb_rsa.c tb_dsa.c tb_ecdsa.c tb_dh.c tb_ecdh.c tb_rand.c tb_store.c SRCS+= tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c -SRCS+= eng_openssl.c eng_cnf.c eng_dyn.c eng_cryptodev.c +SRCS+= eng_openssl.c eng_cnf.c eng_dyn.c hw_cryptodev.c SRCS+= eng_aesni.c # local addition # err/ 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$/); |