ext/rubysl/openssl/ossl_pkey.c in rubysl-openssl-2.2.1 vs ext/rubysl/openssl/ossl_pkey.c in rubysl-openssl-2.3.0
- old
+ new
@@ -1,7 +1,7 @@
/*
- * $Id$
+ * $Id: ossl_pkey.c 48806 2014-12-12 23:19:07Z nobu $
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
@@ -67,13 +67,27 @@
struct ossl_generate_cb_arg *arg = (struct ossl_generate_cb_arg *)ptr;
arg->stop = 1;
}
#endif
+static void
+ossl_evp_pkey_free(void *ptr)
+{
+ EVP_PKEY_free(ptr);
+}
+
/*
* Public
*/
+const rb_data_type_t ossl_evp_pkey_type = {
+ "OpenSSL/EVP_PKEY",
+ {
+ 0, ossl_evp_pkey_free,
+ },
+ 0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
+};
+
VALUE
ossl_pkey_new(EVP_PKEY *pkey)
{
if (!pkey) {
ossl_raise(ePKeyError, "Cannot make new key from NULL.");
@@ -340,10 +354,10 @@
/*
* INIT
*/
void
-Init_ossl_pkey()
+Init_ossl_pkey(void)
{
#if 0
mOSSL = rb_define_module("OpenSSL"); /* let rdoc know about mOSSL */
#endif