[#74825] Millisecond in time. — place4oracle@... (Warren)

Hi,

17 messages 2003/07/01
[#74827] Re: Millisecond in time. — Harry Ohlsen <harryo@...> 2003/07/01

Warren wrote:

[#74841] Re: Millisecond in time. — Anders Borch <spam@...> 2003/07/01

Harry Ohlsen wrote:

[#74853] Aeditor-0.1 is unleashed — "Simon Strandgaard" <0bz63fz3m1qt3001@...>

Aeditor is a editor-widget written in Ruby. The primary

17 messages 2003/07/01

[#74884] Speaking of I18N... — "Hal E. Fulton" <hal9000@...>

I don't suppose anyone has implemented any

17 messages 2003/07/01

[#74894] rb_gc() and scan stack — "Simon Strandgaard" <0bz63fz3m1qt3001@...>

I were experimenting with Init_stack, when I discovered a flaw in my mind.

12 messages 2003/07/01

[#74912] Ruby9i now available — Jim Cain <list@...>

All,

18 messages 2003/07/02

[#74980] OT: It's that time of year again ... — james_b <james_b@...>

Happy Birthmonth to all fellow Rubyists born in July!

19 messages 2003/07/02

[#75023] A Quick Guide to SQLite and Ruby — why the lucky stiff <ruby-talk@...>

-Talkers:

17 messages 2003/07/02

[#75119] purpose of replace method — Ian Macdonald <ian@...>

Hi,

17 messages 2003/07/04

[#75137] How to create Shell Links on Windows? — Timon Christl <me@...>

Is there an easy way to create or modify shell links (.lnk) with ruby on

12 messages 2003/07/04

[#75160] seeking feedback on my first Ruby program — "Joe Cheng" <code@...>

I just took my first stab at writing a useful Ruby program. My programming

11 messages 2003/07/04

[#75307] Need regex to match "^\n" — Jim Freeze <jim@...>

Hi:

16 messages 2003/07/06

[#75369] Code Snippet: Array.shuffle — Stefan Arentz <stefan.arentz@...>

14 messages 2003/07/08

[#75420] My brief and torrid affair with Ruby. — Ray Cote <rgacote@...>

Hi List:

150 messages 2003/07/08
[#75421] Re: My brief and torrid affair with Ruby. — Daniel Carrera <dcarrera@...> 2003/07/09

-----BEGIN PGP SIGNED MESSAGE-----

[#75425] Re: My brief and torrid affair with Ruby. — Ray Cote <rgacote@...> 2003/07/09

At 9:08 AM +0900 7/9/03, Daniel Carrera wrote:

[#75426] Re: My brief and torrid affair with Ruby. — Daniel Carrera <dcarrera@...> 2003/07/09

-----BEGIN PGP SIGNED MESSAGE-----

[#75433] Re: My brief and torrid affair with Ruby. — Stephyn Butcher <tendzin.dorje@...> 2003/07/09

They don't call GPL a legal virus for nothing:

[#75527] Re: My brief and torrid affair with Ruby. — "Hal E. Fulton" <hal9000@...> 2003/07/09

----- Original Message -----

[#75529] Re: My brief and torrid affair with Ruby. — Daniel Carrera <dcarrera@...> 2003/07/09

-----BEGIN PGP SIGNED MESSAGE-----

[#75548] OT: GPL - was Re: My brief and torrid affair with Ruby. — "Hal E. Fulton" <hal9000@...> 2003/07/09

> > Are you honestly saying that you don't understand

[#75565] Re: OT: GPL - was Re: My brief and torrid affair with Ruby. — Chalmers <feldt@...> 2003/07/09

Sorry for this long post and rambling. Just skip if you're not in

[#75588] Re: OT: GPL - was Re: My brief and torrid affair with Ruby. — Austin Ziegler <austin@...> 2003/07/10

-----BEGIN PGP SIGNED MESSAGE-----

[#75610] Re: OT: GPL - was Re: My brief and torrid affair with Ruby. — Robert Feldt <feldt@...> 2003/07/10

Austin Ziegler <austin@halostatue.ca> skrev den Thu, 10 Jul 2003 10:10:03

[#75530] Re: My brief and torrid affair with Ruby. — "Michael Campbell" <michael_s_campbell@...> 2003/07/09

[#75531] Re: My brief and torrid affair with Ruby. — Daniel Carrera <dcarrera@...> 2003/07/09

-----BEGIN PGP SIGNED MESSAGE-----

[#75711] Re: My brief and torrid affair with Ruby. — "Sean O'Dell" <sean@...> 2003/07/11

"Daniel Carrera" <dcarrera@math.umd.edu> wrote in message

[#75712] Re: My brief and torrid affair with Ruby. — Daniel Carrera <dcarrera@...> 2003/07/11

-----BEGIN PGP SIGNED MESSAGE-----

[#75536] Re: My brief and torrid affair with Ruby. — "Hal E. Fulton" <hal9000@...> 2003/07/09

----- Original Message -----

[#75539] Re: My brief and torrid affair with Ruby. — "Gennady" <gfb@...> 2003/07/09

OK, Daniel, let's put it this way: if you do not use something there's

[#75438] NASA using Ruby? — Harry Ohlsen <harryo@...>

I noticed a reference in the intro blurb for Dave Thomas's talk at OSCON to NASA doing numerical simulations using Ruby.

24 messages 2003/07/09

[#75570] Ruby T-Shirt Idea — shout@... (Austin King)

Keywords: advocacy, silly t-shirts, Request For Feedback

43 messages 2003/07/09

[#75654] Re: Ruby T-Shirt Idea — "Orion Hunter" <orion2480@...>

What we need is a code snippet that is excessively long and obfuscate in

31 messages 2003/07/10

[#75767] Getting my IP address — Philip Mak <pmak@...>

Is there a piece of Ruby code somewhere that will tell me what my IP

13 messages 2003/07/11

[#75777] Re: OSCON report — "Volkmann, Mark" <Mark.Volkmann@...>

> -----Original Message-----

19 messages 2003/07/11
[#75810] Re: OSCON report — matz@... (Yukihiro Matsumoto) 2003/07/11

Hi,

[#75811] Re: OSCON report — Matt Lawrence <matt@...> 2003/07/11

On Sat, 12 Jul 2003, Yukihiro Matsumoto wrote:

[#75852] ruby-mysql library load error — eric.anderson@... (Eric Anderson)

I am trying to get the ruby dbi library up and running on my machine.

10 messages 2003/07/12

[#75963] Custom method_missing doesn't trap super call — Richard Dale <Richard_Dale@...>

When I run the code below it produces the following output:

26 messages 2003/07/14

[#75975] Booleans — "Mark J. Reed" <markjreed@...>

Okay, as a convert from Perl to Ruby, I have to say that I love

14 messages 2003/07/14

[#75991] ruby-specific CGI question (I think) — "Kurt M. Dresner" <kdresner@...>

I'm using sessions and forms in my cgi script.

15 messages 2003/07/14

[#76058] How to reduce Ruby runtime error? — Xiangrong Fang <xrfang@...>

Hi my friends,

17 messages 2003/07/15

[#76121] Keyword "with" — "Robert Klemme" <bob.news@...>

66 messages 2003/07/16
[#76134] Re: Keyword "with" — "Robert Klemme" <bob.news@...> 2003/07/16

[#76143] Re: Keyword "with" — Peter Hickman <peter@...> 2003/07/16

Robert Klemme wrote:

[#76148] Other languages' features in Ruby — Ben Giddings <ben@...> 2003/07/16

Hrm, well I'm a Ruby/Java/C/C++/Python/Perl/Lisp/Javascript/PHP...

[#76149] Re: Keyword "with" — "Mark J. Reed" <markjreed@...> 2003/07/16

Peter (having a bad day) Hickman wrote:

[#76181] Re: Keyword "with" — Mark Wilson <mwilson13@...> 2003/07/16

[#76184] Re: Keyword "with" — "Michael Campbell" <michael_s_campbell@...> 2003/07/16

[#76293] Re: Keyword "with" — "Hal E. Fulton" <hal9000@...> 2003/07/17

----- Original Message -----

[#76145] Advocacy: Ruby on/with .net — "Thomas Sondergaard" <thomass@...>

I'd like a minute or two of your time as I try to sell you the idea of ruby

34 messages 2003/07/16

[#76196] OO Design question for Net::HTTP caching extension — Aredridel <aredridel@...>

I'm in the process of writing an HTTP-1.1 extension to Net::HTTP. At

10 messages 2003/07/16

[#76254] What's the point? — Jim Freeze <jim@...>

Hi

19 messages 2003/07/17

[#76336] Aliased setter methods behave differently than other methods? — Jim Cain <list@...>

Here's another question... I am aliasing and redefining certain methods,

11 messages 2003/07/18

[#76372] Binary counter — ptkwt@...1.aracnet.com (Phil Tomson)

I needed to test a class which had a certain number of 'binary' inputs (ie. each input

14 messages 2003/07/18

[#76396] chaining comparisons — "Kurt M. Dresner" <kdresner@...>

When I learned python I was overjoyed that I could evaluate 1 < 2 < 3

36 messages 2003/07/19

[#76424] Proposal: Array#to_h, to simplify hash generation — Gavin Sinclair <gsinclair@...>

Hi -talk,

41 messages 2003/07/19
[#76512] Re: Proposal: Array#to_h, to simplify hash generation — Martin DeMello <martindemello@...> 2003/07/20

Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#76513] Re: Proposal: Array#to_h, to simplify hash generation — dblack@... 2003/07/20

Hi --

[#76530] Re: Proposal: Array#to_h, to simplify hash generation — Martin DeMello <martindemello@...> 2003/07/21

dblack@superlink.net wrote:

[#76532] Re: Proposal: Array#to_h, to simplify hash generation — "Gavin Sinclair" <gsinclair@...> 2003/07/21

>

[#76540] Re: Proposal: Array#to_h, to simplify hash generation — dblack@... 2003/07/21

Hi --

[#76473] ruby documentation generator? — "Kurt M. Dresner" <kdresner@...>

I've been googling for a few minutes but I haven't found anything yet.

12 messages 2003/07/20

[#76497] Parsing POST and GET variables simultaneously? — David Heinemeier Hansson <david@...>

Isn't it possible to get variables from POST and GET simultaneously?

13 messages 2003/07/20

[#76499] From Windows internal format to UTF-8? — "renoX" <renZYX@...>

Hello,

13 messages 2003/07/20

[#76551] matz thoughts on Rite ? — "Simon Strandgaard" <0bz63fz3m1qt3001@...>

I don't know much about Rite, therefore I ask.

30 messages 2003/07/21

[#76563] Deep copy — Jim Freeze <jim@...>

Hi

15 messages 2003/07/21

[#76619] Should String#strip take a parameter? — "Warren Brown" <wkb@...>

All,

18 messages 2003/07/21

[#76625] RubyForge.org — Richard Kilmer <rich@...>

All,

37 messages 2003/07/22
[#76831] Re: [ANN] RubyForge.org — "Simon Strandgaard" <0bz63fz3m1qt3001@...> 2003/07/23

On Tue, 22 Jul 2003 12:43:41 +0200, Oliver Bolzer wrote:

[#76693] Bug report: ruby-1.8.0p3 fails to compile under FreeBSD-4.7 — Brian Candler <B.Candler@...>

gcc -fPIC -g -O2 -DDB_DBM_HSEARCH -DDBM_HDR="<db.h>" -I. -I/u/home/telinco/build/ruby/ruby-1.8.0 -I/u/home/telinco/build/ruby/ruby-1.8.0 -I/u/home/telinco/build/ruby/ruby-1.8.0/ext/dbm -DHAVE_DB_H -DHAVE_SYS_CDEFS_H -DHAVE___DB_NDBM_OPEN -DHAVE___DB_NDBM_CLEARERR -c dbm.c

10 messages 2003/07/22

[#76697] String substitution without RegEx — Andreas Schwarz <usenet@...>

I wanted to do a simple string substitution, and was surprised to see

20 messages 2003/07/22

[#76751] New RDoc template, and a question — Dave Thomas <dave@...>

Michael Granger has produced a wonderful new RDoc template, which looks

37 messages 2003/07/23

[#76783] Embedding problem - SEGV — Brian Candler <B.Candler@...>

I have a problem with embedding Ruby, which hopefully someone can shed some

16 messages 2003/07/23

[#76843] Re: [OT] subversion, was [ANN] RubyForge.org — "Bennett, Patrick" <Patrick.Bennett@...>

Hmm, the linuxworld article didn't really say anything useful about

12 messages 2003/07/23

[#76892] ruby 1.8.0 preview4 — matz@... (Yukihiro Matsumoto)

Hello,

44 messages 2003/07/24

[#76984] Patches to 1.8.0p4 to add Bessel functions for those that have 'em — Mike Hall <mghall@...>

Here's some simple patches to configure.in, configure and math.c

23 messages 2003/07/25
[#77006] Re: Patches to 1.8.0p4 to add Bessel functions for those that have 'em — matz@... (Yukihiro Matsumoto) 2003/07/25

Hi,

[#76991] Confused about locking a file via file.flock(File::LOCK_EX) — Ludwigi Beethoven <aix_tech@...>

I am writing a ruby appl under AIX where I need to

11 messages 2003/07/25

[#77082] Set doesn't have [] instance method — Gavin Sinclair <gsinclair@...>

It should, shouldn't it? It's meant to combine the fast lookup of

15 messages 2003/07/26

[#77087] What's wrong with ruby garden? — "Carl Youngblood" <carl@...>

It seems that Ruby Garden is down right now. Does anyone know what's

10 messages 2003/07/26

[#77129] Ruby in Ruby — Austin Ziegler <austin@...>

Over on the pragprog list, Ron Jeffries suggested that it might be

15 messages 2003/07/28

[#77144] ruby 1.8.0 preview5 — matz@... (Yukihiro Matsumoto)

Hello,

16 messages 2003/07/28

[#77149] winsock problem? — Xiangrong Fang <xrfang@...>

Hi,

14 messages 2003/07/28

[#77176] Fishing for ideas: Ruby-talk for Java coders — Armin Roehrl <armin@...>

Hi all,

19 messages 2003/07/28

[#77197] Parser generator — "Rodrigo B. de Oliveira" <rodrigob@...>

I'm evaluating language/frameworks for creating a toy language compiler =

13 messages 2003/07/29

[#77227] Warnings? — Tim Bates <tim@...>

Hi all,

15 messages 2003/07/29
[#77242] Re: Warnings? — matz@... (Yukihiro Matsumoto) 2003/07/29

Hi,

[#77354] Ruby could be wildly more popular if it had ... — quixoticsycophant@... (Jeff Mitchell)

Brackets.

40 messages 2003/07/30
[#77694] Re: Ruby could be wildly more popular if it had ... — Martin DeMello <martindemello@...> 2003/08/01

Chris Thomas <chris@m-audio.com> wrote:

[#77359] Hm... nice, Euclid is a one-liner — Rudolf Polzer <denshimeiru-sapmctacher@...>

a, b = b, a % b while b != 0

12 messages 2003/07/30

[#77408] Bignum multiplication — Harry Ohlsen <harryo@...>

I was just reading about Python 2.3 and they talked about how they've changed their arbitrary-precision integer multiplication to use the Karatsuba multiplication algorithm.

21 messages 2003/07/30

[#77516] wanted: official mirrors for 1.8.0 — matz@... (Yukihiro Matsumoto)

Hello,

24 messages 2003/07/31

[#77528] ruby 1.8.0 preview6 — matz@... (Yukihiro Matsumoto)

Hello,

14 messages 2003/07/31

[#77590] Spam at ruby-talk — Daniel Carrera <dcarrera@...>

I don't know who runs the ruby-talk mailing list. I've noticed that

13 messages 2003/07/31
[#77595] Re: Spam at ruby-talk — Dave Thomas <dave@...> 2003/07/31

Daniel Carrera wrote:

[#77592] Changing ==,>,<, etc — elbows@... (Nathan Weston)

The latest Perl exegesis

15 messages 2003/07/31

[#77623] Extracting a parent class — Michael Garriss <mgarriss@...>

Sorry about the newbie question but....

14 messages 2003/07/31

[Ann] OSSL 0.2.0-pre3

From: Michal Rokos <rokos@...>
Date: 2003-07-21 08:02:21 UTC
List: ruby-talk #76535
Hello Alex,

here goes the DIFF. It's againt latest CVS of OSSL2.

Could you please test it, so I can commit it to CVS?

	Michal

Attachments (1)

OSSL_0.9.6_2.diff (21.5 KB, text/x-diff)
Index: extconf.rb
===================================================================
RCS file: /cvsroot/rubypki/ossl2/extconf.rb,v
retrieving revision 1.17
diff -u -p -r1.17 extconf.rb
--- extconf.rb	14 Jul 2003 20:36:57 -0000	1.17
+++ extconf.rb	21 Jul 2003 06:41:23 -0000
@@ -35,10 +35,6 @@ includes, = dir_config("openssl")
 includes ||= "/usr/include"
 
 message "=== OpenSSL for Ruby configurator ===\n"
-message "=== Checking for system dependent stuff... ===\n"
-have_header("unistd.h")
-have_header("sys/time.h")
-message "=== Checking for system dependent stuff done. ===\n"
 
 
 ##
@@ -80,32 +76,67 @@ end
 def have_openssl_097(inc_dir)
 # FIXME:
 #  checking_for("OpenSSL >= 0.9.7") do
-  printf "Checking for OpenSSL >= 0.9.7..."
+  printf "checking for OpenSSL version... "
   File.open(inc_dir+"/openssl/opensslv.h") {|f|
     txt = f.read
-    result = ((txt.grep(/#define SHLIB_VERSION_NUMBER/)[0].split '"')[1] < "0.9.7")
-    puts result ? "no" : "yes"
-    !result
+    puts (txt.grep(/#define SHLIB_VERSION_NUMBER/)[0].split '"')[1]
+    true
   }
 end
 
 message "=== Checking for required stuff... ===\n"
 
 result = have_header("openssl/crypto.h")
-result &= have_library(CRYPTOLIB, "OPENSSL_load_builtin_modules")
+result &= have_library(CRYPTOLIB, "OpenSSL_add_all_digests")
 result &= have_library(SSLLIB, "SSL_library_init")
-result &= have_openssl_097(includes)
 
-have_func("rb_obj_init_copy", "ruby.h")
-have_func("HMAC_CTX_copy")
-have_func("X509_STORE_set_ex_data")
-
-if result
-  message "=== Checking for required stuff done. ===\n"
-  create_makefile("openssl")
-  message "Done.\n"
-else
+if !result
   message "=== Checking for required stuff failed. ===\n"
   message "Makefile wasn't created. Fix the errors above.\n"
+  exit 1
 end
+
+message "=== Checking for system dependent stuff... ===\n"
+have_header("unistd.h")
+have_header("sys/time.h")
+
+message "=== Checking for OpenSSL features... ===\n"
+have_openssl_097(includes)
+have_defined("PEM_read_bio_DSAPublicKey", "openssl/pem.h")
+have_defined("PEM_write_bio_DSAPublicKey", "openssl/pem.h")
+have_defined("DSAPrivateKey_dup", "openssl/dsa.h")
+have_defined("DSAPublicKey_dup", "openssl/dsa.h")
+have_defined("X509_REVOKED_dup", "openssl/x509.h")
+have_defined("PKCS7_SIGNER_INFO_dup", "openssl/pkcs7")
+have_defined("PKCS7_RECIP_INFO_dup", "openssl/pkcs7")
+have_func("HMAC_CTX_copy")
+have_func("X509_STORE_get_ex_data")
+have_func("X509_STORE_set_ex_data")
+have_func("EVP_MD_CTX_create")
+have_func("EVP_MD_CTX_cleanup")
+have_func("EVP_MD_CTX_destroy")
+have_func("PEM_def_callback")
+have_defined("EVP_CIPHER_name", "openssl/evp.h")
+have_defined("EVP_MD_name", "openssl/evp.h")
+have_func("EVP_MD_CTX_init")
+have_func("HMAC_CTX_init")
+have_func("HMAC_CTX_cleanup")
+have_defined("PKCS7_is_detached", "openssl/pkcs7.h")
+have_defined("PKCS7_type_is_encrypted", "openssl/pkcs7.h")
+have_func("X509_CRL_set_version")
+have_func("X509_CRL_set_issuer_name")
+have_func("X509_CRL_sort")
+have_func("X509_CRL_add0_revoked")
+have_struct_member("X509_STORE_CTX", "current_crl", "openssl/x509.h")
+have_struct_member("X509_STORE", "flags", "openssl/x509.h")
+have_struct_member("X509_STORE", "purpose", "openssl/x509.h")
+have_struct_member("X509_STORE", "trust", "openssl/x509.h")
+have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h")
+
+message "=== Checking for Ruby features... ===\n"
+have_func("rb_obj_init_copy", "ruby.h")
+
+message "=== Checking done. ===\n"
+create_makefile("openssl")
+message "Done.\n"
 
Index: openssl_missing.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/openssl_missing.c,v
retrieving revision 1.7
diff -u -p -r1.7 openssl_missing.c
--- openssl_missing.c	9 Jul 2003 10:41:27 -0000	1.7
+++ openssl_missing.c	21 Jul 2003 06:41:23 -0000
@@ -51,3 +51,120 @@ void *X509_STORE_get_ex_data(X509_STORE 
     return CRYPTO_get_ex_data(&str->ex_data,idx);
 }
 #endif /* HAVE_X509_STORE_SET_EX_DATA */
+
+#if !defined(HAVE_EVP_MD_CTX_CREATE)
+EVP_MD_CTX *EVP_MD_CTX_create(void)
+{
+    EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof *ctx);
+
+    memset(ctx, '\0', sizeof *ctx);
+
+    return ctx;
+}
+#endif /* HAVE_EVP_MD_CTX_CREATE */
+
+#if !defined(HAVE_EVP_MD_CTX_CLEANUP)
+int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx)
+{
+#warning FIXME!!!
+    memset(ctx, '\0', sizeof *ctx);
+
+    return 1;
+}
+#endif /* HAVE_EVP_MD_CTX_CLEANUP */
+
+#if !defined(HAVE_EVP_MD_CTX_DESTROY)
+void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx)
+{
+    EVP_MD_CTX_cleanup(ctx);
+    OPENSSL_free(ctx);
+}
+#endif /* HAVE_EVP_MD_CTX_DESTROY */
+
+#if !defined(HAVE_EVP_MD_CTX_INIT)
+void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
+{
+    memset(ctx,'\0',sizeof *ctx);
+}
+#endif
+
+#if !defined(HAVE_HMAC_CTX_INIT)
+void HMAC_CTX_init(HMAC_CTX *ctx)
+{
+    EVP_MD_CTX_init(&ctx->i_ctx);
+    EVP_MD_CTX_init(&ctx->o_ctx);
+    EVP_MD_CTX_init(&ctx->md_ctx);
+}
+#endif
+
+#if !defined(HAVE_HMAC_CTX_CLEANUP)
+void HMAC_CTX_cleanup(HMAC_CTX *ctx)
+{
+    EVP_MD_CTX_cleanup(&ctx->i_ctx);
+    EVP_MD_CTX_cleanup(&ctx->o_ctx);
+    EVP_MD_CTX_cleanup(&ctx->md_ctx);
+    memset(ctx,0,sizeof *ctx);
+}
+#endif
+
+#if !defined(HAVE_X509_CRL_SET_VERSION)
+int X509_CRL_set_version(X509_CRL *x, long version)
+{
+    if (x == NULL) return(0);
+    if (x->crl->version == NULL)
+	{
+	if ((x->crl->version=M_ASN1_INTEGER_new()) == NULL)
+	    return(0);
+	}
+    return(ASN1_INTEGER_set(x->crl->version,version));
+}
+#endif
+
+#if !defined(HAVE_X509_CRL_SET_ISSUER_NAME)
+int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name)
+{
+    if ((x == NULL) || (x->crl == NULL)) return(0);
+    return(X509_NAME_set(&x->crl->issuer,name));
+}
+#endif
+
+#if !defined(HAVE_X509_CRL_SORT)
+int X509_CRL_sort(X509_CRL *c)
+{
+    int i;
+    X509_REVOKED *r;
+    /* sort the data so it will be written in serial
+     * number order */
+    sk_X509_REVOKED_sort(c->crl->revoked);
+    for (i=0; i<sk_X509_REVOKED_num(c->crl->revoked); i++)
+	{
+	r=sk_X509_REVOKED_value(c->crl->revoked,i);
+	r->sequence=i;
+	}
+    return 1;
+}
+#endif
+
+#if !defined(X509_CRL_ADD0_REVOKED)
+static int OSSL_X509_REVOKED_cmp(const X509_REVOKED * const *a,
+	const X509_REVOKED * const *b)
+{
+    return(ASN1_STRING_cmp(
+		(ASN1_STRING *)(*a)->serialNumber,
+		(ASN1_STRING *)(*b)->serialNumber));
+}
+		    
+int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev)
+{
+    X509_CRL_INFO *inf;
+    inf = crl->crl;
+    if(!inf->revoked)
+	inf->revoked = sk_X509_REVOKED_new(OSSL_X509_REVOKED_cmp);
+    if(!inf->revoked || !sk_X509_REVOKED_push(inf->revoked, rev)) {
+	/* ASN1err(ASN1_F_X509_CRL_ADD0_REVOKED, ERR_R_MALLOC_FAILURE); */
+	return 0;
+    }
+    return 1;
+}
+#endif
+
Index: openssl_missing.h
===================================================================
RCS file: /cvsroot/rubypki/ossl2/openssl_missing.h,v
retrieving revision 1.3
diff -u -p -r1.3 openssl_missing.h
--- openssl_missing.h	9 Jul 2003 10:41:27 -0000	1.3
+++ openssl_missing.h	21 Jul 2003 06:41:23 -0000
@@ -19,43 +19,74 @@ extern "C" {
  * These functions are not included in headers of OPENSSL <= 0.9.6b
  */
 
-/* to pem.h */
-#if !defined(OPENSSL_NO_DSA)
+#if !defined(HAVE_PEM_READ_BIO_DSAPUBLICKEY)
 # define PEM_read_bio_DSAPublicKey(bp,x,cb,u) (DSA *)PEM_ASN1_read_bio( \
         (char *(*)())d2i_DSAPublicKey,PEM_STRING_DSA_PUBLIC,bp,(char **)x,cb,u)
+#endif
+
+#if !defined(HAVE_PEM_WRITE_BIO_DSAPUBLICKEY)
 # define PEM_write_bio_DSAPublicKey(bp,x) \
 	PEM_ASN1_write_bio((int (*)())i2d_DSAPublicKey,\
 		PEM_STRING_DSA_PUBLIC,\
 		bp,(char *)x, NULL, NULL, 0, NULL, NULL)
-#endif /* NO_DSA */
+#endif
 
-/* to x509.h */
-#if !defined(OPENSSL_NO_DSA)
+#if !defined(HAVE_DSAPRIVATEKEY_DUP)
 # define DSAPrivateKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPrivateKey, \
 	(char *(*)())d2i_DSAPrivateKey,(char *)dsa)
+#endif
+
+#if !defined(HAVE_DSAPUBLICKEY_DUP)
 # define DSAPublicKey_dup(dsa) (DSA *)ASN1_dup((int (*)())i2d_DSAPublicKey, \
 	(char *(*)())d2i_DSAPublicKey,(char *)dsa)
-#endif /* NO_DSA */
+#endif
 
+#if !defined(HAVE_X509_REVOKED_DUP)
 # define X509_REVOKED_dup(rev) (X509_REVOKED *)ASN1_dup((int (*)())i2d_X509_REVOKED, \
 	(char *(*)())d2i_X509_REVOKED, (char *)rev)
+#endif
 
-/* to pkcs7.h */
-#define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((int (*)())i2d_PKCS7_SIGNER_INFO, \
+#if !defined(HAVE_PKCS7_SIGNER_INFO_DUP)
+#  define PKCS7_SIGNER_INFO_dup(si) (PKCS7_SIGNER_INFO *)ASN1_dup((int (*)())i2d_PKCS7_SIGNER_INFO, \
 	(char *(*)())d2i_PKCS7_SIGNER_INFO, (char *)si)
-#define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((int (*)())i2d_PKCS7_RECIP_INFO, \
+#endif
+
+#if !defined(HAVE_PKCS7_RECIP_INFO_DUP)
+#  define PKCS7_RECIP_INFO_dup(ri) (PKCS7_RECIP_INFO *)ASN1_dup((int (*)())i2d_PKCS7_RECIP_INFO, \
 	(char *(*)())d2i_PKCS7_RECIP_INFO, (char *)ri)
+#endif
 
-#if !defined(OPENSSL_NO_HMAC)
-#if !defined(HAVE_HMAC_CTX_COPY)
 int HMAC_CTX_copy(HMAC_CTX *out, HMAC_CTX *in);
-#endif /* HAVE_HMAC_CTX_COPY */
-#endif /* NO_HMAC */
-
-#if !defined(HAVE_X509_STORE_SET_EX_DATA)
-int X509_STORE_set_ex_data(X509_STORE *str, int idx, void *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);
+EVP_MD_CTX *EVP_MD_CTX_create(void);
+int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);
+void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);
+
+#if !defined(HAVE_EVP_CIPHER_NAME)
+#  define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e))
 #endif
+
+#if !defined(HAVE_EVP_MD_NAME)
+#  define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_type(e))
+#endif
+
+void EVP_MD_CTX_init(EVP_MD_CTX *ctx);
+void HMAC_CTX_init(HMAC_CTX *ctx);
+void HMAC_CTX_cleanup(HMAC_CTX *ctx);
+
+#if !defined(HAVE_PKCS7_IS_DETACHED)
+#  define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))
+#endif
+
+#if !defined(HAVE_PKCS7_TYPE_IS_ENCRYPTED)
+#  define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)
+#endif
+
+int X509_CRL_set_version(X509_CRL *x, long version);
+int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
+int X509_CRL_sort(X509_CRL *c);
+int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);
 
 #if defined(__cplusplus)
 }
Index: ossl.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl.c,v
retrieving revision 1.36
diff -u -p -r1.36 ossl.c
--- ossl.c	10 Jul 2003 10:34:59 -0000	1.36
+++ ossl.c	21 Jul 2003 06:41:23 -0000
@@ -292,6 +292,7 @@ OSSL_SK2ARY(x509crl, X509_CRL)
 /*
  * our default PEM callback
  */
+#if defined(HAVE_PEM_DEF_CALLBACK)
 static VALUE
 ossl_pem_passwd_cb0(VALUE flag)
 {	
@@ -312,7 +313,7 @@ ossl_pem_passwd_cb(char *buf, int max_le
     if (pwd || !rb_block_given_p())
 	return PEM_def_callback(buf, max_len, flag, pwd);
 
-    while(1){
+    while (1) {
 	/*
 	 * when the flag is nonzero, this passphrase
 	 * will be used to perform encryption; otherwise it will
@@ -335,6 +336,7 @@ ossl_pem_passwd_cb(char *buf, int max_le
     }
     return len;
 }
+#endif
 
 /*
  * Verify callback
Index: ossl.h
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl.h,v
retrieving revision 1.32
diff -u -p -r1.32 ossl.h
--- ossl.h	14 Jul 2003 20:36:57 -0000	1.32
+++ ossl.h	21 Jul 2003 06:41:25 -0000
@@ -24,9 +24,11 @@ extern "C" {
 #include <version.h>
 #include <openssl/opensslv.h>
 
+/*
 #if (OPENSSL_VERSION_NUMBER < 0x00907000L)
 #  error ! This version of OSSL needs OpenSSL >= 0.9.7 for its run!
 #endif
+ */
 
 #if defined(NT) || defined(_WIN32)
 #  define OpenFile WINAPI_OpenFile
@@ -38,7 +40,9 @@ extern "C" {
 #include <openssl/ssl.h>
 #include <openssl/hmac.h>
 #include <openssl/rand.h>
-#include <openssl/ocsp.h>
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
+#  include <openssl/ocsp.h>
+#endif
 #if defined(NT) || defined(_WIN32)
 #  undef OpenFile
 #endif
@@ -115,7 +119,11 @@ STACK_OF(X509) *ossl_protect_x509_ary2sk
 /*
  * our default PEM callback
  */
+#if defined(HAVE_PEM_DEF_CALLBACK)
 int ossl_pem_passwd_cb(char *, int, int, void *);
+#else
+#  define ossl_pem_passwd_cb NULL
+#endif
 
 /*
  * ERRor messages
Index: ossl_bn.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_bn.c,v
retrieving revision 1.21
diff -u -p -r1.21 ossl_bn.c
--- ossl_bn.c	9 Jul 2003 10:41:27 -0000	1.21
+++ ossl_bn.c	21 Jul 2003 06:41:25 -0000
@@ -325,7 +325,9 @@ BIGNUM_2c(mul);
 BIGNUM_2c(mod);
 BIGNUM_2c(exp);
 BIGNUM_2c(gcd);
+#if (OPENSSL_VERSION >= 0x00907000L)
 BIGNUM_2c(mod_sqr);
+#endif
 BIGNUM_2c(mod_inverse);
 
 static VALUE
@@ -372,8 +374,10 @@ ossl_bn_div(VALUE self, VALUE other)
 	WrapBN(CLASS_OF(self), obj, result);			\
 	return obj;						\
     }
+#if (OPENSSL_VERSION >= 0x00907000L)
 BIGNUM_3c(mod_add);
 BIGNUM_3c(mod_sub);
+#endif
 BIGNUM_3c(mod_mul);
 BIGNUM_3c(mod_exp);
 
@@ -647,10 +651,12 @@ Init_ossl_bn()
     rb_define_method(cBN, "%", ossl_bn_mod, 1);
     /* nnmod */
 
+#if (OPENSSL_VERSION >= 0x00907000L)
     rb_define_method(cBN, "mod_add", ossl_bn_mod_add, 2);
     rb_define_method(cBN, "mod_sub", ossl_bn_mod_sub, 2);
-    rb_define_method(cBN, "mod_mul", ossl_bn_mod_mul, 2);
     rb_define_method(cBN, "mod_sqr", ossl_bn_mod_sqr, 1);
+#endif
+    rb_define_method(cBN, "mod_mul", ossl_bn_mod_mul, 2);
     rb_define_method(cBN, "**", ossl_bn_exp, 1);
     rb_define_method(cBN, "mod_exp", ossl_bn_mod_exp, 2);
     rb_define_method(cBN, "gcd", ossl_bn_gcd, 1);
Index: ossl_cipher.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_cipher.c,v
retrieving revision 1.21
diff -u -p -r1.21 ossl_cipher.c
--- ossl_cipher.c	9 Jul 2003 10:41:27 -0000	1.21
+++ ossl_cipher.c	21 Jul 2003 06:41:25 -0000
@@ -311,13 +311,16 @@ ossl_cipher_set_iv(VALUE self, VALUE iv)
 static VALUE
 ossl_cipher_set_padding(VALUE self, VALUE padding)
 {
+#if defined(HAVE_ST_FLAGS)
     EVP_CIPHER_CTX *ctx;
 
     GetCipher(self, ctx);
 
     if (EVP_CIPHER_CTX_set_padding(ctx, NUM2INT(padding)) != 1)
 		ossl_raise(eCipherError, NULL);
-
-    return padding;
+#else
+    rb_notimplement();
+#endif
+    return padding;
 }
 
 #define CIPHER_0ARG_INT(func)					\
Index: ossl_config.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_config.c,v
retrieving revision 1.13
diff -u -p -r1.13 ossl_config.c
--- ossl_config.c	9 Jul 2003 10:41:27 -0000	1.13
+++ ossl_config.c	21 Jul 2003 06:41:25 -0000
@@ -45,15 +45,23 @@ ossl_config_s_load(int argc, VALUE *argv
     char *filename;
     VALUE path, obj;
 
-    if (rb_scan_args(argc, argv, "01", &path) == 1) {
+    if (rb_scan_args(argc, argv, 
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
+		"01"
+#else
+		"10"
+#endif
+		, &path) == 1) {
 	SafeStringValue(path);
 	filename = RSTRING(path)->ptr;
     }
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
     else {
 	if (!(filename = CONF_get1_default_config_file())) {
 	    ossl_raise(eConfigError, NULL);
 	}
     }
+#endif
 /*
  * FIXME
  * Does't work for Windows?
Index: ossl_ocsp.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_ocsp.c,v
retrieving revision 1.7
diff -u -p -r1.7 ossl_ocsp.c
--- ossl_ocsp.c	14 Jul 2003 20:36:57 -0000	1.7
+++ ossl_ocsp.c	21 Jul 2003 06:41:28 -0000
@@ -11,6 +11,8 @@
  */
 #include "ossl.h"
 
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
+
 #define WrapOCSPReq(klass, obj, req) do { \
     if(!req) ossl_raise(rb_eRuntimeError, "Request wasn't initialized!"); \
     obj = Data_Wrap_Struct(klass, 0, OCSP_REQUEST_free, req); \
@@ -754,3 +756,10 @@ Init_ossl_ocsp()
     DefOCSPVConst(RESPID_NAME);
     DefOCSPVConst(RESPID_KEY);
 }
+
+#else /* OPENSSL_VERSION_NUMBER < 0x0090700L */
+void
+Init_ossl_ocsp()
+{
+}
+#endif
Index: ossl_ssl.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_ssl.c,v
retrieving revision 1.38
diff -u -p -r1.38 ossl_ssl.c
--- ossl_ssl.c	9 Jul 2003 10:41:27 -0000	1.38
+++ ossl_ssl.c	21 Jul 2003 06:41:34 -0000
@@ -656,13 +656,17 @@ Init_ossl_ssl()
      * ossl_ssl_def_const(OP_DONT_INSERT_EMPTY_FRAGMENTS);
      */
     ossl_ssl_def_const(OP_ALL);
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
     ossl_ssl_def_const(OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION);
+#endif
 #ifdef SSL_OP_SINGLE_ECDH_USE
     ossl_ssl_def_const(OP_SINGLE_ECDH_USE);
 #endif
     ossl_ssl_def_const(OP_SINGLE_DH_USE);
     ossl_ssl_def_const(OP_EPHEMERAL_RSA);
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
     ossl_ssl_def_const(OP_CIPHER_SERVER_PREFERENCE);
+#endif
     ossl_ssl_def_const(OP_TLS_ROLLBACK_BUG);
     ossl_ssl_def_const(OP_NO_SSLv2);
     ossl_ssl_def_const(OP_NO_SSLv3);
Index: ossl_x509.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_x509.c,v
retrieving revision 1.4
diff -u -p -r1.4 ossl_x509.c
--- ossl_x509.c	19 Jun 2003 00:13:30 -0000	1.4
+++ ossl_x509.c	21 Jul 2003 06:41:34 -0000
@@ -62,8 +62,10 @@ Init_ossl_x509()
     DefX509Const(V_ERR_KEYUSAGE_NO_CERTSIGN);
     DefX509Const(V_ERR_APPLICATION_VERIFICATION);
 
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
     DefX509Const(V_FLAG_CRL_CHECK);
     DefX509Const(V_FLAG_CRL_CHECK_ALL);
+#endif
 
     DefX509Const(PURPOSE_SSL_CLIENT);
     DefX509Const(PURPOSE_SSL_SERVER);
@@ -72,13 +74,17 @@ Init_ossl_x509()
     DefX509Const(PURPOSE_SMIME_ENCRYPT);
     DefX509Const(PURPOSE_CRL_SIGN);
     DefX509Const(PURPOSE_ANY);
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
     DefX509Const(PURPOSE_OCSP_HELPER);
+#endif
 
     DefX509Const(TRUST_COMPAT);
     DefX509Const(TRUST_SSL_CLIENT);
     DefX509Const(TRUST_SSL_SERVER);
     DefX509Const(TRUST_EMAIL);
     DefX509Const(TRUST_OBJECT_SIGN);
+#if (OPENSSL_VERSION_NUMBER >= 0x00907000L)
     DefX509Const(TRUST_OCSP_SIGN);
     DefX509Const(TRUST_OCSP_REQUEST);
+#endif
 }
Index: ossl_x509store.c
===================================================================
RCS file: /cvsroot/rubypki/ossl2/ossl_x509store.c,v
retrieving revision 1.27
diff -u -p -r1.27 ossl_x509store.c
--- ossl_x509store.c	14 Jul 2003 20:36:57 -0000	1.27
+++ ossl_x509store.c	21 Jul 2003 06:46:08 -0000
@@ -139,33 +139,42 @@ ossl_x509store_initialize(int argc, VALU
 static VALUE
 ossl_x509store_set_flags(VALUE self, VALUE flags)
 {
+#if defined(HAVE_ST_FLAGS)
     X509_STORE *store;
 
     GetX509Store(self, store);
     X509_STORE_set_flags(store, NUM2LONG(flags));
-
+#else
+    rb_notimplement();
+#endif
     return flags;
 }
 
 static VALUE
 ossl_x509store_set_purpose(VALUE self, VALUE purpose)
 {
+#if defined(HAVE_ST_PURPOSE)
     X509_STORE *store;
 
     GetX509Store(self, store);
     X509_STORE_set_purpose(store, NUM2LONG(purpose));
-
+#else
+    rb_notimplement();
+#endif
     return purpose;
 }
 
 static VALUE
 ossl_x509store_set_trust(VALUE self, VALUE trust)
 {
+#if defined(HAVE_ST_TRUST)
     X509_STORE *store;
 
     GetX509Store(self, store);
     X509_STORE_set_trust(store, NUM2LONG(trust));
-
+#else
+    rb_notimplement();
+#endif
     return trust;
 }
 
@@ -327,7 +336,11 @@ ossl_x509stctx_initialize(int argc, VALU
     SafeGetX509Store(store, x509st);
     if(!NIL_P(cert)) x509 = DupX509CertPtr(cert); /* NEED TO DUP */
     if(!NIL_P(chain)) x509s = ossl_x509_ary2sk(chain);
-    if(X509_STORE_CTX_init(ctx, x509st, x509, x509s) != 1){
+    if (X509_STORE_CTX_init(ctx, x509st, x509, x509s)
+#if (OPENSSL_VERSION_NUMBER < 0x00907000L)
+	, 1
+#endif
+	!= 1) {
         sk_X509_pop_free(x509s, X509_free);
         ossl_raise(eX509StoreError, NULL);
     }
@@ -436,9 +449,14 @@ ossl_x509stctx_get_curr_crl(VALUE self)
     X509_STORE_CTX *ctx;
 
     GetX509StCtx(self, ctx);
+
+#if defined(HAVE_ST_CURRENT_CRL)
     if(!ctx->current_crl) return Qnil;
 
     return ossl_x509crl_new(ctx->current_crl);
+#else
+    return Qnil;
+#endif
 }
 
 static VALUE
Index: examples/ossl_x509store.rb
===================================================================
RCS file: /cvsroot/rubypki/ossl2/examples/ossl_x509store.rb,v
retrieving revision 1.15
diff -u -p -r1.15 ossl_x509store.rb
--- examples/ossl_x509store.rb	4 Jul 2003 06:32:41 -0000	1.15
+++ examples/ossl_x509store.rb	21 Jul 2003 06:46:12 -0000
@@ -72,21 +72,24 @@ store.add_cert(ca)
 #store.add_path("./cert")
 #store.add_file("./0cert.pem")
 
-#store.purpose = X509::PURPOSE_SSL_CLIENT
-#store.purpose = X509::PURPOSE_SSL_SERVER
-#store.purpose = X509::PURPOSE_NS_SSL_SERVER
-store.purpose = X509::PURPOSE_SMIME_SIGN
-#store.purpose = X509::PURPOSE_SMIME_ENCRYPT
-#store.purpose = X509::PURPOSE_CRL_SIGN
-#store.purpose = X509::PURPOSE_ANY
-#store.purpose = X509::PURPOSE_OCSP_HELPER
-#store.trust = X509::TRUST_COMPAT
-#store.trust = X509::TRUST_SSL_CLIENT
-#store.trust = X509::TRUST_SSL_SERVER
-#store.trust = X509::TRUST_EMAIL
-#store.trust = X509::TRUST_OBJECT_SIGN
-#store.trust = X509::TRUST_OCSP_SIGN
-#store.trust = X509::TRUST_OCSP_REQUEST
+begin
+#  store.purpose = X509::PURPOSE_SSL_CLIENT
+#  store.purpose = X509::PURPOSE_SSL_SERVER
+#  store.purpose = X509::PURPOSE_NS_SSL_SERVER
+  store.purpose = X509::PURPOSE_SMIME_SIGN
+#  store.purpose = X509::PURPOSE_SMIME_ENCRYPT
+#  store.purpose = X509::PURPOSE_CRL_SIGN
+#  store.purpose = X509::PURPOSE_ANY
+#  store.purpose = X509::PURPOSE_OCSP_HELPER
+#  store.trust = X509::TRUST_COMPAT
+#  store.trust = X509::TRUST_SSL_CLIENT
+#  store.trust = X509::TRUST_SSL_SERVER
+#  store.trust = X509::TRUST_EMAIL
+#  store.trust = X509::TRUST_OBJECT_SIGN
+#  store.trust = X509::TRUST_OCSP_SIGN
+#  store.trust = X509::TRUST_OCSP_REQUEST
+rescue NotImplementedError => e
+end
 
 verify_with_store(store, certs, verify_cb)
 
@@ -104,5 +107,8 @@ puts "========== Add CRL to the Store an
 store.add_crl(crl)
 #store.add_path("./crl")
 #store.add_file("./0crl.pem")
+begin
 store.flags = X509::V_FLAG_CRL_CHECK|X509::V_FLAG_CRL_CHECK_ALL
+rescue
+end
 verify_with_store(store, certs, verify_cb)

In This Thread

Prev Next