OpenSSL for Ruby 0.2.0-pre0

Hi everybody!

After a long while, I managed to prepare preview of OpenSSL for

Ruby.

Skip this paragraph if you know what OSSL is…
—8<—
OSSL stands for ‘OpenSSL for Ruby’. This extension wants to
bring all the OpenSSL functions to Ruby. Currently is supported all the
inportant: Digests, Ciphers, Certs, CRLs, SSL, PKCS7,…
—8<—

OSSL2 was developed only for Ruby1.8 and OpenSSL 0.9.7. But

because OSSL 0.1 is known broken for OpenSSL 0.9.7, I did compatibily
layer for OSSL 0.2 to make it work with Ruby1.6 too. (It has some
limitations… read below)

What's new in OSSL2?

OSSL2 has some parts slightly rewritten. To name few examples: You don’t
need to recompile OSSL when new cipher or digest is implemented to
OpenSSL. (OSSL2 uses name lookups to OpenSSL for this. This idea comes
from TechnoramaTeam.) OSSL2 got few testcases (see test/ dir). SSL

What you can do for us?

Please test the OSSL2 in places you used OSSL1. If there is some problem
with compatibility, tell us.
If you have some time to contribute to OSSL project, we’ll be very glad
to welcome you in our team. We need programmers to write C code, test
cases, documentation, make website, PR… :slight_smile:
If you have some idea, don’t hesitate and write us!

Where you can d/l it?

http://savannah.nongnu.org/download/rubypki/
or you can fetch actual version from CVS:
cvs -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/rubypki login
[ENTER]
cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/rubypki co ossl2

Best regards

	Michal

Some notes:
—8<—
OSSL 0.2 with OpenSSL 0.9.7:
OSSL 0.2 is developed for this version.

OSSL 0.2 with OpenSSL 0.9.6:
I didn’t try to compile and run testcases under this version. If
you really need to make it work with OpenSSL 0.9.6, let me know… Maybe
you convince me to do it.

OSSL 0.2 with Ruby 1.8:
OSSL 0.2 is developed for this version. It supports allocation
framework, dup&copy framework…

OSSL 0.2 with Ruby 1.6:
OSSL 0.2 got compat. layer to make it work under this version.
It is known that #dup, #copy is broken (because I didn’t make compat.
layer for dup&copy framework)
—8<—

Documentation:
README is OLD! Read ChangeLog for new features…

Hi,

I tried to compile it on my FreeBSD 5.0-CURRENT box and got the
following error:

/usr/local/bin/gcc -fPIC -O -pipe -fPIC -I. -I/usr/local/lib/ruby/1.8/i386-freebsd5 -I/usr/local/lib/ruby/1.8/i386-freebsd5 -I. -DHAVE_UNISTD_H -DHAVE_SYS_TIME_H -DHAVE_STRPTIME -DHAVE_OPENSSL_CRYPTO_H -I/usr/include -I/usr/local/include -c ossl.c
ossl.c: In function `asn1time_to_time':
ossl.c:67: invalid operands to binary -
*** Error code 1

The box has OpenSSL 0.9.7a and uses gcc 3.2.2 as C compiler. On line
67 of ossl.c I read:

[ossl.c]
    67 return rb_time_new(mktime(&tm) - timezone, 0);

What did you really mean by "timezone" here? I'm sure you didn't mean
char *timezone() of libc only to make gcc 3.2.2 mad as shown above. :slight_smile:

Any ideas?

···

--
                     /
                    /__ __ Akinori.org / MUSHA.org
                   / ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp

"It went right by me -- At the time it went over my head
   I was looking out the window.. I should have looked at your face instead"

What did you really mean by "timezone" here? I'm sure you didn't mean
char *timezone() of libc only to make gcc 3.2.2 mad as shown above. :slight_smile:

Well, if I'm right SUSv2 define

    extern long int timezone;

Guy Decoux

In article 86bs11esag.wl%knu@iDaemons.org,
“Akinori MUSHA” knu@iDaemons.org writes:

What did you really mean by “timezone” here? I’m sure you didn’t mean
char *timezone() of libc only to make gcc 3.2.2 mad as shown above. :slight_smile:

Any ideas?

Call Time.utc, using rb_funcall. Because mktime(&tm) - timezone may
have problem with daylight savings.

Note that, in SUSv3, timezone is described in XSI section. I.e. it is
not POSIX but X/Open System Interface.

···


Tanaka Akira

Hi,

thank you all for the feedback.

Tanaka Akira wrote:

Call Time.utc, using rb_funcall. Because mktime(&tm) - timezone may
have problem with daylight savings.

Version with Time::utc is in CVS.

Could you test it?

Thank you.

  Michal

PS: TestCase justified...