diff options
author | Damien Miller <djm@mindrot.org> | 2010-10-07 13:06:42 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-10-07 13:06:42 +0200 |
commit | 9a3d0dc062e4ebcafdc399ed8522df97066b139e (patch) | |
tree | 2c6283bf3cf257f610e26d3b0aa8ea78553ac50d | |
parent | - (djm) [ssh-agent.c] Fix type for curve name. (diff) | |
download | openssh-9a3d0dc062e4ebcafdc399ed8522df97066b139e.tar.xz openssh-9a3d0dc062e4ebcafdc399ed8522df97066b139e.zip |
- djm@cvs.openbsd.org 2010/10/01 23:05:32
[cipher-3des1.c cipher-bf1.c cipher-ctr.c openbsd-compat/openssl-compat.h]
adapt to API changes in openssl-1.0.0a
NB. contains compat code to select correct API for older OpenSSL
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | cipher-3des1.c | 5 | ||||
-rw-r--r-- | cipher-acss.c | 2 | ||||
-rw-r--r-- | cipher-aes.c | 2 | ||||
-rw-r--r-- | cipher-bf1.c | 8 | ||||
-rw-r--r-- | cipher-ctr.c | 12 | ||||
-rw-r--r-- | openbsd-compat/openssl-compat.h | 9 |
7 files changed, 29 insertions, 14 deletions
@@ -1,4 +1,5 @@ 20101007 + - (djm) [ssh-agent.c] Fix type for curve name. - (djm) OpenBSD CVS Sync - matthew@cvs.openbsd.org 2010/09/24 13:33:00 [misc.c misc.h configure.ac openbsd-compat/openbsd-compat.h] @@ -22,6 +23,10 @@ [servconf.c] prevent free() of string in .rodata when overriding AuthorizedKeys in a Match block; patch from rein AT basefarm.no + - djm@cvs.openbsd.org 2010/10/01 23:05:32 + [cipher-3des1.c cipher-bf1.c cipher-ctr.c openbsd-compat/openssl-compat.h] + adapt to API changes in openssl-1.0.0a + NB. contains compat code to select correct API for older OpenSSL 20100924 - (djm) OpenBSD CVS Sync diff --git a/cipher-3des1.c b/cipher-3des1.c index 17a13a133..b7aa588cd 100644 --- a/cipher-3des1.c +++ b/cipher-3des1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-3des1.c,v 1.6 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: cipher-3des1.c,v 1.7 2010/10/01 23:05:32 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. * @@ -103,7 +103,8 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, } static int -ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) +ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, + LIBCRYPTO_EVP_INL_TYPE len) { struct ssh1_3des_ctx *c; diff --git a/cipher-acss.c b/cipher-acss.c index cb0bf736c..df74b0cb6 100644 --- a/cipher-acss.c +++ b/cipher-acss.c @@ -43,7 +43,7 @@ acss_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, static int acss_ciph(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, - unsigned int inl) + LIBCRYPTO_EVP_INL_TYPE inl) { acss(&data(ctx)->ks,inl,in,out); return 1; diff --git a/cipher-aes.c b/cipher-aes.c index 3ea594969..bfda6d2f2 100644 --- a/cipher-aes.c +++ b/cipher-aes.c @@ -72,7 +72,7 @@ ssh_rijndael_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, static int ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, - u_int len) + LIBCRYPTO_EVP_INL_TYPE len) { struct ssh_rijndael_ctx *c; u_char buf[RIJNDAEL_BLOCKSIZE]; diff --git a/cipher-bf1.c b/cipher-bf1.c index e0e33b4c0..309509dd7 100644 --- a/cipher-bf1.c +++ b/cipher-bf1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-bf1.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: cipher-bf1.c,v 1.6 2010/10/01 23:05:32 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl. All rights reserved. * @@ -76,10 +76,12 @@ static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key, } #endif -static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL; +static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, + const u_char *, LIBCRYPTO_EVP_INL_TYPE) = NULL; static int -bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len) +bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, + LIBCRYPTO_EVP_INL_TYPE len) { int ret; diff --git a/cipher-ctr.c b/cipher-ctr.c index 3b86cc10b..04975b4b6 100644 --- a/cipher-ctr.c +++ b/cipher-ctr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cipher-ctr.c,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */ +/* $OpenBSD: cipher-ctr.c,v 1.11 2010/10/01 23:05:32 djm Exp $ */ /* * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> * @@ -34,7 +34,7 @@ #endif const EVP_CIPHER *evp_aes_128_ctr(void); -void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, u_int); +void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, size_t); struct ssh_aes_ctr_ctx { @@ -48,7 +48,7 @@ struct ssh_aes_ctr_ctx * (LSB at ctr[len-1], MSB at ctr[0]) */ static void -ssh_ctr_inc(u_char *ctr, u_int len) +ssh_ctr_inc(u_char *ctr, size_t len) { int i; @@ -59,10 +59,10 @@ ssh_ctr_inc(u_char *ctr, u_int len) static int ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, - u_int len) + LIBCRYPTO_EVP_INL_TYPE len) { struct ssh_aes_ctr_ctx *c; - u_int n = 0; + size_t n = 0; u_char buf[AES_BLOCK_SIZE]; if (len == 0) @@ -113,7 +113,7 @@ ssh_aes_ctr_cleanup(EVP_CIPHER_CTX *ctx) } void -ssh_aes_ctr_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, u_int len) +ssh_aes_ctr_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, size_t len) { struct ssh_aes_ctr_ctx *c; diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index b7caa650c..beb81f420 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h @@ -1,4 +1,4 @@ -/* $Id: openssl-compat.h,v 1.15 2010/05/12 07:50:02 djm Exp $ */ +/* $Id: openssl-compat.h,v 1.16 2010/10/07 11:06:44 djm Exp $ */ /* * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> @@ -17,6 +17,7 @@ */ #include "includes.h" +#include <openssl/opensslv.h> #include <openssl/evp.h> #include <openssl/rsa.h> #include <openssl/dsa.h> @@ -39,6 +40,12 @@ # define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) #endif +#if OPENSSL_VERSION_NUMBER < 0x1000000fL +# define LIBCRYPTO_EVP_INL_TYPE unsigned int +#else +# define LIBCRYPTO_EVP_INL_TYPE size_t +#endif + #if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES) # define USE_BUILTIN_RIJNDAEL #endif |