projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make update
[openssl.git]
/
perl
/
openssl_ssl.xs
diff --git
a/perl/openssl_ssl.xs
b/perl/openssl_ssl.xs
index 05834797e38a458ad418d2a392df2b8aca486eb1..c7d1b171abfa8dabbb2e9264f643ccc8d8184270 100644
(file)
--- a/
perl/openssl_ssl.xs
+++ b/
perl/openssl_ssl.xs
@@
-1,4
+1,5
@@
-#include "p5SSLeay.h"
+
+#include "openssl.h"
static int p5_ssl_ex_ssl_ptr=0;
static int p5_ssl_ex_ssl_info_callback=0;
static int p5_ssl_ex_ssl_ptr=0;
static int p5_ssl_ex_ssl_info_callback=0;
@@
-44,7
+45,7
@@
int ret;
int boot_ssl()
{
p5_ssl_ex_ssl_ptr=
int boot_ssl()
{
p5_ssl_ex_ssl_ptr=
- SSL_get_ex_new_index(0,"
SSLeay
::SSL",ex_new,NULL,ex_cleanup);
+ SSL_get_ex_new_index(0,"
OpenSSL
::SSL",ex_new,NULL,ex_cleanup);
p5_ssl_ex_ssl_info_callback=
SSL_get_ex_new_index(0,"ssl_info_callback",NULL,NULL,
ex_cleanup);
p5_ssl_ex_ssl_info_callback=
SSL_get_ex_new_index(0,"ssl_info_callback",NULL,NULL,
ex_cleanup);
@@
-57,8
+58,9
@@
int boot_ssl()
return(1);
}
return(1);
}
-MODULE =
SSLeay::SSL PACKAGE = SSLeay
::SSL::CTX PREFIX = p5_SSL_CTX_
+MODULE =
OpenSSL::SSL PACKAGE = OpenSSL
::SSL::CTX PREFIX = p5_SSL_CTX_
+PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE
void
VERSIONCHECK: DISABLE
void
@@
-74,7
+76,7
@@
p5_SSL_CTX_new(...)
else if ((items == 2) && SvPOK(ST(1)))
method=SvPV(ST(1),na);
else
else if ((items == 2) && SvPOK(ST(1)))
method=SvPV(ST(1),na);
else
- croak("Usage:
SSLeay::SSL_
CTX::new(type)");
+ croak("Usage:
OpenSSL::SSL::
CTX::new(type)");
if (strcmp(method,"SSLv3") == 0)
meth=SSLv3_method();
if (strcmp(method,"SSLv3") == 0)
meth=SSLv3_method();
@@
-94,14
+96,20
@@
p5_SSL_CTX_new(...)
meth=SSLv2_client_method();
else if (strcmp(method,"SSLv2_server") == 0)
meth=SSLv2_server_method();
meth=SSLv2_client_method();
else if (strcmp(method,"SSLv2_server") == 0)
meth=SSLv2_server_method();
+ else if (strcmp(method,"TLSv1") == 0)
+ meth=TLSv1_method();
+ else if (strcmp(method,"TLSv1_client") == 0)
+ meth=TLSv1_client_method();
+ else if (strcmp(method,"TLSv1_server") == 0)
+ meth=TLSv1_server_method();
else
{
else
{
- croak("Not
passed
a valid SSL method name, should be 'SSLv[23] [client|server]'");
+ croak("Not a valid SSL method name, should be 'SSLv[23] [client|server]'");
}
EXTEND(sp,1);
PUSHs(sv_newmortal());
ctx=SSL_CTX_new(meth);
}
EXTEND(sp,1);
PUSHs(sv_newmortal());
ctx=SSL_CTX_new(meth);
- sv_setref_pv(ST(0), "
SSLeay
::SSL::CTX", (void*)ctx);
+ sv_setref_pv(ST(0), "
OpenSSL
::SSL::CTX", (void*)ctx);
int
p5_SSL_CTX_use_PrivateKey_file(ctx,file,...)
int
p5_SSL_CTX_use_PrivateKey_file(ctx,file,...)
@@
-113,7
+121,7
@@
p5_SSL_CTX_use_PrivateKey_file(ctx,file,...)
CODE:
pr_name("p5_SSL_CTX_use_PrivateKey_file");
if (items > 3)
CODE:
pr_name("p5_SSL_CTX_use_PrivateKey_file");
if (items > 3)
- croak("
SSLeay
::SSL::CTX::use_PrivateKey_file(ssl_ctx,file[,type])");
+ croak("
OpenSSL
::SSL::CTX::use_PrivateKey_file(ssl_ctx,file[,type])");
if (items == 3)
{
ptr=SvPV(ST(2),na);
if (items == 3)
{
ptr=SvPV(ST(2),na);
@@
-139,7
+147,7
@@
p5_SSL_CTX_set_options(ctx,...)
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
- croak("Usage:
SSLeay
::SSL_CTX::set_options(ssl_ctx[,option,value]+)");
+ croak("Usage:
OpenSSL
::SSL_CTX::set_options(ssl_ctx[,option,value]+)");
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
@@
-154,7
+162,7
@@
p5_SSL_CTX_set_options(ctx,...)
}
else
{
}
else
{
- croak("
SSLeay
::SSL_CTX::set_options(): unknown option");
+ croak("
OpenSSL
::SSL_CTX::set_options(): unknown option");
}
}
}
}
@@
-167,7
+175,7
@@
p5_SSL_CTX_DESTROY(ctx)
pr_name_d("p5_SSL_CTX_DESTROY",ctx->references);
SSL_CTX_free(ctx);
pr_name_d("p5_SSL_CTX_DESTROY",ctx->references);
SSL_CTX_free(ctx);
-MODULE =
SSLeay::SSL PACKAGE = SSLeay
::SSL PREFIX = p5_SSL_
+MODULE =
OpenSSL::SSL PACKAGE = OpenSSL
::SSL PREFIX = p5_SSL_
void
p5_SSL_new(...)
void
p5_SSL_new(...)
@@
-175,30
+183,29
@@
p5_SSL_new(...)
SV *sv_ctx;
SSL_CTX *ctx;
SSL *ssl;
SV *sv_ctx;
SSL_CTX *ctx;
SSL *ssl;
- int i;
SV *arg;
PPCODE:
pr_name("p5_SSL_new");
if ((items != 1) && (items != 2))
SV *arg;
PPCODE:
pr_name("p5_SSL_new");
if ((items != 1) && (items != 2))
- croak("Usage:
SSLeay
::SSL::new(ssl_ctx)");
- if (sv_derived_from(ST(items-1),"
SSLeay
::SSL::CTX"))
+ croak("Usage:
OpenSSL
::SSL::new(ssl_ctx)");
+ if (sv_derived_from(ST(items-1),"
OpenSSL
::SSL::CTX"))
{
IV tmp = SvIV((SV*)SvRV(ST(items-1)));
ctx=(SSL_CTX *)tmp;
sv_ctx=ST(items-1);
}
else
{
IV tmp = SvIV((SV*)SvRV(ST(items-1)));
ctx=(SSL_CTX *)tmp;
sv_ctx=ST(items-1);
}
else
- croak("ssl_ctx is not of type
SSLeay
::SSL::CTX");
+ croak("ssl_ctx is not of type
OpenSSL
::SSL::CTX");
EXTEND(sp,1);
PUSHs(sv_newmortal());
ssl=SSL_new(ctx);
EXTEND(sp,1);
PUSHs(sv_newmortal());
ssl=SSL_new(ctx);
- sv_setref_pv(ST(0), "
SSLeay
::SSL", (void*)ssl);
+ sv_setref_pv(ST(0), "
OpenSSL
::SSL", (void*)ssl);
/* Now this is being a little hairy, we keep a pointer to
* our perl reference. We need to do a different one
/* Now this is being a little hairy, we keep a pointer to
* our perl reference. We need to do a different one
- * to the one we return because it will have it
'
s reference
- * count drop
ed to 0 a
pon return and if we up its reference
+ * to the one we return because it will have its reference
+ * count drop
ped to 0 u
pon return and if we up its reference
* count, it will never be DESTROYED */
arg=newSVsv(ST(0));
SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ptr,(char *)arg);
* count, it will never be DESTROYED */
arg=newSVsv(ST(0));
SSL_set_ex_data(ssl,p5_ssl_ex_ssl_ptr,(char *)arg);
@@
-317,7
+324,7
@@
p5_SSL_set_options(ssl,...)
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
for (i=1; i<items; i++)
{
if (!SvPOK(ST(i)))
- croak("Usage:
SSLeay
::SSL::set_options(ssl[,option,value]+)");
+ croak("Usage:
OpenSSL
::SSL::set_options(ssl[,option,value]+)");
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
ptr=SvPV(ST(i),na);
if (strcmp(ptr,"-info_callback") == 0)
{
@@
-339,7
+346,7
@@
p5_SSL_set_options(ssl,...)
}
else
{
}
else
{
- croak("
SSLeay
::SSL::set_options(): unknown option");
+ croak("
OpenSSL
::SSL::set_options(): unknown option");
}
}
}
}
@@
-362,7
+369,9
@@
p5_SSL_DESTROY(ssl)
SSL *ssl;
CODE:
pr_name_dd("p5_SSL_DESTROY",ssl->references,ssl->ctx->references);
SSL *ssl;
CODE:
pr_name_dd("p5_SSL_DESTROY",ssl->references,ssl->ctx->references);
+#ifdef DEBUG
fprintf(stderr,"SSL_DESTROY %d\n",ssl->references);
fprintf(stderr,"SSL_DESTROY %d\n",ssl->references);
+#endif
SSL_free(ssl);
int
SSL_free(ssl);
int
@@
-421,7
+430,7
@@
p5_SSL_get_peer_certificate(ssl)
OUTPUT:
RETVAL
OUTPUT:
RETVAL
-MODULE =
SSLeay::SSL PACKAGE = SSLeay
::SSL::CIPHER PREFIX = p5_SSL_CIPHER_
+MODULE =
OpenSSL::SSL PACKAGE = OpenSSL
::SSL::CIPHER PREFIX = p5_SSL_CIPHER_
int
p5_SSL_CIPHER_get_bits(sc)
int
p5_SSL_CIPHER_get_bits(sc)
@@
-452,7
+461,7
@@
p5_SSL_CIPHER_get_name(sc)
OUTPUT:
RETVAL
OUTPUT:
RETVAL
-MODULE =
SSLeay::SSL PACKAGE = SSLeay
::BIO PREFIX = p5_BIO_
+MODULE =
OpenSSL::SSL PACKAGE = OpenSSL
::BIO PREFIX = p5_BIO_
void
p5_BIO_get_ssl(bio)
void
p5_BIO_get_ssl(bio)