Author: pghmcfc Update of /cvs/pkgs/rpms/perl-Net-SSLeay/devel In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv944 Modified Files: perl-Net-SSLeay.spec Added Files: perl-Net-SSLeay-svn252.patch Log Message: update to svn trunk (rev 252), needed due to omission of MD2 functionality from OpenSSL 1.0.0 (CPAN RT#48916) perl-Net-SSLeay-svn252.patch: Changes | 32 README.Win32 | 28 SSLeay.xs | 70 + constants.c | 12 lib/Net/SSLeay.pm | 404 ++++---- ppport.h | 2327 +++++++++++++++++++++++++++++++++++++++--------- t/local/00_ptr_cast.t | 11 t/local/06_tcpecho.t | 2 t/local/07_sslecho.t | 18 t/local/50_digest.t | 8 t/local/ptr_cast_test.c | 4 typemap | 2 12 files changed, 2315 insertions(+), 603 deletions(-) --- NEW FILE perl-Net-SSLeay-svn252.patch --- Index: typemap =================================================================== --- typemap (revision 230) +++ typemap (working copy) @@ -13,8 +13,10 @@ BIO * T_IV BIO_METHOD * T_IV EVP_PKEY * T_IV +const EVP_MD * T_IV CERT * T_IV LHASH * T_IV +struct lhash_st_SSL_SESSION * T_IV struct cert_st * T_IV X509_STORE_CTX * T_IV ASN1_UTCTIME * T_IV Index: SSLeay.xs =================================================================== --- SSLeay.xs (revision 230) +++ SSLeay.xs (working copy) @@ -89,18 +89,27 @@ */ #undef _ +/* Sigh: openssl 1.0 has + typedef void *BLOCK; +which conflicts with perls + typedef struct block BLOCK; +*/ +#define BLOCK OPENSSL_BLOCK #include <openssl/err.h> #include <openssl/lhash.h> #include <openssl/rand.h> #include <openssl/buffer.h> #include <openssl/ssl.h> #include <openssl/comp.h> /* openssl-0.9.6a forgets to include this */ +#ifndef OPENSSL_NO_MD2 #include <openssl/md2.h> +#endif #include <openssl/md4.h> #include <openssl/md5.h> /* openssl-SNAP-20020227 does not automatically include this */ #include <openssl/x509.h> #include <openssl/x509v3.h> #include <openssl/engine.h> +#undef BLOCK /* Debugging output */ @@ -470,7 +479,7 @@ return res; } -#ifdef SSL_F_SSL_SET_HELLO_EXTENSION +#if defined(SSL_F_SSL_SET_HELLO_EXTENSION) || defined(SSL_F_SSL_SET_SESSION_TICKET_EXT) static HV* ssleay_session_secret_cbs = (HV*)NULL; ssleay_session_secret_cb_t* @@ -1243,6 +1252,14 @@ SSL_CTX * ctx long op +#if OPENSSL_VERSION_NUMBER >= 0x10000000L + +struct lhash_st_SSL_SESSION * +SSL_CTX_sessions(ctx) + SSL_CTX * ctx + +#else + LHASH * SSL_CTX_sessions(ctx) SSL_CTX * ctx @@ -1253,6 +1270,8 @@ OUTPUT: RETVAL +#endif + unsigned long SSL_CTX_sess_number(ctx) SSL_CTX * ctx @@ -1499,9 +1518,6 @@ sv_setpvn( ST(0), buf, strlen(buf)); OPENSSL_free(buf); /* mem was allocated by openssl */ -# WTF is the point of this function? -# The NID_* constants aren't bound anyway and no one can remember -# those undocumented numbers anyway. void X509_NAME_get_text_by_NID(name,nid) X509_NAME * name @@ -1515,7 +1531,7 @@ New(0, buf, length+1, char); if (X509_NAME_get_text_by_NID(name, nid, buf, length + 1)) - sv_setpvn( ST(0), buf, length + 1); + sv_setpvn( ST(0), buf, length); Safefree(buf); X509 * @@ -1729,6 +1745,9 @@ sv_setpvn( ST(0), buffer, i ); BIO_free(bp); + +#ifndef OPENSSL_NO_MD2 + void MD2(data) PREINIT: @@ -1745,6 +1764,8 @@ XSRETURN_UNDEF; } +#endif + void MD4(data) PREINIT: @@ -1978,6 +1999,10 @@ SSL_CTX_set_cert_verify_callback(ctx, ssleay_ctx_cert_verify_cb_invoke, cb); } +X509_NAME_STACK * +SSL_CTX_get_client_CA_list(ctx) + SSL_CTX *ctx + void SSL_CTX_set_client_CA_list(ctx,list) SSL_CTX * ctx @@ -2124,11 +2149,15 @@ SSL_renegotiate(s) SSL * s +#if OPENSSL_VERSION_NUMBER < 0x10000000L + int SSL_SESSION_cmp(a,b) SSL_SESSION * a SSL_SESSION * b +#endif + void * SSL_SESSION_get_ex_data(ss,idx) SSL_SESSION * ss @@ -2167,6 +2196,23 @@ SSL_set_accept_state(s) SSL * s +void +sk_X509_NAME_free(sk) + X509_NAME_STACK *sk + +int +sk_X509_NAME_num(sk) + X509_NAME_STACK *sk + +X509_NAME * +sk_X509_NAME_value(sk,i) + X509_NAME_STACK *sk + int i + +X509_NAME_STACK * +SSL_get_client_CA_list(s) + SSL * s + void SSL_set_client_CA_list(s,list) SSL * s @@ -2637,7 +2683,7 @@ -#ifdef SSL_F_SSL_SET_HELLO_EXTENSION +#if defined(SSL_F_SSL_SET_HELLO_EXTENSION) int SSL_set_hello_extension(s, type, data) SSL * s @@ -2651,6 +2697,10 @@ OUTPUT: RETVAL +#endif + +#if defined(SSL_F_SSL_SET_HELLO_EXTENSION) || defined(SSL_F_SSL_SET_SESSION_TICKET_EXT) + void SSL_set_session_secret_cb(s,func,data=NULL) SSL * s @@ -2671,4 +2721,12 @@ #endif +int EVP_add_digest(const EVP_MD *digest) + +#ifndef OPENSSL_NO_SHA256 +const EVP_MD *EVP_sha256() + +#endif [...4901 lines suppressed...] #ifndef IS_NUMBER_NAN # define IS_NUMBER_NAN 0x20 #endif - -/* GROK_NUMERIC_RADIX depends on grok_numeric_radix */ #ifndef GROK_NUMERIC_RADIX # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send) #endif @@ -4407,7 +5798,7 @@ return TRUE; } } -#endif /* PERL_VERSION */ +#endif #endif /* USE_LOCALE_NUMERIC */ /* always try "." if numeric radix didn't match because * we may have data from different locales mixed */ @@ -4420,8 +5811,6 @@ #endif #endif -/* grok_number depends on grok_numeric_radix */ - #ifndef grok_number #if defined(NEED_grok_number) static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); @@ -4638,10 +6027,10 @@ #ifndef grok_bin #if defined(NEED_grok_bin) -static UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); +static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); static #else -extern UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); +extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); #endif #ifdef grok_bin @@ -4652,7 +6041,7 @@ #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL) UV -DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) +DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; @@ -4740,10 +6129,10 @@ #ifndef grok_hex #if defined(NEED_grok_hex) -static UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); +static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); static #else -extern UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); +extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); #endif #ifdef grok_hex @@ -4754,7 +6143,7 @@ #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL) UV -DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) +DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; @@ -4842,10 +6231,10 @@ #ifndef grok_oct #if defined(NEED_grok_oct) -static UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); +static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); static #else -extern UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); +extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result); #endif #ifdef grok_oct @@ -4856,7 +6245,7 @@ #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL) UV -DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) +DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; @@ -4933,6 +6322,40 @@ #endif #endif +#if !defined(my_snprintf) +#if defined(NEED_my_snprintf) +static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...); +static +#else +extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...); +#endif + +#define my_snprintf DPPP_(my_my_snprintf) +#define Perl_my_snprintf DPPP_(my_my_snprintf) + +#if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL) + +int +DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...) +{ + dTHX; + int retval; + va_list ap; + va_start(ap, format); +#ifdef HAS_VSNPRINTF + retval = vsnprintf(buffer, len, format, ap); +#else + retval = vsprintf(buffer, format, ap); +#endif + va_end(ap); + if (retval >= (int)len) + Perl_croak(aTHX_ "panic: my_snprintf buffer overflow"); + return retval; +} + +#endif +#endif + #ifdef NO_XSLOCKS # ifdef dJMPENV # define dXCPT dJMPENV; int rEtV = 0 @@ -4949,6 +6372,66 @@ # endif #endif +#if !defined(my_strlcat) +#if defined(NEED_my_strlcat) +static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); +static +#else +extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); +#endif + +#define my_strlcat DPPP_(my_my_strlcat) +#define Perl_my_strlcat DPPP_(my_my_strlcat) + +#if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL) + +Size_t +DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size) +{ + Size_t used, length, copy; + + used = strlen(dst); + length = strlen(src); + if (size > 0 && used < size - 1) { + copy = (length >= size - used) ? size - used - 1 : length; + memcpy(dst + used, src, copy); + dst[used + copy] = '\0'; + } + return used + length; +} +#endif +#endif + +#if !defined(my_strlcpy) +#if defined(NEED_my_strlcpy) +static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); +static +#else +extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); +#endif + +#define my_strlcpy DPPP_(my_my_strlcpy) +#define Perl_my_strlcpy DPPP_(my_my_strlcpy) + +#if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL) + +Size_t +DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size) +{ + Size_t length, copy; + + length = strlen(src); + if (size > 0) { + copy = (length >= size) ? size - 1 : length; + memcpy(dst, src, copy); + dst[copy] = '\0'; + } + return length; +} + +#endif +#endif + #endif /* _P_P_PORTABILITY_H_ */ /* End of File ppport.h */ Index: perl-Net-SSLeay.spec =================================================================== RCS file: /cvs/pkgs/rpms/perl-Net-SSLeay/devel/perl-Net-SSLeay.spec,v retrieving revision 1.16 retrieving revision 1.17 diff -u -p -r1.16 -r1.17 --- perl-Net-SSLeay.spec 21 Aug 2009 15:22:21 -0000 1.16 +++ perl-Net-SSLeay.spec 22 Aug 2009 20:18:27 -0000 1.17 @@ -1,11 +1,12 @@ Name: perl-Net-SSLeay Version: 1.35 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Perl extension for using OpenSSL Group: Development/Libraries License: OpenSSL URL: http://search.cpan.org/dist/Net-SSLeay/ Source0: http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Net-SSLeay-%{version}.tar.gz +Patch0: perl-Net-SSLeay-svn252.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildRequires: perl(ExtUtils::MakeMaker), openssl-devel @@ -28,6 +29,10 @@ so you can write servers or clients for %prep %setup -q -n Net-SSLeay-%{version} + +# Upstream patch removing MD2 support, needed for OpenSSL 1.0 +%patch0 + %{__chmod} -c 644 examples/* %{__perl} -pi -e 's|/usr/local/bin/perl|%{__perl}|' examples/*.pl for f in Credits lib/Net/SSLeay.pm; do @@ -66,11 +71,15 @@ PERL_MM_USE_DEFAULT=1 %{__perl} Makefile %{_mandir}/man3/Net::SSLeay*.3* %changelog +* Sat Aug 22 2009 Paul Howarth <paul@xxxxxxxxxxxx> - 1.35-7 +- update to svn trunk (rev 252), needed due to omission of MD2 functionality + from OpenSSL 1.0.0 (CPAN RT#48916) + * Fri Aug 21 2009 Tomas Mraz <tmraz@xxxxxxxxxx> - 1.35-6 - rebuilt with new openssl * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@xxxxxxxxxxxxxxxxxxxxxxx> - 1.35-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild +- rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sun Mar 8 2009 Paul Howarth <paul@xxxxxxxxxxxx> - 1.35-4 - filter out unwanted provides for perl shared objects -- Fedora Extras Perl SIG http://www.fedoraproject.org/wiki/Extras/SIGs/Perl Fedora-perl-devel-list mailing list Fedora-perl-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/fedora-perl-devel-list