ruby/ext/openssl/ossl_bio.c
Kazuki Yamaguchi 69c0b1438a [ruby/openssl] Fix references to the license text
Update the references to the file "LICENCE" with "COPYING".

The file LICENCE doesn't exist in ruby/ruby nor ruby/openssl. This has
been always the case since OpenSSL for Ruby 2 was merged to the ruby
tree as a standard library in 2003.

In OpenSSL for Ruby 2's CVS repository[1], the LICENCE file contained
an old version of the Ruby License, identical to the COPYING file that
was in Ruby's tree at that time (r4128[2]).

[1] http://cvs.savannah.gnu.org/viewvc/rubypki/ossl2/LICENCE?revision=1.1.1.1&view=markup
[2] 231247c010/COPYING

https://github.com/ruby/openssl/commit/5bccf07d04
2024-06-08 10:59:17 +00:00

43 lines
796 B
C

/*
* 'OpenSSL for Ruby' team members
* Copyright (C) 2003
* All rights reserved.
*/
/*
* This program is licensed under the same licence as Ruby.
* (See the file 'COPYING'.)
*/
#include "ossl.h"
BIO *
ossl_obj2bio(volatile VALUE *pobj)
{
VALUE obj = *pobj;
BIO *bio;
if (RB_TYPE_P(obj, T_FILE))
obj = rb_funcallv(obj, rb_intern("read"), 0, NULL);
StringValue(obj);
bio = BIO_new_mem_buf(RSTRING_PTR(obj), RSTRING_LENINT(obj));
if (!bio)
ossl_raise(eOSSLError, "BIO_new_mem_buf");
*pobj = obj;
return bio;
}
VALUE
ossl_membio2str(BIO *bio)
{
VALUE ret;
int state;
BUF_MEM *buf;
BIO_get_mem_ptr(bio, &buf);
ret = ossl_str_new(buf->data, buf->length, &state);
BIO_free(bio);
if (state)
rb_jump_tag(state);
return ret;
}