|
|
425c0e4 |
diff -ur ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.c ruby-1.8.6-p287/ext/openssl/openssl_missing.c
|
|
|
425c0e4 |
--- ruby-1.8.6-p287.orig/ext/openssl/openssl_missing.c 2007-02-13 00:01:19.000000000 +0100
|
|
|
425c0e4 |
+++ ruby-1.8.6-p287/ext/openssl/openssl_missing.c 2009-03-15 05:32:31.000000000 +0100
|
|
|
425c0e4 |
@@ -43,7 +43,7 @@
|
|
|
425c0e4 |
{
|
|
|
425c0e4 |
return CRYPTO_set_ex_data(&str->ex_data, idx, data);
|
|
|
425c0e4 |
}
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
+
|
|
|
425c0e4 |
void *X509_STORE_get_ex_data(X509_STORE *str, int idx)
|
|
|
425c0e4 |
{
|
|
|
425c0e4 |
return CRYPTO_get_ex_data(&str->ex_data, idx);
|
|
|
425c0e4 |
@@ -113,7 +113,7 @@
|
|
|
425c0e4 |
#endif
|
|
|
425c0e4 |
|
|
|
425c0e4 |
#if !defined(HAVE_EVP_CIPHER_CTX_COPY)
|
|
|
425c0e4 |
-/*
|
|
|
425c0e4 |
+/*
|
|
|
425c0e4 |
* this function does not exist in OpenSSL yet... or ever?.
|
|
|
425c0e4 |
* a future version may break this function.
|
|
|
425c0e4 |
* tested on 0.9.7d.
|
|
|
425c0e4 |
@@ -182,12 +182,12 @@
|
|
|
425c0e4 |
(ASN1_STRING *)(*a)->serialNumber,
|
|
|
425c0e4 |
(ASN1_STRING *)(*b)->serialNumber));
|
|
|
425c0e4 |
}
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
+
|
|
|
425c0e4 |
int
|
|
|
425c0e4 |
X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
|
|
|
425c0e4 |
{
|
|
|
425c0e4 |
X509_CRL_INFO *inf;
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
+
|
|
|
425c0e4 |
inf = crl->crl;
|
|
|
425c0e4 |
if (!inf->revoked)
|
|
|
425c0e4 |
inf->revoked = sk_X509_REVOKED_new(OSSL_X509_REVOKED_cmp);
|
|
|
425c0e4 |
@@ -233,54 +233,6 @@
|
|
|
425c0e4 |
}
|
|
|
425c0e4 |
#endif
|
|
|
425c0e4 |
|
|
|
425c0e4 |
-#if !defined(HAVE_BN_RAND_RANGE) || !defined(HAVE_BN_PSEUDO_RAND_RANGE)
|
|
|
425c0e4 |
-static int
|
|
|
425c0e4 |
-bn_rand_range(int pseudo, BIGNUM *r, BIGNUM *range)
|
|
|
425c0e4 |
-{
|
|
|
425c0e4 |
- int (*bn_rand)(BIGNUM *, int, int, int) = pseudo ? BN_pseudo_rand : BN_rand;
|
|
|
425c0e4 |
- int n;
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
- if (range->neg || BN_is_zero(range)) return 0;
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
- n = BN_num_bits(range);
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
- if (n == 1) {
|
|
|
425c0e4 |
- if (!BN_zero(r)) return 0;
|
|
|
425c0e4 |
- } else if (!BN_is_bit_set(range, n - 2) && !BN_is_bit_set(range, n - 3)) {
|
|
|
425c0e4 |
- do {
|
|
|
425c0e4 |
- if (!bn_rand(r, n + 1, -1, 0)) return 0;
|
|
|
425c0e4 |
- if (BN_cmp(r ,range) >= 0) {
|
|
|
425c0e4 |
- if (!BN_sub(r, r, range)) return 0;
|
|
|
425c0e4 |
- if (BN_cmp(r, range) >= 0)
|
|
|
425c0e4 |
- if (!BN_sub(r, r, range)) return 0;
|
|
|
425c0e4 |
- }
|
|
|
425c0e4 |
- } while (BN_cmp(r, range) >= 0);
|
|
|
425c0e4 |
- } else {
|
|
|
425c0e4 |
- do {
|
|
|
425c0e4 |
- if (!bn_rand(r, n, -1, 0)) return 0;
|
|
|
425c0e4 |
- } while (BN_cmp(r, range) >= 0);
|
|
|
425c0e4 |
- }
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
- return 1;
|
|
|
425c0e4 |
-}
|
|
|
425c0e4 |
-#endif
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
-#if !defined(HAVE_BN_RAND_RANGE)
|
|
|
425c0e4 |
-int
|
|
|
425c0e4 |
-BN_rand_range(BIGNUM *r, BIGNUM *range)
|
|
|
425c0e4 |
-{
|
|
|
425c0e4 |
- return bn_rand_range(0, r, range);
|
|
|
425c0e4 |
-}
|
|
|
425c0e4 |
-#endif
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
-#if !defined(HAVE_BN_PSEUDO_RAND_RANGE)
|
|
|
425c0e4 |
-int
|
|
|
425c0e4 |
-BN_pseudo_rand_range(BIGNUM *r, BIGNUM *range)
|
|
|
425c0e4 |
-{
|
|
|
425c0e4 |
- return bn_rand_range(1, r, range);
|
|
|
425c0e4 |
-}
|
|
|
425c0e4 |
-#endif
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
#if !defined(HAVE_CONF_GET1_DEFAULT_CONFIG_FILE)
|
|
|
425c0e4 |
#define OPENSSL_CONF "openssl.cnf"
|
|
|
425c0e4 |
char *
|
|
|
425c0e4 |
@@ -315,7 +267,7 @@
|
|
|
425c0e4 |
{
|
|
|
425c0e4 |
int i,j;
|
|
|
425c0e4 |
const char *prompt;
|
|
|
425c0e4 |
-
|
|
|
425c0e4 |
+
|
|
|
425c0e4 |
if (key) {
|
|
|
425c0e4 |
i = strlen(key);
|
|
|
425c0e4 |
i = (i > num) ? num : i;
|