Module: OpenSSL

Defined in:
lib/openssl/bn.rb,
ossl.c,
ossl_bn.c,
ossl_ssl.c,
ossl_hmac.c,
ossl_pkey.c,
ossl_rand.c,
ossl_digest.c,
ossl_pkey_ec.c,
ossl_pkey_dh.c,
ossl_x509cert.c,
ossl_ssl_session.c,
lib/openssl/config.rb,
lib/openssl/cipher.rb,
lib/openssl/digest.rb,
lib/openssl/ssl-internal.rb,
lib/openssl/x509-internal.rb

Overview

$RCSfile$ -- Ruby-space definitions that completes C-space funcs for X509 and subclasses

Info

'OpenSSL for Ruby 2' project
Copyright (C) 2002  Michal Rokos <[email protected]>
All rights reserved.

Licence

This program is licenced under the same licence as Ruby.
(See the file 'LICENCE'.)

Version

$Id: x509-internal.rb 32663 2011-07-25 04:51:26Z nahi $

Defined Under Namespace

Modules: ASN1, Buffering, Netscape, OCSP, PKCS5, PKey, Random, SSL, X509 Classes: BN, BNError, Cipher, Config, ConfigError, Digest, Engine, HMAC, HMACError, OpenSSLError, PKCS12, PKCS7

Constant Summary collapse

VERSION =

OpenSSL ruby extension version

rb_str_new2(OSSL_VERSION)
OPENSSL_VERSION =

Version of OpenSSL the ruby OpenSSL extension was built with

rb_str_new2(OPENSSL_VERSION_TEXT)
OPENSSL_VERSION_NUMBER =

Version number of OpenSSL the ruby OpenSSL extension was built with (base 16)

INT2NUM(OPENSSL_VERSION_NUMBER)

Class Method Summary collapse

Class Method Details

.debugObject



387
388
389
390
391
# File 'ossl.c', line 387

static VALUE
ossl_debug_get(VALUE self)
{
    return dOSSL;
}

.debug=(boolean) ⇒ Boolean

Turns on or off CRYPTO_MEM_CHECK. Also shows some debugging message on stderr.

Returns:

  • (Boolean)


400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
# File 'ossl.c', line 400

static VALUE
ossl_debug_set(VALUE self, VALUE val)
{
    VALUE old = dOSSL;
    dOSSL = val;

    if (old != dOSSL) {
	if (dOSSL == Qtrue) {
	    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
	    fprintf(stderr, "OSSL_DEBUG: IS NOW ON!\n");
	} else if (old == Qtrue) {
	    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF);
	    fprintf(stderr, "OSSL_DEBUG: IS NOW OFF!\n");
	}
    }
    return val;
}

.errorsArray

See any remaining errors held in queue.

Any errors you see here are probably due to a bug in ruby's OpenSSL implementation.

Returns:

  • (Array)


348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'ossl.c', line 348

VALUE
ossl_get_errors()
{
    VALUE ary;
    long e;

    ary = rb_ary_new();
    while ((e = ERR_get_error()) != 0){
        rb_ary_push(ary, rb_str_new2(ERR_error_string(e, NULL)));
    }

    return ary;
}