summaryrefslogtreecommitdiffstats
path: root/OpenSSL/SSL/Session.html
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSSL/SSL/Session.html')
-rw-r--r--OpenSSL/SSL/Session.html51
1 files changed, 23 insertions, 28 deletions
diff --git a/OpenSSL/SSL/Session.html b/OpenSSL/SSL/Session.html
index b593fe5b..c4770f1d 100644
--- a/OpenSSL/SSL/Session.html
+++ b/OpenSSL/SSL/Session.html
@@ -126,43 +126,38 @@
<p>Creates a new <a href="Session.html"><code>Session</code></a> object from an instance of <a href="SSLSocket.html"><code>SSLSocket</code></a> or DER/PEM encoded String.</p>
<div class="method-source-code" id="new-source">
- <pre>static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
+ <pre>static VALUE
+ossl_ssl_session_initialize(VALUE self, VALUE arg1)
{
- SSL_SESSION *ctx = NULL;
-
- if (RDATA(self)-&gt;data)
- ossl_raise(eSSLSession, &quot;SSL Session already initialized&quot;);
-
- if (rb_obj_is_instance_of(arg1, cSSLSocket)) {
- SSL *ssl;
-
- GetSSL(arg1, ssl);
+ SSL_SESSION *ctx;
- if ((ctx = SSL_get1_session(ssl)) == NULL)
- ossl_raise(eSSLSession, &quot;no session available&quot;);
- } else {
- BIO *in = ossl_obj2bio(&amp;arg1);
+ if (RTYPEDDATA_DATA(self))
+ ossl_raise(eSSLSession, &quot;SSL Session already initialized&quot;);
- ctx = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
+ if (rb_obj_is_instance_of(arg1, cSSLSocket)) {
+ SSL *ssl;
- if (!ctx) {
- OSSL_BIO_reset(in);
- ctx = d2i_SSL_SESSION_bio(in, NULL);
- }
+ GetSSL(arg1, ssl);
- BIO_free(in);
+ if ((ctx = SSL_get1_session(ssl)) == NULL)
+ ossl_raise(eSSLSession, &quot;no session available&quot;);
+ }
+ else {
+ BIO *in = ossl_obj2bio(&amp;arg1);
- if (!ctx)
- ossl_raise(rb_eArgError, &quot;unknown type&quot;);
+ ctx = d2i_SSL_SESSION_bio(in, NULL);
+ if (!ctx) {
+ OSSL_BIO_reset(in);
+ ctx = PEM_read_bio_SSL_SESSION(in, NULL, NULL, NULL);
}
+ BIO_free(in);
+ if (!ctx)
+ ossl_raise(rb_eArgError, &quot;unknown type&quot;);
+ }
- /* should not happen */
- if (ctx == NULL)
- ossl_raise(eSSLSession, &quot;ctx not set - internal error&quot;);
-
- RDATA(self)-&gt;data = ctx;
+ RTYPEDDATA_DATA(self) = ctx;
- return self;
+ return self;
}</pre>
</div>
</div>