e$B$3$s$K$A$O!#e(B
e$B:G6a!"e(BNetBSD
currente$B$Ge(Bext/openssle$B$,%(%i!<$H$J$k$h$&$K$J$j$^$7$?!#e(B
e$BD>@$N860x$O!“e(BNetBSD
currente$B$G!“e(BOpenSSLe$B$Ne(B0.9.8ge$B$h$j$b?7$7$$!”$H$”$ke(B
snapshote$B$,<h$j9~$^$l$?e(B(e$B2?$G$de(B?)e$B$3$H$K$h$j$^$9!#e(B
ext/openssle$B$G$O!“e(BOpenSSLe$B$K7g$1$F$$$k4X?t$N%A%’%C%/$r9T$$!”$J$$$b$N$K$De(B
e$B$$$F$O!"<+A0$N$b$N$r;H$&$h$&$K$7$F$$$k$h$&$G$9!#$H$3$m$,!"$3$3$G4X?tDje(B
e$B5A$K0c$$$,H/@8$7$F$$$^$7$?!#e(B
Ruby:ext/openssl int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
Newer OpenSSL void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
e$B8e<T$Ne(BHMAC_CTX_copy()e$B$O!"$7$C$+$je(B OpenSSLe$B$Ne(Bhmac.h
e$B$H$$$C$?%X%C%@%U%!%$e(B
e$B%k$G$b@k8@$5$l$F$$$^$9!#e(B
ext/openssl/extconf.rbe$B$G$O!“e(BHMAC_CTX_copy()e$B$,B8:_$9$k$3$H$r8!CN$7$F$$$^e(B
e$B$9$,!“e(Bext/openssl/openssl_missing.he$B$G$N@k8@$OL5>r7o$K9T$C$F$$$k$?$a!”$^e(B
e$B$:$O$3$3$G4X?t@k8@$NIT0lCW$G%(%i!<$H$J$j$^$9!#e(B(e$B$3$NItJ,$K$D$$$F$O!”;}$Ce(B
e$B$F$$$k$HH=CG$7$?>l9g$O!"e(B#ifdef e$B$G@k8@$b$7$J$$$Y$-$G$7$g$&!#e(B)
e$B$3$NItJ,$rDL$7$?$H$7$F$b!“e(Bext/openssl/ossl_hmac.ce$B$NCf$G$O!”$A$c$s$He(B
HMAC_CTX_copy()e$B$NLa$jCM$r%A%’%C%/$7$F$$$^$9$N$G!"$3$NJU$j$bLdBj$H$J$je(B
e$B$^$9!#e(B
HMAC_CTX_copy()e$B$N?7$7$$e(BOpenSSLe$B$N<BAu$G$O!"FbIt$G8F$S=P$7$F$$$ke(B
EVP_MD_CTX_copy()e$B$NLa$jCM$OA4$/%A%’%C%/$7$F$$$J$+$C$?$j$9$kJU$j$O!“e(B
e$B<c43$N5?Ld$r46$8!”$3$NE@$G$O$`$7$me(BRubye$B$Ne(Bext/openssl/openssl_missing.c
e$B$NJ}$,%3!<%IE*$K$O@5$7$$$H;W$$$^$9!#e(B
e$B$$$:$l$K$7$F$b!"?7$7$$e(BOpenSSLe$B$N<BAu$K9g$o$;$k7A$G%Q%C%A$r:n@.$7$F$_$^e(B
e$B$7$?!#e(B
–
e$B?@8Me(B e$BN4Gne(B(e$B$+$s$Ye(B e$B$?$+$R$me(B) at e$B;E;v>le(B
— ext/openssl/openssl_missing.c.orig 2007-02-13 08:01:19.000000000
+0900
+++ ext/openssl/openssl_missing.c
@@ -22,7 +22,7 @@
#include “openssl_missing.h”
#if !defined(HAVE_HMAC_CTX_COPY)
-int
+void
HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in)
{
if (!out || !in) return 0;
— ext/openssl/openssl_missing.h.orig 2007-02-13 08:01:19.000000000
+0900
+++ ext/openssl/openssl_missing.h
@@ -56,14 +56,33 @@ extern “C” {
(char ()())d2i_PKCS7_RECIP_INFO, (char *)ri)
#endif
+#if !defined(HAVE_EVP_MD_CTX_INIT)
void HMAC_CTX_init(HMAC_CTX *ctx);
-int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
+#endif
+
+#if !defined(HAVE_HMAC_CTX_COPY)
+void HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
+#endif
+
+#if !defined(HAVE_HMAC_CTX_CLEANUP)
void HMAC_CTX_cleanup(HMAC_CTX *ctx);
+#endif
+#if !defined(HAVE_EVP_MD_CTX_CREATE)
EVP_MD_CTX *EVP_MD_CTX_create(void);
+#endif
+
+#if !defined(HAVE_EVP_MD_CTX_INIT)
void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
+#endif
+
+#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
+#endif
+
+#if !defined(HAVE_EVP_MD_CTX_DESTROY)
void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
+#endif
#if !defined(HAVE_EVP_CIPHER_CTX_COPY)
int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in);
@@ -107,19 +126,54 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *
#define OPENSSL_cleanse(p, l) memset(p, 0, l)
#endif
+#if !defined(HAVE_X509_STORE_SET_EX_DATA)
void *X509_STORE_get_ex_data(X509_STORE *str, int idx);
int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *data);
+#endif
+
+#if !defined(HAVE_X509_CRL_SET_VERSION)
int X509_CRL_set_version(X509_CRL *x, long version);
+#endif
+
+#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
+#endif
+
+#if !defined(HAVE_X509_CRL_SORT)
int X509_CRL_sort(X509_CRL *c);
+#endif
+
+#if !defined(HAVE_X509_CRL_ADD0_REVOKED)
int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
+#endif
+
+#if !defined(HAVE_BN_MOD_SQR)
int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX
*ctx);
+#endif
+
+#if !defined(HAVE_BN_MOD_ADD)
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const
BIGNUM *m, BN_CTX *ctx);
+#endif
+
+#if !defined(HAVE_BN_MOD_SUB)
int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const
BIGNUM *m, BN_CTX *ctx);
+#endif
+
+#if !defined(HAVE_BN_RAND_RANGE)
int BN_rand_range(BIGNUM *r, BIGNUM *range);
+#endif
+
+#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
int BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range);
+#endif
+
+#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
char *CONF_get1_default_config_file(void);
+#endif
+
+#if !defined(HAVE_PEM_DEF_CALLBACK)
int PEM_def_callback(char *buf, int num, int w, void *key);
+#endif
#if defined(__cplusplus)
}
— ext/openssl/ossl_hmac.c.orig 2007-03-12 13:12:32.000000000 +0900
+++ ext/openssl/ossl_hmac.c
@@ -81,9 +81,7 @@ ossl_hmac_copy(VALUE self, VALUE other)
GetHMAC(self, ctx1);
SafeGetHMAC(other, ctx2);
- if (!HMAC_CTX_copy(ctx1, ctx2)) {
- ossl_raise(eHMACError, NULL);
- }
- HMAC_CTX_copy(ctx1, ctx2);
return self;
}
@@ -104,9 +102,7 @@ hmac_final(HMAC_CTX *ctx, char **buf, in
{
HMAC_CTX final;
- if (!HMAC_CTX_copy(&final, ctx)) {
- ossl_raise(eHMACError, NULL);
- }
- HMAC_CTX_copy(&final, ctx);
if (!(*buf = OPENSSL_malloc(HMAC_size(&final)))) {
HMAC_CTX_cleanup(&final);
OSSL_Debug(“Allocating %d mem”, HMAC_size(&final));