Skip to content

Commit 32c140b

Browse files
committed
merge revision(s) 16465:
* ext/openssl/openssl_missing.c (HMAC_CTX_copy): adopted prototype change in openssl bundled with newer OpenBSD. a patch from Takahiro Kambe <taca at back-street.net> in [ruby-dev:34691]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@22873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 4959105 commit 32c140b

File tree

5 files changed

+73
-18
lines changed

5 files changed

+73
-18
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Tue Mar 10 16:05:36 2009 Akinori MUSHA <knu@iDaemons.org>
2+
3+
* ext/openssl/openssl_missing.c (HMAC_CTX_copy): adopted
4+
prototype change in openssl bundled with newer OpenBSD.
5+
a patch from Takahiro Kambe <taca at back-street.net> in
6+
[ruby-dev:34691].
7+
18
Mon Mar 9 20:56:42 2009 Shugo Maeda <shugo@ruby-lang.org>
29

310
* ext/openssl/ossl_ocsp.c (ossl_ocspbres_verify): OCSP_basic_verify

ext/openssl/openssl_missing.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@
2222
#include "openssl_missing.h"
2323

2424
#if !defined(HAVE_HMAC_CTX_COPY)
25-
int
25+
void
2626
HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
2727
{
28-
if (!out || !in) return 0;
28+
if (!out || !in) return;
2929
memcpy(out, in, sizeof(HMAC_CTX));
3030

31-
if (!EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx)
32-
|| !EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx)
33-
|| !EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx))
34-
return 0;
35-
return 1;
31+
EVP_MD_CTX_copy(&out->md_ctx, &in->md_ctx);
32+
EVP_MD_CTX_copy(&out->i_ctx, &in->i_ctx);
33+
EVP_MD_CTX_copy(&out->o_ctx, &in->o_ctx);
3634
}
3735
#endif /* HAVE_HMAC_CTX_COPY */
3836
#endif /* NO_HMAC */

ext/openssl/openssl_missing.h

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,33 @@ typedef char *d2i_of_void();
6060
(char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
6161
#endif
6262

63+
#if !defined(HAVE_EVP_MD_CTX_INIT)
6364
void HMAC_CTX_init(HMAC_CTX *ctx);
64-
int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
65+
#endif
66+
67+
#if !defined(HAVE_HMAC_CTX_COPY)
68+
void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
69+
#endif
70+
71+
#if !defined(HAVE_HMAC_CTX_CLEANUP)
6572
void HMAC_CTX_cleanup(HMAC_CTX *ctx);
73+
#endif
6674

75+
#if !defined(HAVE_EVP_MD_CTX_CREATE)
6776
EVP_MD_CTX *EVP_MD_CTX_create(void);
77+
#endif
78+
79+
#if !defined(HAVE_EVP_MD_CTX_INIT)
6880
void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
81+
#endif
82+
83+
#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
6984
int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
85+
#endif
86+
87+
#if !defined(HAVE_EVP_MD_CTX_DESTROY)
7088
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
89+
#endif
7190

7291
#if !defined(HAVE_EVP_CIPHER_CTX_COPY)
7392
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
@@ -111,19 +130,54 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
111130
#define OPENSSL_cleanse(p, l) memset(p, 0, l)
112131
#endif
113132

133+
#if !defined(HAVE_X509_STORE_SET_EX_DATA)
114134
void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
115135
int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
136+
#endif
137+
138+
#if !defined(HAVE_X509_CRL_SET_VERSION)
116139
int X509_CRL_set_version(X509_CRL *x, long version);
140+
#endif
141+
142+
#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
117143
int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
144+
#endif
145+
146+
#if !defined(HAVE_X509_CRL_SORT)
118147
int X509_CRL_sort(X509_CRL *c);
148+
#endif
149+
150+
#if !defined(HAVE_X509_CRL_ADD0_REVOKED)
119151
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
152+
#endif
153+
154+
#if !defined(HAVE_BN_MOD_SQR)
120155
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
156+
#endif
157+
158+
#if !defined(HAVE_BN_MOD_ADD)
121159
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
160+
#endif
161+
162+
#if !defined(HAVE_BN_MOD_SUB)
122163
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m, BN_CTX *ctx);
164+
#endif
165+
166+
#if !defined(HAVE_BN_RAND_RANGE)
123167
int BN_rand_range(BIGNUM *r, BIGNUM *range);
168+
#endif
169+
170+
#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
124171
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
172+
#endif
173+
174+
#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
125175
char *CONF_get1_default_config_file(void);
176+
#endif
177+
178+
#if !defined(HAVE_PEM_DEF_CALLBACK)
126179
int PEM_def_callback(char *buf, int num, int w, void *key);
180+
#endif
127181

128182
#if defined(__cplusplus)
129183
}

ext/openssl/ossl_hmac.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ ossl_hmac_copy(VALUE self, VALUE other)
8181
GetHMAC(self, ctx1);
8282
SafeGetHMAC(other, ctx2);
8383

84-
if (!HMAC_CTX_copy(ctx1, ctx2)) {
85-
ossl_raise(eHMACError, NULL);
86-
}
84+
HMAC_CTX_copy(ctx1, ctx2);
8785
return self;
8886
}
8987

@@ -104,9 +102,7 @@ hmac_final(HMAC_CTX *ctx, char **buf, int *buf_len)
104102
{
105103
HMAC_CTX final;
106104

107-
if (!HMAC_CTX_copy(&final, ctx)) {
108-
ossl_raise(eHMACError, NULL);
109-
}
105+
HMAC_CTX_copy(&final, ctx);
110106
if (!(*buf = OPENSSL_malloc(HMAC_size(&final)))) {
111107
HMAC_CTX_cleanup(&final);
112108
OSSL_Debug("Allocating %d mem", HMAC_size(&final));

version.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#define RUBY_VERSION "1.8.6"
2-
#define RUBY_RELEASE_DATE "2009-03-09"
2+
#define RUBY_RELEASE_DATE "2009-03-10"
33
#define RUBY_VERSION_CODE 186
4-
#define RUBY_RELEASE_CODE 20090309
5-
#define RUBY_PATCHLEVEL 361
4+
#define RUBY_RELEASE_CODE 20090310
5+
#define RUBY_PATCHLEVEL 362
66

77
#define RUBY_VERSION_MAJOR 1
88
#define RUBY_VERSION_MINOR 8
99
#define RUBY_VERSION_TEENY 6
1010
#define RUBY_RELEASE_YEAR 2009
1111
#define RUBY_RELEASE_MONTH 3
12-
#define RUBY_RELEASE_DAY 9
12+
#define RUBY_RELEASE_DAY 10
1313

1414
#ifdef RUBY_EXTERN
1515
RUBY_EXTERN const char ruby_version[];

0 commit comments

Comments
 (0)