diff options
author | Damien Miller <djm@mindrot.org> | 2010-10-07 22:06:42 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-10-07 22:06:42 +1100 |
commit | 9a3d0dc062e4ebcafdc399ed8522df97066b139e (patch) | |
tree | 2c6283bf3cf257f610e26d3b0aa8ea78553ac50d | |
parent | 195dbaff7a2c27b371a126d3b87888ba7a71ef7e (diff) |
- 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 @@ | |||
1 | 20101007 | 1 | 20101007 |
2 | - (djm) [ssh-agent.c] Fix type for curve name. | ||
2 | - (djm) OpenBSD CVS Sync | 3 | - (djm) OpenBSD CVS Sync |
3 | - matthew@cvs.openbsd.org 2010/09/24 13:33:00 | 4 | - matthew@cvs.openbsd.org 2010/09/24 13:33:00 |
4 | [misc.c misc.h configure.ac openbsd-compat/openbsd-compat.h] | 5 | [misc.c misc.h configure.ac openbsd-compat/openbsd-compat.h] |
@@ -22,6 +23,10 @@ | |||
22 | [servconf.c] | 23 | [servconf.c] |
23 | prevent free() of string in .rodata when overriding AuthorizedKeys in | 24 | prevent free() of string in .rodata when overriding AuthorizedKeys in |
24 | a Match block; patch from rein AT basefarm.no | 25 | a Match block; patch from rein AT basefarm.no |
26 | - djm@cvs.openbsd.org 2010/10/01 23:05:32 | ||
27 | [cipher-3des1.c cipher-bf1.c cipher-ctr.c openbsd-compat/openssl-compat.h] | ||
28 | adapt to API changes in openssl-1.0.0a | ||
29 | NB. contains compat code to select correct API for older OpenSSL | ||
25 | 30 | ||
26 | 20100924 | 31 | 20100924 |
27 | - (djm) OpenBSD CVS Sync | 32 | - (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 @@ | |||
1 | /* $OpenBSD: cipher-3des1.c,v 1.6 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: cipher-3des1.c,v 1.7 2010/10/01 23:05:32 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2003 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2003 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -103,7 +103,8 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, | |||
103 | } | 103 | } |
104 | 104 | ||
105 | static int | 105 | static int |
106 | ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) | 106 | ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, |
107 | LIBCRYPTO_EVP_INL_TYPE len) | ||
107 | { | 108 | { |
108 | struct ssh1_3des_ctx *c; | 109 | struct ssh1_3des_ctx *c; |
109 | 110 | ||
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, | |||
43 | 43 | ||
44 | static int | 44 | static int |
45 | acss_ciph(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, | 45 | acss_ciph(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, |
46 | unsigned int inl) | 46 | LIBCRYPTO_EVP_INL_TYPE inl) |
47 | { | 47 | { |
48 | acss(&data(ctx)->ks,inl,in,out); | 48 | acss(&data(ctx)->ks,inl,in,out); |
49 | return 1; | 49 | 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, | |||
72 | 72 | ||
73 | static int | 73 | static int |
74 | ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, | 74 | ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, |
75 | u_int len) | 75 | LIBCRYPTO_EVP_INL_TYPE len) |
76 | { | 76 | { |
77 | struct ssh_rijndael_ctx *c; | 77 | struct ssh_rijndael_ctx *c; |
78 | u_char buf[RIJNDAEL_BLOCKSIZE]; | 78 | 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 @@ | |||
1 | /* $OpenBSD: cipher-bf1.c,v 1.5 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: cipher-bf1.c,v 1.6 2010/10/01 23:05:32 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2003 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2003 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -76,10 +76,12 @@ static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key, | |||
76 | } | 76 | } |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL; | 79 | static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, |
80 | const u_char *, LIBCRYPTO_EVP_INL_TYPE) = NULL; | ||
80 | 81 | ||
81 | static int | 82 | static int |
82 | bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len) | 83 | bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, |
84 | LIBCRYPTO_EVP_INL_TYPE len) | ||
83 | { | 85 | { |
84 | int ret; | 86 | int ret; |
85 | 87 | ||
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 @@ | |||
1 | /* $OpenBSD: cipher-ctr.c,v 1.10 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: cipher-ctr.c,v 1.11 2010/10/01 23:05:32 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> | 3 | * Copyright (c) 2003 Markus Friedl <markus@openbsd.org> |
4 | * | 4 | * |
@@ -34,7 +34,7 @@ | |||
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | const EVP_CIPHER *evp_aes_128_ctr(void); | 36 | const EVP_CIPHER *evp_aes_128_ctr(void); |
37 | void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, u_int); | 37 | void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, size_t); |
38 | 38 | ||
39 | struct ssh_aes_ctr_ctx | 39 | struct ssh_aes_ctr_ctx |
40 | { | 40 | { |
@@ -48,7 +48,7 @@ struct ssh_aes_ctr_ctx | |||
48 | * (LSB at ctr[len-1], MSB at ctr[0]) | 48 | * (LSB at ctr[len-1], MSB at ctr[0]) |
49 | */ | 49 | */ |
50 | static void | 50 | static void |
51 | ssh_ctr_inc(u_char *ctr, u_int len) | 51 | ssh_ctr_inc(u_char *ctr, size_t len) |
52 | { | 52 | { |
53 | int i; | 53 | int i; |
54 | 54 | ||
@@ -59,10 +59,10 @@ ssh_ctr_inc(u_char *ctr, u_int len) | |||
59 | 59 | ||
60 | static int | 60 | static int |
61 | ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, | 61 | ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, |
62 | u_int len) | 62 | LIBCRYPTO_EVP_INL_TYPE len) |
63 | { | 63 | { |
64 | struct ssh_aes_ctr_ctx *c; | 64 | struct ssh_aes_ctr_ctx *c; |
65 | u_int n = 0; | 65 | size_t n = 0; |
66 | u_char buf[AES_BLOCK_SIZE]; | 66 | u_char buf[AES_BLOCK_SIZE]; |
67 | 67 | ||
68 | if (len == 0) | 68 | if (len == 0) |
@@ -113,7 +113,7 @@ ssh_aes_ctr_cleanup(EVP_CIPHER_CTX *ctx) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | void | 115 | void |
116 | ssh_aes_ctr_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, u_int len) | 116 | ssh_aes_ctr_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, size_t len) |
117 | { | 117 | { |
118 | struct ssh_aes_ctr_ctx *c; | 118 | struct ssh_aes_ctr_ctx *c; |
119 | 119 | ||
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 @@ | |||
1 | /* $Id: openssl-compat.h,v 1.15 2010/05/12 07:50:02 djm Exp $ */ | 1 | /* $Id: openssl-compat.h,v 1.16 2010/10/07 11:06:44 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> | 4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> |
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | #include <openssl/opensslv.h> | ||
20 | #include <openssl/evp.h> | 21 | #include <openssl/evp.h> |
21 | #include <openssl/rsa.h> | 22 | #include <openssl/rsa.h> |
22 | #include <openssl/dsa.h> | 23 | #include <openssl/dsa.h> |
@@ -39,6 +40,12 @@ | |||
39 | # define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) | 40 | # define EVP_CIPHER_CTX_get_app_data(e) ((e)->app_data) |
40 | #endif | 41 | #endif |
41 | 42 | ||
43 | #if OPENSSL_VERSION_NUMBER < 0x1000000fL | ||
44 | # define LIBCRYPTO_EVP_INL_TYPE unsigned int | ||
45 | #else | ||
46 | # define LIBCRYPTO_EVP_INL_TYPE size_t | ||
47 | #endif | ||
48 | |||
42 | #if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES) | 49 | #if (OPENSSL_VERSION_NUMBER < 0x00907000L) || defined(OPENSSL_LOBOTOMISED_AES) |
43 | # define USE_BUILTIN_RIJNDAEL | 50 | # define USE_BUILTIN_RIJNDAEL |
44 | #endif | 51 | #endif |