Changes of Revision 18
[-] [+] | Changed | nagios-mod_gearman.changes |
[-] [+] | Changed | nagios-mod_gearman.spec ^ |
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/Changes ^ |
@@ -1,5 +1,13 @@ This file documents the revision history for mod_gearman. +1.1.1 Thu Nov 10 11:15:48 CET 2011 + - check_gearman can now send background jobs (Justin Kerr Sheckler) + - fixed problem which skipped some checks when they were rescheduled + by the core smart scheduler + - use md5sum a uniq key for long host/servicesnames + this fixes a possible lost jobs when 2 very long host/servicesnames + are scheduled at the same time + 1.1.0 Wed Oct 12 18:36:10 CEST 2011 - fixed send_multi performance data headers - fixed segfault when worker runs into timeout | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/Makefile.am ^ |
@@ -13,7 +13,7 @@ .PHONY: docs # -g adds debug symbols, -s strips -CFLAGS=-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -s -O -fPIC +CFLAGS=-Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -g -O -fPIC # for debugging #CFLAGS=-pedantic -Wfatal-errors -Wall -W -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -g3 -O -fPIC AM_CPPFLAGS=-Iinclude @@ -26,6 +26,7 @@ common/gearman.c \ common/gearman_utils.c \ common/utils.c \ + common/md5.c \ common/popenRWE.c pkglib_LIBRARIES = mod_gearman.so @@ -131,10 +132,10 @@ @echo "################################################################" distclean-local: clean - $(RM) -rf .deps/ Makefile.in aclocal.m4 autom4te.cache config.* configure depcomp install-sh missing *.gz + $(RM) -f .deps/ Makefile.in aclocal.m4 autom4te.cache config.* configure depcomp install-sh missing *.gz clean-local: - $(RM) -rf worker.static worker/initscript etc/mod_gearman.conf rpm.topdir *.o */*.o + $(RM) -f worker.static worker/initscript etc/mod_gearman.conf rpm.topdir *.o */*.o worker.static: worker @echo "################################################################" @@ -221,7 +222,7 @@ cp -p README.asciidoc docs/README && cd docs && asciidoc --unsafe -a toc -a toclevels=2 -a max-width=800 README chmod 644 docs/README.html $(DOS2UNIX) docs/README.html - rm -f docs/README + $(RM) -f docs/README cd docs && asciidoc --unsafe -a toc -a toclevels=2 -a max-width=800 QUICKSTART chmod 644 docs/QUICKSTART.html $(DOS2UNIX) docs/QUICKSTART.html @@ -233,7 +234,7 @@ --buildroot=$$(pwd)/rpm.buildroot support/mod_gearman.spec mv -v $(RPM_TOPDIR)/RPMS/*/*.rpm . mv -v $(RPM_TOPDIR)/SRPMS/*.src.rpm . - rm -rf $(RPM_TOPDIR) rpm.buildroot + $(RM) -f $(RPM_TOPDIR) rpm.buildroot deb: dpkg-buildpackage -us -uc | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/Makefile.in ^ |
@@ -93,7 +93,7 @@ am__objects_1 = common/base64.$(OBJEXT) common/crypt.$(OBJEXT) \ common/rijndael.$(OBJEXT) common/gearman.$(OBJEXT) \ common/gearman_utils.$(OBJEXT) common/utils.$(OBJEXT) \ - common/popenRWE.$(OBJEXT) + common/md5.$(OBJEXT) common/popenRWE.$(OBJEXT) am_mod_gearman_so_OBJECTS = $(am__objects_1) \ neb_module/result_thread.$(OBJEXT) \ neb_module/mod_gearman.$(OBJEXT) @@ -185,7 +185,7 @@ CCDEPMODE = @CCDEPMODE@ # -g adds debug symbols, -s strips -CFLAGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -s -O -fPIC +CFLAGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -g -O -fPIC CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ @@ -285,6 +285,7 @@ common/gearman.c \ common/gearman_utils.c \ common/utils.c \ + common/md5.c \ common/popenRWE.c pkglib_LIBRARIES = mod_gearman.so @@ -438,6 +439,8 @@ common/$(DEPDIR)/$(am__dirstamp) common/utils.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) +common/md5.$(OBJEXT): common/$(am__dirstamp) \ + common/$(DEPDIR)/$(am__dirstamp) common/popenRWE.$(OBJEXT): common/$(am__dirstamp) \ common/$(DEPDIR)/$(am__dirstamp) neb_module/$(am__dirstamp): @@ -573,6 +576,7 @@ -rm -f common/crypt.$(OBJEXT) -rm -f common/gearman.$(OBJEXT) -rm -f common/gearman_utils.$(OBJEXT) + -rm -f common/md5.$(OBJEXT) -rm -f common/popenRWE.$(OBJEXT) -rm -f common/rijndael.$(OBJEXT) -rm -f common/utils.$(OBJEXT) @@ -599,6 +603,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/crypt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/gearman.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/gearman_utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/popenRWE.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/rijndael.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@common/$(DEPDIR)/utils.Po@am__quote@ @@ -1114,10 +1119,10 @@ @echo "################################################################" distclean-local: clean - $(RM) -rf .deps/ Makefile.in aclocal.m4 autom4te.cache config.* configure depcomp install-sh missing *.gz + $(RM) -f .deps/ Makefile.in aclocal.m4 autom4te.cache config.* configure depcomp install-sh missing *.gz clean-local: - $(RM) -rf worker.static worker/initscript etc/mod_gearman.conf rpm.topdir *.o */*.o + $(RM) -f worker.static worker/initscript etc/mod_gearman.conf rpm.topdir *.o */*.o worker.static: worker @echo "################################################################" @@ -1203,7 +1208,7 @@ cp -p README.asciidoc docs/README && cd docs && asciidoc --unsafe -a toc -a toclevels=2 -a max-width=800 README chmod 644 docs/README.html $(DOS2UNIX) docs/README.html - rm -f docs/README + $(RM) -f docs/README cd docs && asciidoc --unsafe -a toc -a toclevels=2 -a max-width=800 QUICKSTART chmod 644 docs/QUICKSTART.html $(DOS2UNIX) docs/QUICKSTART.html @@ -1215,7 +1220,7 @@ --buildroot=$$(pwd)/rpm.buildroot support/mod_gearman.spec mv -v $(RPM_TOPDIR)/RPMS/*/*.rpm . mv -v $(RPM_TOPDIR)/SRPMS/*.src.rpm . - rm -rf $(RPM_TOPDIR) rpm.buildroot + $(RM) -f $(RPM_TOPDIR) rpm.buildroot deb: dpkg-buildpackage -us -uc | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/README ^ |
@@ -25,7 +25,7 @@ Download -------- -* Latest stable release http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz[version 1.1.0] from October 12 2011 +* Latest stable release http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz[version 1.1.1] from November 10 2011 * Mod Gearman is available for download at: http://labs.consol.de/nagios/mod-gearman * Source is available at GitHub: http://github.com/sni/mod_gearman * Older versions are available in the <<_archive,download archive>>. @@ -840,6 +840,7 @@ Archive ------- +* http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz[version 1.1.1 - November 10 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz[version 1.1.0 - October 12 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.10.tar.gz[version 1.0.10 - August 28 2011] * http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.0.9.tar.gz[version 1.0.9 - August 16 2011] | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/THANKS ^ |
@@ -19,3 +19,7 @@ Thanks to www.jukie.net/bart/blog/popenRWE for the popenRWE code. + +Thanks to +http://polarssl.org +for the MD5 implementation | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/common/gearman.c ^ |
@@ -176,7 +176,7 @@ /* cut off to long uniq ids */ free_uniq = 0; if(uniq != NULL && strlen(uniq) > 63) { - uniq = strndup(uniq, 63); + uniq = md5sum(uniq); free_uniq = 1; } | ||
[-] [+] | Added | mod_gearman-1.1.1.tar.bz2/common/md5.c ^ |
@@ -0,0 +1,583 @@ +/* + * RFC 1321 compliant MD5 implementation + * + * Copyright (C) 2006-2010, Brainspark B.V. + * + * This file is part of PolarSSL (http://www.polarssl.org) + * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +/* + * The MD5 algorithm was designed by Ron Rivest in 1991. + * + * http://www.ietf.org/rfc/rfc1321.txt + */ + +#include "polarssl/config.h" + +#if defined(POLARSSL_MD5_C) + +#include "polarssl/md5.h" + +#if defined(POLARSSL_FS_IO) || defined(POLARSSL_SELF_TEST) +#include <stdio.h> +#endif + +/* + * 32-bit integer manipulation macros (little endian) + */ +#ifndef GET_ULONG_LE +#define GET_ULONG_LE(n,b,i) \ +{ \ + (n) = ( (unsigned long) (b)[(i) ] ) \ + | ( (unsigned long) (b)[(i) + 1] << 8 ) \ + | ( (unsigned long) (b)[(i) + 2] << 16 ) \ + | ( (unsigned long) (b)[(i) + 3] << 24 ); \ +} +#endif + +#ifndef PUT_ULONG_LE +#define PUT_ULONG_LE(n,b,i) \ +{ \ + (b)[(i) ] = (unsigned char) ( (n) ); \ + (b)[(i) + 1] = (unsigned char) ( (n) >> 8 ); \ + (b)[(i) + 2] = (unsigned char) ( (n) >> 16 ); \ + (b)[(i) + 3] = (unsigned char) ( (n) >> 24 ); \ +} +#endif + +/* + * MD5 context setup + */ +void md5_starts( md5_context *ctx ) +{ + ctx->total[0] = 0; + ctx->total[1] = 0; + + ctx->state[0] = 0x67452301; + ctx->state[1] = 0xEFCDAB89; + ctx->state[2] = 0x98BADCFE; + ctx->state[3] = 0x10325476; +} + +static void md5_process( md5_context *ctx, const unsigned char data[64] ) +{ + unsigned long X[16], A, B, C, D; + + GET_ULONG_LE( X[ 0], data, 0 ); + GET_ULONG_LE( X[ 1], data, 4 ); + GET_ULONG_LE( X[ 2], data, 8 ); + GET_ULONG_LE( X[ 3], data, 12 ); + GET_ULONG_LE( X[ 4], data, 16 ); + GET_ULONG_LE( X[ 5], data, 20 ); + GET_ULONG_LE( X[ 6], data, 24 ); + GET_ULONG_LE( X[ 7], data, 28 ); + GET_ULONG_LE( X[ 8], data, 32 ); + GET_ULONG_LE( X[ 9], data, 36 ); + GET_ULONG_LE( X[10], data, 40 ); + GET_ULONG_LE( X[11], data, 44 ); + GET_ULONG_LE( X[12], data, 48 ); + GET_ULONG_LE( X[13], data, 52 ); + GET_ULONG_LE( X[14], data, 56 ); + GET_ULONG_LE( X[15], data, 60 ); + +#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) + +#define P(a,b,c,d,k,s,t) \ +{ \ + a += F(b,c,d) + X[k] + t; a = S(a,s) + b; \ +} + + A = ctx->state[0]; + B = ctx->state[1]; + C = ctx->state[2]; + D = ctx->state[3]; + +#define F(x,y,z) (z ^ (x & (y ^ z))) + + P( A, B, C, D, 0, 7, 0xD76AA478 ); + P( D, A, B, C, 1, 12, 0xE8C7B756 ); + P( C, D, A, B, 2, 17, 0x242070DB ); + P( B, C, D, A, 3, 22, 0xC1BDCEEE ); + P( A, B, C, D, 4, 7, 0xF57C0FAF ); + P( D, A, B, C, 5, 12, 0x4787C62A ); + P( C, D, A, B, 6, 17, 0xA8304613 ); + P( B, C, D, A, 7, 22, 0xFD469501 ); + P( A, B, C, D, 8, 7, 0x698098D8 ); + P( D, A, B, C, 9, 12, 0x8B44F7AF ); + P( C, D, A, B, 10, 17, 0xFFFF5BB1 ); + P( B, C, D, A, 11, 22, 0x895CD7BE ); + P( A, B, C, D, 12, 7, 0x6B901122 ); + P( D, A, B, C, 13, 12, 0xFD987193 ); + P( C, D, A, B, 14, 17, 0xA679438E ); + P( B, C, D, A, 15, 22, 0x49B40821 ); + +#undef F + +#define F(x,y,z) (y ^ (z & (x ^ y))) + + P( A, B, C, D, 1, 5, 0xF61E2562 ); + P( D, A, B, C, 6, 9, 0xC040B340 ); + P( C, D, A, B, 11, 14, 0x265E5A51 ); + P( B, C, D, A, 0, 20, 0xE9B6C7AA ); + P( A, B, C, D, 5, 5, 0xD62F105D ); + P( D, A, B, C, 10, 9, 0x02441453 ); + P( C, D, A, B, 15, 14, 0xD8A1E681 ); + P( B, C, D, A, 4, 20, 0xE7D3FBC8 ); + P( A, B, C, D, 9, 5, 0x21E1CDE6 ); + P( D, A, B, C, 14, 9, 0xC33707D6 ); + P( C, D, A, B, 3, 14, 0xF4D50D87 ); + P( B, C, D, A, 8, 20, 0x455A14ED ); + P( A, B, C, D, 13, 5, 0xA9E3E905 ); + P( D, A, B, C, 2, 9, 0xFCEFA3F8 ); + P( C, D, A, B, 7, 14, 0x676F02D9 ); + P( B, C, D, A, 12, 20, 0x8D2A4C8A ); + +#undef F + +#define F(x,y,z) (x ^ y ^ z) + + P( A, B, C, D, 5, 4, 0xFFFA3942 ); + P( D, A, B, C, 8, 11, 0x8771F681 ); + P( C, D, A, B, 11, 16, 0x6D9D6122 ); + P( B, C, D, A, 14, 23, 0xFDE5380C ); + P( A, B, C, D, 1, 4, 0xA4BEEA44 ); + P( D, A, B, C, 4, 11, 0x4BDECFA9 ); + P( C, D, A, B, 7, 16, 0xF6BB4B60 ); + P( B, C, D, A, 10, 23, 0xBEBFBC70 ); + P( A, B, C, D, 13, 4, 0x289B7EC6 ); + P( D, A, B, C, 0, 11, 0xEAA127FA ); + P( C, D, A, B, 3, 16, 0xD4EF3085 ); + P( B, C, D, A, 6, 23, 0x04881D05 ); + P( A, B, C, D, 9, 4, 0xD9D4D039 ); + P( D, A, B, C, 12, 11, 0xE6DB99E5 ); + P( C, D, A, B, 15, 16, 0x1FA27CF8 ); + P( B, C, D, A, 2, 23, 0xC4AC5665 ); + +#undef F + +#define F(x,y,z) (y ^ (x | ~z)) + + P( A, B, C, D, 0, 6, 0xF4292244 ); + P( D, A, B, C, 7, 10, 0x432AFF97 ); + P( C, D, A, B, 14, 15, 0xAB9423A7 ); + P( B, C, D, A, 5, 21, 0xFC93A039 ); + P( A, B, C, D, 12, 6, 0x655B59C3 ); + P( D, A, B, C, 3, 10, 0x8F0CCC92 ); + P( C, D, A, B, 10, 15, 0xFFEFF47D ); + P( B, C, D, A, 1, 21, 0x85845DD1 ); + P( A, B, C, D, 8, 6, 0x6FA87E4F ); + P( D, A, B, C, 15, 10, 0xFE2CE6E0 ); + P( C, D, A, B, 6, 15, 0xA3014314 ); + P( B, C, D, A, 13, 21, 0x4E0811A1 ); + P( A, B, C, D, 4, 6, 0xF7537E82 ); + P( D, A, B, C, 11, 10, 0xBD3AF235 ); + P( C, D, A, B, 2, 15, 0x2AD7D2BB ); + P( B, C, D, A, 9, 21, 0xEB86D391 ); + +#undef F + + ctx->state[0] += A; + ctx->state[1] += B; + ctx->state[2] += C; + ctx->state[3] += D; +} + +/* + * MD5 process buffer + */ +void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen ) +{ + size_t fill; + unsigned long left; + + if( ilen <= 0 ) + return; + + left = ctx->total[0] & 0x3F; + fill = 64 - left; + + ctx->total[0] += (unsigned long) ilen; + ctx->total[0] &= 0xFFFFFFFF; + + if( ctx->total[0] < (unsigned long) ilen ) + ctx->total[1]++; + + if( left && ilen >= fill ) + { + memcpy( (void *) (ctx->buffer + left), + (void *) input, fill ); + md5_process( ctx, ctx->buffer ); + input += fill; + ilen -= fill; + left = 0; + } + + while( ilen >= 64 ) + { + md5_process( ctx, input ); + input += 64; + ilen -= 64; + } + + if( ilen > 0 ) + { + memcpy( (void *) (ctx->buffer + left), + (void *) input, ilen ); + } +} + +static const unsigned char md5_padding[64] = +{ + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* + * MD5 final digest + */ +void md5_finish( md5_context *ctx, unsigned char output[16] ) +{ + unsigned long last, padn; + unsigned long high, low; + unsigned char msglen[8]; + + high = ( ctx->total[0] >> 29 ) + | ( ctx->total[1] << 3 ); + low = ( ctx->total[0] << 3 ); + + PUT_ULONG_LE( low, msglen, 0 ); + PUT_ULONG_LE( high, msglen, 4 ); + + last = ctx->total[0] & 0x3F; + padn = ( last < 56 ) ? ( 56 - last ) : ( 120 - last ); + + md5_update( ctx, (unsigned char *) md5_padding, padn ); + md5_update( ctx, msglen, 8 ); + + PUT_ULONG_LE( ctx->state[0], output, 0 ); + PUT_ULONG_LE( ctx->state[1], output, 4 ); + PUT_ULONG_LE( ctx->state[2], output, 8 ); + PUT_ULONG_LE( ctx->state[3], output, 12 ); +} + +/* + * output = MD5( input buffer ) + */ +void md5( const unsigned char *input, size_t ilen, unsigned char output[16] ) +{ + md5_context ctx; + + md5_starts( &ctx ); + md5_update( &ctx, input, ilen ); + md5_finish( &ctx, output ); + + memset( &ctx, 0, sizeof( md5_context ) ); +} + +#if defined(POLARSSL_FS_IO) +/* + * output = MD5( file contents ) + */ +int md5_file( const char *path, unsigned char output[16] ) +{ + FILE *f; + size_t n; + md5_context ctx; + unsigned char buf[1024]; + + if( ( f = fopen( path, "rb" ) ) == NULL ) + return( 1 ); + + md5_starts( &ctx ); + + while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 ) + md5_update( &ctx, buf, n ); + + md5_finish( &ctx, output ); + + memset( &ctx, 0, sizeof( md5_context ) ); + + if( ferror( f ) != 0 ) + { + fclose( f ); + return( 2 ); + } + + fclose( f ); + return( 0 ); +} +#endif /* POLARSSL_FS_IO */ + +/* + * MD5 HMAC context setup + */ +void md5_hmac_starts( md5_context *ctx, const unsigned char *key, size_t keylen ) +{ + size_t i; + unsigned char sum[16]; + + if( keylen > 64 ) + { + md5( key, keylen, sum ); + keylen = 16; + key = sum; + } + + memset( ctx->ipad, 0x36, 64 ); + memset( ctx->opad, 0x5C, 64 ); + + for( i = 0; i < keylen; i++ ) + { + ctx->ipad[i] = (unsigned char)( ctx->ipad[i] ^ key[i] ); + ctx->opad[i] = (unsigned char)( ctx->opad[i] ^ key[i] ); + } + + md5_starts( ctx ); + md5_update( ctx, ctx->ipad, 64 ); + + memset( sum, 0, sizeof( sum ) ); +} + +/* + * MD5 HMAC process buffer + */ +void md5_hmac_update( md5_context *ctx, const unsigned char *input, size_t ilen ) +{ + md5_update( ctx, input, ilen ); +} + +/* + * MD5 HMAC final digest + */ +void md5_hmac_finish( md5_context *ctx, unsigned char output[16] ) +{ + unsigned char tmpbuf[16]; + + md5_finish( ctx, tmpbuf ); + md5_starts( ctx ); + md5_update( ctx, ctx->opad, 64 ); + md5_update( ctx, tmpbuf, 16 ); + md5_finish( ctx, output ); + + memset( tmpbuf, 0, sizeof( tmpbuf ) ); +} + +/* + * MD5 HMAC context reset + */ +void md5_hmac_reset( md5_context *ctx ) +{ + md5_starts( ctx ); + md5_update( ctx, ctx->ipad, 64 ); +} + +/* + * output = HMAC-MD5( hmac key, input buffer ) + */ +void md5_hmac( const unsigned char *key, size_t keylen, + const unsigned char *input, size_t ilen, + unsigned char output[16] ) +{ + md5_context ctx; + + md5_hmac_starts( &ctx, key, keylen ); + md5_hmac_update( &ctx, input, ilen ); + md5_hmac_finish( &ctx, output ); + + memset( &ctx, 0, sizeof( md5_context ) ); +} + +#if defined(POLARSSL_SELF_TEST) +/* + * RFC 1321 test vectors + */ +static unsigned char md5_test_buf[7][81] = +{ + { "" }, + { "a" }, + { "abc" }, + { "message digest" }, + { "abcdefghijklmnopqrstuvwxyz" }, + { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" }, + { "12345678901234567890123456789012345678901234567890123456789012" \ + "345678901234567890" } +}; + +static const int md5_test_buflen[7] = +{ + 0, 1, 3, 14, 26, 62, 80 +}; + +static const unsigned char md5_test_sum[7][16] = +{ + { 0xD4, 0x1D, 0x8C, 0xD9, 0x8F, 0x00, 0xB2, 0x04, + 0xE9, 0x80, 0x09, 0x98, 0xEC, 0xF8, 0x42, 0x7E }, + { 0x0C, 0xC1, 0x75, 0xB9, 0xC0, 0xF1, 0xB6, 0xA8, + 0x31, 0xC3, 0x99, 0xE2, 0x69, 0x77, 0x26, 0x61 }, + { 0x90, 0x01, 0x50, 0x98, 0x3C, 0xD2, 0x4F, 0xB0, + 0xD6, 0x96, 0x3F, 0x7D, 0x28, 0xE1, 0x7F, 0x72 }, + { 0xF9, 0x6B, 0x69, 0x7D, 0x7C, 0xB7, 0x93, 0x8D, + 0x52, 0x5A, 0x2F, 0x31, 0xAA, 0xF1, 0x61, 0xD0 }, + { 0xC3, 0xFC, 0xD3, 0xD7, 0x61, 0x92, 0xE4, 0x00, + 0x7D, 0xFB, 0x49, 0x6C, 0xCA, 0x67, 0xE1, 0x3B }, + { 0xD1, 0x74, 0xAB, 0x98, 0xD2, 0x77, 0xD9, 0xF5, + 0xA5, 0x61, 0x1C, 0x2C, 0x9F, 0x41, 0x9D, 0x9F }, + { 0x57, 0xED, 0xF4, 0xA2, 0x2B, 0xE3, 0xC9, 0x55, + 0xAC, 0x49, 0xDA, 0x2E, 0x21, 0x07, 0xB6, 0x7A } +}; + +/* + * RFC 2202 test vectors + */ +static unsigned char md5_hmac_test_key[7][26] = +{ + { "\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B\x0B" }, + { "Jefe" }, + { "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA" }, + { "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10" + "\x11\x12\x13\x14\x15\x16\x17\x18\x19" }, + { "\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C\x0C" }, + { "" }, /* 0xAA 80 times */ + { "" } +}; + +static const int md5_hmac_test_keylen[7] = +{ + 16, 4, 16, 25, 16, 80, 80 +}; + +static unsigned char md5_hmac_test_buf[7][74] = +{ + { "Hi There" }, + { "what do ya want for nothing?" }, + { "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" }, + { "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" + "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD" }, + { "Test With Truncation" }, + { "Test Using Larger Than Block-Size Key - Hash Key First" }, + { "Test Using Larger Than Block-Size Key and Larger" + " Than One Block-Size Data" } +}; + +static const int md5_hmac_test_buflen[7] = +{ + 8, 28, 50, 50, 20, 54, 73 +}; + +static const unsigned char md5_hmac_test_sum[7][16] = +{ + { 0x92, 0x94, 0x72, 0x7A, 0x36, 0x38, 0xBB, 0x1C, + 0x13, 0xF4, 0x8E, 0xF8, 0x15, 0x8B, 0xFC, 0x9D }, + { 0x75, 0x0C, 0x78, 0x3E, 0x6A, 0xB0, 0xB5, 0x03, + 0xEA, 0xA8, 0x6E, 0x31, 0x0A, 0x5D, 0xB7, 0x38 }, + { 0x56, 0xBE, 0x34, 0x52, 0x1D, 0x14, 0x4C, 0x88, + 0xDB, 0xB8, 0xC7, 0x33, 0xF0, 0xE8, 0xB3, 0xF6 }, + { 0x69, 0x7E, 0xAF, 0x0A, 0xCA, 0x3A, 0x3A, 0xEA, + 0x3A, 0x75, 0x16, 0x47, 0x46, 0xFF, 0xAA, 0x79 }, + { 0x56, 0x46, 0x1E, 0xF2, 0x34, 0x2E, 0xDC, 0x00, + 0xF9, 0xBA, 0xB9, 0x95 }, + { 0x6B, 0x1A, 0xB7, 0xFE, 0x4B, 0xD7, 0xBF, 0x8F, + 0x0B, 0x62, 0xE6, 0xCE, 0x61, 0xB9, 0xD0, 0xCD }, + { 0x6F, 0x63, 0x0F, 0xAD, 0x67, 0xCD, 0xA0, 0xEE, + 0x1F, 0xB1, 0xF5, 0x62, 0xDB, 0x3A, 0xA5, 0x3E } +}; + +/* + * Checkup routine + */ +int md5_self_test( int verbose ) +{ + int i, buflen; + unsigned char buf[1024]; + unsigned char md5sum[16]; + md5_context ctx; + + for( i = 0; i < 7; i++ ) + { + if( verbose != 0 ) + printf( " MD5 test #%d: ", i + 1 ); + + md5( md5_test_buf[i], md5_test_buflen[i], md5sum ); + + if( memcmp( md5sum, md5_test_sum[i], 16 ) != 0 ) + { + if( verbose != 0 ) + printf( "failed\n" ); + + return( 1 ); + } + + if( verbose != 0 ) + printf( "passed\n" ); + } + + if( verbose != 0 ) + printf( "\n" ); + + for( i = 0; i < 7; i++ ) + { + if( verbose != 0 ) + printf( " HMAC-MD5 test #%d: ", i + 1 ); + + if( i == 5 || i == 6 ) + { + memset( buf, '\xAA', buflen = 80 ); + md5_hmac_starts( &ctx, buf, buflen ); + } + else + md5_hmac_starts( &ctx, md5_hmac_test_key[i], + md5_hmac_test_keylen[i] ); + + md5_hmac_update( &ctx, md5_hmac_test_buf[i], + md5_hmac_test_buflen[i] ); + + md5_hmac_finish( &ctx, md5sum ); + + buflen = ( i == 4 ) ? 12 : 16; + + if( memcmp( md5sum, md5_hmac_test_sum[i], buflen ) != 0 ) + { + if( verbose != 0 ) + printf( "failed\n" ); + + return( 1 ); + } + + if( verbose != 0 ) + printf( "passed\n" ); + } + + if( verbose != 0 ) + printf( "\n" ); + + return( 0 ); +} + +#endif + +#endif | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/common/utils.c ^ |
@@ -26,6 +26,7 @@ #include "base64.h" #include "gearman.h" #include "popenRWE.h" +#include "polarssl/md5.h" pid_t current_child_pid = 0; char temp_buffer1[GM_BUFFERSIZE]; @@ -1992,7 +1993,7 @@ gm_log( GM_LOG_TRACE, "queue: %s\n", exec_job->result_queue ); temp_buffer1[0]='\x0'; - snprintf( temp_buffer1, sizeof( temp_buffer1 )-1, "host_name=%s\ncore_start_time=%i.%i\nstart_time=%i.%i\nfinish_time=%i.%i\nlatency=%f\nreturn_code=%i\nexited_ok=%i\n", + snprintf( temp_buffer1, sizeof( temp_buffer1 )-1, "host_name=%s\ncore_start_time=%i.%i\nstart_time=%i.%i\nfinish_time=%i.%i\nreturn_code=%i\nexited_ok=%i\n", exec_job->host_name, ( int )exec_job->core_start_time.tv_sec, ( int )exec_job->core_start_time.tv_usec, @@ -2000,7 +2001,6 @@ ( int )exec_job->start_time.tv_usec, ( int )exec_job->finish_time.tv_sec, ( int )exec_job->finish_time.tv_usec, - exec_job->latency, exec_job->return_code, exec_job->exited_ok ); @@ -2082,3 +2082,20 @@ return; } + + +/* create md5 sum for char[] */ +char *md5sum(char *text) { + unsigned char sum[16]; + char *result=NULL; + + /* allocate enough memory to escape all chars if necessary */ + if((result=malloc(33))==NULL) + return NULL; + + md5((unsigned char *)text, strlen(text), sum); + snprintf(result, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + sum[0],sum[1],sum[2],sum[3],sum[4],sum[5],sum[6],sum[7],sum[8],sum[9],sum[10],sum[11],sum[12],sum[13],sum[14],sum[15]); + + return result; +} | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/configure ^ |
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for mod_gearman 1.1.0. +# Generated by GNU Autoconf 2.65 for mod_gearman 1.1.1. # # Report bugs to <sven.nierlein@consol.de>. # @@ -552,8 +552,8 @@ # Identity of this package. PACKAGE_NAME='mod_gearman' PACKAGE_TARNAME='mod_gearman' -PACKAGE_VERSION='1.1.0' -PACKAGE_STRING='mod_gearman 1.1.0' +PACKAGE_VERSION='1.1.1' +PACKAGE_STRING='mod_gearman 1.1.1' PACKAGE_BUGREPORT='sven.nierlein@consol.de' PACKAGE_URL='' @@ -1249,7 +1249,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures mod_gearman 1.1.0 to adapt to many kinds of systems. +\`configure' configures mod_gearman 1.1.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1315,7 +1315,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of mod_gearman 1.1.0:";; + short | recursive ) echo "Configuration of mod_gearman 1.1.1:";; esac cat <<\_ACEOF @@ -1412,7 +1412,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -mod_gearman configure 1.1.0 +mod_gearman configure 1.1.1 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -1875,7 +1875,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by mod_gearman $as_me 1.1.0, which was +It was created by mod_gearman $as_me 1.1.1, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2683,7 +2683,7 @@ # Define the identity of the package. PACKAGE='mod_gearman' - VERSION='1.1.0' + VERSION='1.1.1' cat >>confdefs.h <<_ACEOF @@ -5923,7 +5923,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by mod_gearman $as_me 1.1.0, which was +This file was extended by mod_gearman $as_me 1.1.1, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5989,7 +5989,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -mod_gearman config.status 1.1.0 +mod_gearman config.status 1.1.1 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/configure.ac ^ |
@@ -3,7 +3,7 @@ ############################################## AC_PREREQ([2.59]) -AC_INIT([mod_gearman], [1.1.0], [sven.nierlein@consol.de]) +AC_INIT([mod_gearman], [1.1.1], [sven.nierlein@consol.de]) AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) AC_CONFIG_SRCDIR([neb_module/mod_gearman.c],[worker/worker.c],[tools/send_gearman.c],[tools/check_gearman.c],[tools/gearman_top.c]) AC_CONFIG_HEADER([config.h]) | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/docs/QUICKSTART ^ |
@@ -52,9 +52,9 @@ -------------------------------------- #> cd /tmp -#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz" -#> tar zxf mod_gearman-1.1.0.tar.gz -#> cd mod_gearman-1.1.0 +#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz" +#> tar zxf mod_gearman-1.1.1.tar.gz +#> cd mod_gearman-1.1.1 #> ./configure --prefix=/opt --with-gearman=/opt --with-user=nagios --with-init-dir=/etc/init.d #> make #> make install @@ -118,7 +118,7 @@ -------------------------------------- #> grep mod_gearman /var/log/nagios3/nagios.log -[1295003042] mod_gearman: Version 1.1.0 +[1295003042] mod_gearman: Version 1.1.1 [1295003042] Event broker module '/opt/lib/mod_gearman/mod_gearman.o' initialized successfully. -------------------------------------- @@ -152,7 +152,7 @@ -------------------------------------- #> /opt/bin/check_gearman -H localhost -q worker_`hostname` -t 10 -s check -check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.1.0|worker=1 jobs=2c +check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.1.1|worker=1 jobs=2c -------------------------------------- The interesting number is the last one, '2c' in our case, which means there | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/docs/QUICKSTART.html ^ |
@@ -606,9 +606,9 @@ <div class="listingblock"> <div class="content"> <pre><tt>#> cd /tmp -#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz" -#> tar zxf mod_gearman-1.1.0.tar.gz -#> cd mod_gearman-1.1.0 +#> wget "http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz" +#> tar zxf mod_gearman-1.1.1.tar.gz +#> cd mod_gearman-1.1.1 #> ./configure --prefix=/opt --with-gearman=/opt --with-user=nagios --with-init-dir=/etc/init.d #> make #> make install @@ -666,7 +666,7 @@ <div class="listingblock"> <div class="content"> <pre><tt>#> grep mod_gearman /var/log/nagios3/nagios.log -[1295003042] mod_gearman: Version 1.1.0 +[1295003042] mod_gearman: Version 1.1.1 [1295003042] Event broker module '/opt/lib/mod_gearman/mod_gearman.o' initialized successfully.</tt></pre> </div></div> </div> @@ -693,7 +693,7 @@ <div class="listingblock"> <div class="content"> <pre><tt>#> /opt/bin/check_gearman -H localhost -q worker_`hostname` -t 10 -s check -check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.1.0|worker=1 jobs=2c</tt></pre> +check_gearman OK - debian64 has 1 worker and is working on 0 jobs. Version: 1.1.1|worker=1 jobs=2c</tt></pre> </div></div> <div class="paragraph"><p>The interesting number is the last one, <em>2c</em> in our case, which means there have been already 2 jobs executed by this worker.</p></div> @@ -733,7 +733,7 @@ <div id="footnotes"><hr /></div> <div id="footer"> <div id="footer-text"> -Last updated 2011-09-23 12:21:01 CEST +Last updated 2011-11-04 13:15:52 CEST </div> </div> </body> | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/docs/README.html ^ |
@@ -593,7 +593,7 @@ <div class="ulist"><ul> <li> <p> -Latest stable release <a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz">version 1.1.0</a> from October 12 2011 +Latest stable release <a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz">version 1.1.1</a> from November 10 2011 </p> </li> <li> @@ -1738,6 +1738,11 @@ <div class="ulist"><ul> <li> <p> +<a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.1.tar.gz">version 1.1.1 - November 10 2011</a> +</p> +</li> +<li> +<p> <a href="http://labs.consol.de/wp-content/uploads/2010/09/mod_gearman-1.1.0.tar.gz">version 1.1.0 - October 12 2011</a> </p> </li> @@ -1832,7 +1837,7 @@ <div id="footnotes"><hr /></div> <div id="footer"> <div id="footer-text"> -Last updated 2011-10-12 18:41:03 CEST +Last updated 2011-11-10 11:17:44 CEST </div> </div> </body> | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/include/common.h ^ |
@@ -52,7 +52,7 @@ #define MOD_GM_COMMON_H /* constants */ -#define GM_VERSION "1.1.0" +#define GM_VERSION "1.1.1" #define GM_ENABLED 1 #define GM_DISABLED 0 #define GM_BUFFERSIZE 98304 | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/include/gearman_utils.h ^ |
@@ -34,7 +34,7 @@ #include <string.h> #include <netdb.h> #include <unistd.h> - +#include <netinet/in.h> /** function status structure */ typedef struct mod_gm_status_function { | ||
[-] [+] | Added | mod_gearman-1.1.1.tar.bz2/include/polarssl ^ |
+(directory) | ||
[-] [+] | Added | mod_gearman-1.1.1.tar.bz2/include/polarssl/config.h ^ |
@@ -0,0 +1,625 @@ +/** + * \file config.h + * + * \brief Configuration options (set of defines) + * + * Copyright (C) 2006-2010, Brainspark B.V. + * + * This file is part of PolarSSL (http://www.polarssl.org) + * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * This set of compile-time options may be used to enable + * or disable features selectively, and reduce the global + * memory footprint. + */ +#ifndef POLARSSL_CONFIG_H +#define POLARSSL_CONFIG_H + +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE 1 +#endif + +/** + * \name SECTION: System support + * + * This section sets system specific settings. + * \{ + */ + +/** + * \def POLARSSL_HAVE_INT8 + * + * The system uses 8-bit wide native integers. + * + * Uncomment if native integers are 8-bit wide. +#define POLARSSL_HAVE_INT8 + */ + +/** + * \def POLARSSL_HAVE_INT16 + * + * The system uses 16-bit wide native integers. + * + * Uncomment if native integers are 16-bit wide. +#define POLARSSL_HAVE_INT16 + */ + +/** + * \def POLARSSL_HAVE_LONGLONG + * + * The compiler supports the use of long long. + * + * Uncomment if the compiler supports long long. +#define POLARSSL_HAVE_LONGLONG + */ + +/** + * \def POLARSSL_HAVE_ASM + * + * The compiler has support for asm() + * + * Uncomment to enable the use of assembly code. + * + * Requires support for asm() in compiler. + * + * Used in: + * library/timing.c + * library/padlock.c + * include/polarssl/bn_mul.h + * + */ +#define POLARSSL_HAVE_ASM + +/** + * \def POLARSSL_HAVE_SSE2 + * + * CPI supports SSE2 instruction set. + * + * Uncomment if the CPU supports SSE2 (IA-32 specific). + * +#define POLARSSL_HAVE_SSE2 + */ +/* \} name */ + +/** + * \name SECTION: PolarSSL feature support + * + * This section sets support for features that are or are not needed + * within the modules that are enabled. + * \{ + */ + +/** + * \def POLARSSL_AES_ROM_TABLES + * + * Store the AES tables in ROM. + * + * Uncomment this macro to store the AES tables in ROM. + * +#define POLARSSL_AES_ROM_TABLES + */ + +/** + * \def POLARSSL_CIPHER_MODE_CFB + * + * Enable Cipher Feedback mode (CFB) for symmetric ciphers. + */ +#define POLARSSL_CIPHER_MODE_CFB + +/** + * \def POLARSSL_CIPHER_MODE_CTR + * + * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. + */ +#define POLARSSL_CIPHER_MODE_CTR + +/** + * \def POLARSSL_DEBUG_MSG + * + * Requires: POLARSSL_DEBUG_C + * + * Enable all SSL/TLS debugging messages. + */ +#define POLARSSL_DEBUG_MSG + +/** + * \def POLARSSL_GENPRIME + * + * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C + * + * Enable the RSA prime-number generation code. + */ +#define POLARSSL_GENPRIME + +/** + * \def POLARSSL_FS_IO + * + * Enable functions that use the filesystem. + */ +#define POLARSSL_FS_IO + +/** + * \def POLARSSL_PKCS1_V21 + * + * Requires: POLARSSL_MD_C, POLARSSL_RSA_C + * + * Enable support for PKCS#1 v2.1 encoding. + * This enables support for RSAES-OAEP and RSASSA-PSS operations. + */ +#define POLARSSL_PKCS1_V21 + +/** + * \def POLARSSL_RSA_NO_CRT + * + * Do not use the Chinese Remainder Theorem for the RSA private operation. + * + * Uncomment this macro to disable the use of CRT in RSA. + * +#define POLARSSL_RSA_NO_CRT + */ + +/** + * \def POLARSSL_SELF_TEST + * + * Enable the checkup functions (*_self_test). + */ +#define POLARSSL_SELF_TEST + +/** + * \def POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION + * + * If set, the X509 parser will not break-off when parsing an X509 certificate + * and encountering an unknown critical extension. + * + * Uncomment to prevent an error. + * +#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION + */ +/* \} name */ + +/** + * \name SECTION: PolarSSL modules + * + * This section enables or disables entire modules in PolarSSL + * \{ + */ + +/** + * \def POLARSSL_AES_C + * + * Enable the AES block cipher. + * + * Module: library/aes.c + * Caller: library/ssl_tls.c + * library/pem.c + * + * This module enables the following ciphersuites: + * SSL_RSA_AES_128_SHA + * SSL_RSA_AES_256_SHA + * SSL_EDH_RSA_AES_256_SHA + */ +#define POLARSSL_AES_C + +/** + * \def POLARSSL_ARC4_C + * + * Enable the ARCFOUR stream cipher. + * + * Module: library/arc4.c + * Caller: library/ssl_tls.c + * + * This module enables the following ciphersuites: + * SSL_RSA_RC4_128_MD5 + * SSL_RSA_RC4_128_SHA + */ +#define POLARSSL_ARC4_C + +/** + * \def POLARSSL_BASE64_C + * + * Enable the Base64 module. + * + * Module: library/base64.c + * Caller: library/pem.c + * + * This module is required for PEM support (required by X.509). + */ +#define POLARSSL_BASE64_C + +/** + * \def POLARSSL_BIGNUM_C + * + * Enable the multo-precision integer library. + * + * Module: library/bignum.c + * Caller: library/dhm.c + * library/rsa.c + * library/ssl_tls.c + * library/x509parse.c + * + * This module is required for RSA and DHM support. + */ +#define POLARSSL_BIGNUM_C + +/** + * \def POLARSSL_CAMELLIA_C + * + * Enable the Camellia block cipher. + * + * Module: library/camellia.c + * Caller: library/ssl_tls.c + * + * This module enabled the following cipher suites: + * SSL_RSA_CAMELLIA_128_SHA + * SSL_RSA_CAMELLIA_256_SHA + * SSL_EDH_RSA_CAMELLIA_256_SHA + */ +#define POLARSSL_CAMELLIA_C + +/** + * \def POLARSSL_CERTS_C + * + * Enable the test certificates. + * + * Module: library/certs.c + * Caller: + * + * This module is used for testing (ssl_client/server). + */ +#define POLARSSL_CERTS_C + +/** + * \def POLARSSL_CIPHER_C + * + * Enable the generic cipher layer. + * + * Module: library/cipher.c + * Caller: + * + * Uncomment to enable generic cipher wrappers. + */ +#define POLARSSL_CIPHER_C + +/** + * \def POLARSSL_DEBUG_C + * + * Enable the debug functions. + * + * Module: library/debug.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * library/ssl_tls.c + * + * This module provides debugging functions. + */ +#define POLARSSL_DEBUG_C + +/** + * \def POLARSSL_DES_C + * + * Enable the DES block cipher. + * + * Module: library/des.c + * Caller: library/ssl_tls.c + * + * This module enables the following ciphersuites: + * SSL_RSA_DES_168_SHA + * SSL_EDH_RSA_DES_168_SHA + */ +#define POLARSSL_DES_C + +/** + * \def POLARSSL_DHM_C + * + * Enable the Diffie-Hellman-Merkle key exchange. + * + * Module: library/dhm.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * + * This module enables the following ciphersuites: + * SSL_EDH_RSA_DES_168_SHA + * SSL_EDH_RSA_AES_256_SHA + * SSL_EDH_RSA_CAMELLIA_256_SHA + */ +#define POLARSSL_DHM_C + +/** + * \def POLARSSL_ERROR_C + * + * Enable error code to error string conversion. + * + * Module: library/error.c + * Caller: + * + * This module enables err_strerror(). + */ +#define POLARSSL_ERROR_C + +/** + * \def POLARSSL_HAVEGE_C + * + * Enable the HAVEGE random generator. + * + * Module: library/havege.c + * Caller: + * + * Requires: POLARSSL_TIMING_C + * + * This module enables the HAVEGE random number generator. + */ +#define POLARSSL_HAVEGE_C + +/** + * \def POLARSSL_MD_C + * + * Enable the generic message digest layer. + * + * Module: library/md.c + * Caller: + * + * Uncomment to enable generic message digest wrappers. + */ +#define POLARSSL_MD_C + +/** + * \def POLARSSL_MD2_C + * + * Enable the MD2 hash algorithm + * + * Module: library/md2.c + * Caller: library/x509parse.c + * + * Uncomment to enable support for (rare) MD2-signed X.509 certs. + * +#define POLARSSL_MD2_C + */ + +/** + * \def POLARSSL_MD4_C + * + * Enable the MD4 hash algorithm + * + * Module: library/md4.c + * Caller: library/x509parse.c + * + * Uncomment to enable support for (rare) MD4-signed X.509 certs. + * +#define POLARSSL_MD4_C + */ + +/** + * \def POLARSSL_MD5_C + * + * Enable the MD5 hash algorithm + * + * Module: library/md5.c + * Caller: library/ssl_tls.c + * library/x509parse.c + * + * This module is required for SSL/TLS and X.509. + */ +#define POLARSSL_MD5_C + +/** + * \def POLARSSL_NET_C + * + * Enable the TCP/IP networking routines. + * + * Module: library/net.c + * Caller: + * + * This module provides TCP/IP networking routines. + */ +#define POLARSSL_NET_C + +/** + * \def POLARSSL_PADLOCK_C + * + * Enable VIA Padlock support on x86. + * + * Module: library/padlock.c + * Caller: library/aes.c + * + * This modules adds support for the VIA PadLock on x86. + */ +#define POLARSSL_PADLOCK_C + +/** + * \def POLARSSL_PEM_C + * + * Enable PEM decoding + * + * Module: library/pem.c + * Caller: library/x509parse.c + * + * Requires: POLARSSL_BASE64_C + * + * This modules adds support for decoding PEM files. + */ +#define POLARSSL_PEM_C + +/** + * \def POLARSSL_PKCS11_C + * + * Enable support for PKCS#11 smartcard support. + * + * Module: library/ssl_srv.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * + * Requires: POLARSSL_SSL_TLS_C + * + * This module is required for SSL/TLS PKCS #11 smartcard support. + * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) +#define POLARSSL_PKCS11_C + */ + +/** + * \def POLARSSL_RSA_C + * + * Enable the RSA public-key cryptosystem. + * + * Module: library/rsa.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * library/ssl_tls.c + * library/x509.c + * + * Requires: POLARSSL_BIGNUM_C + * + * This module is required for SSL/TLS and MD5-signed certificates. + */ +#define POLARSSL_RSA_C + +/** + * \def POLARSSL_SHA1_C + * + * Enable the SHA1 cryptographic hash algorithm. + * + * Module: library/sha1.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * library/ssl_tls.c + * library/x509parse.c + * + * This module is required for SSL/TLS and SHA1-signed certificates. + */ +#define POLARSSL_SHA1_C + +/** + * \def POLARSSL_SHA2_C + * + * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. + * + * Module: library/sha2.c + * Caller: library/md_wrap.c + * library/x509parse.c + * + * This module adds support for SHA-224 and SHA-256. + */ +#define POLARSSL_SHA2_C + +/** + * \def POLARSSL_SHA4_C + * + * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. + * + * Module: library/sha4.c + * Caller: library/md_wrap.c + * library/x509parse.c + * + * This module adds support for SHA-384 and SHA-512. + */ +#define POLARSSL_SHA4_C + +/** + * \def POLARSSL_SSL_CLI_C + * + * Enable the SSL/TLS client code. + * + * Module: library/ssl_cli.c + * Caller: + * + * Requires: POLARSSL_SSL_TLS_C + * + * This module is required for SSL/TLS client support. + */ +#define POLARSSL_SSL_CLI_C + +/* + * \def POLARSSL_SSL_SRV_C + * + * Enable the SSL/TLS server code. + * + * Module: library/ssl_srv.c + * Caller: + * + * Requires: POLARSSL_SSL_TLS_C + * + * This module is required for SSL/TLS server support. + */ +#define POLARSSL_SSL_SRV_C + +/** + * \def POLARSSL_SSL_TLS_C + * + * Enable the generic SSL/TLS code. + * + * Module: library/ssl_tls.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * + * Requires: POLARSSL_MD5_C, POLARSSL_SHA1_C, POLARSSL_X509_PARSE_C + * + * This module is required for SSL/TLS. + */ +#define POLARSSL_SSL_TLS_C + +/** + * \def POLARSSL_TIMING_C + * + * Enable the portable timing interface. + * + * Module: library/timing.c + * Caller: library/havege.c + * + * This module is used by the HAVEGE random number generator. + */ +#define POLARSSL_TIMING_C + +/** + * \def POLARSSL_VERSION_C + * + * Enable run-time version information. + * + * Module: library/version.c + * + * This module provides run-time version information. + */ +#define POLARSSL_VERSION_C + +/** + * \def POLARSSL_X509_PARSE_C + * + * Enable X.509 certificate parsing. + * + * Module: library/x509parse.c + * Caller: library/ssl_cli.c + * library/ssl_srv.c + * library/ssl_tls.c + * + * Requires: POLARSSL_BIGNUM_C, POLARSSL_RSA_C + * + * This module is required for X.509 certificate parsing. + */ +#define POLARSSL_X509_PARSE_C + +/** + * \def POLARSSL_XTEA_C + * + * Enable the XTEA block cipher. + * + * Module: library/xtea.c + * Caller: + */ +#define POLARSSL_XTEA_C +/* \} name */ + +#endif /* config.h */ | ||
[-] [+] | Added | mod_gearman-1.1.1.tar.bz2/include/polarssl/md5.h ^ |
@@ -0,0 +1,153 @@ +/** + * \file md5.h + * + * \brief MD5 message digest algorithm (hash function) + * + * Copyright (C) 2006-2010, Brainspark B.V. + * + * This file is part of PolarSSL (http://www.polarssl.org) + * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org> + * + * All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifndef POLARSSL_MD5_H +#define POLARSSL_MD5_H + +#include <string.h> + +/** + * \brief MD5 context structure + */ +typedef struct +{ + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[4]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ + + unsigned char ipad[64]; /*!< HMAC: inner padding */ + unsigned char opad[64]; /*!< HMAC: outer padding */ +} +md5_context; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief MD5 context setup + * + * \param ctx context to be initialized + */ +void md5_starts( md5_context *ctx ); + +/** + * \brief MD5 process buffer + * + * \param ctx MD5 context + * \param input buffer holding the data + * \param ilen length of the input data + */ +void md5_update( md5_context *ctx, const unsigned char *input, size_t ilen ); + +/** + * \brief MD5 final digest + * + * \param ctx MD5 context + * \param output MD5 checksum result + */ +void md5_finish( md5_context *ctx, unsigned char output[16] ); + +/** + * \brief Output = MD5( input buffer ) + * + * \param input buffer holding the data + * \param ilen length of the input data + * \param output MD5 checksum result + */ +void md5( const unsigned char *input, size_t ilen, unsigned char output[16] ); + +/** + * \brief Output = MD5( file contents ) + * + * \param path input file name + * \param output MD5 checksum result + * + * \return 0 if successful, 1 if fopen failed, + * or 2 if fread failed + */ +int md5_file( const char *path, unsigned char output[16] ); + +/** + * \brief MD5 HMAC context setup + * + * \param ctx HMAC context to be initialized + * \param key HMAC secret key + * \param keylen length of the HMAC key + */ +void md5_hmac_starts( md5_context *ctx, + const unsigned char *key, size_t keylen ); + +/** + * \brief MD5 HMAC process buffer + * + * \param ctx HMAC context + * \param input buffer holding the data + * \param ilen length of the input data + */ +void md5_hmac_update( md5_context *ctx, + const unsigned char *input, size_t ilen ); + +/** + * \brief MD5 HMAC final digest + * + * \param ctx HMAC context + * \param output MD5 HMAC checksum result + */ +void md5_hmac_finish( md5_context *ctx, unsigned char output[16] ); + +/** + * \brief MD5 HMAC context reset + * + * \param ctx HMAC context to be reset + */ +void md5_hmac_reset( md5_context *ctx ); + +/** + * \brief Output = HMAC-MD5( hmac key, input buffer ) + * + * \param key HMAC secret key + * \param keylen length of the HMAC key + * \param input buffer holding the data + * \param ilen length of the input data + * \param output HMAC-MD5 result + */ +void md5_hmac( const unsigned char *key, size_t keylen, + const unsigned char *input, size_t ilen, + unsigned char output[16] ); + +/** + * \brief Checkup routine + * + * \return 0 if successful, or 1 if the test failed + */ +int md5_self_test( int verbose ); + +#ifdef __cplusplus +} +#endif + +#endif /* md5.h */ | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/include/utils.h ^ |
@@ -41,6 +41,7 @@ #include <sys/stat.h> #include "popenRWE.h" +#include "polarssl/md5.h" #include "common.h" /** @@ -521,5 +522,16 @@ void send_result_back(gm_job_t * exec_job); /** + * md5sum + * + * create md5 sum + * + * @param[in] text - char array to get md5 from + * + * @return md5sum (hex) + */ +char *md5sum(char *text); + +/** * @} */ | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/neb_module/mod_gearman.c ^ |
@@ -498,6 +498,16 @@ return NEBERROR_CALLBACKCANCEL; } + /* log latency */ + if(mod_gm_opt->debug_level >= GM_LOG_DEBUG) { + time_t t = time(NULL); + struct tm next_check; + localtime_r(&hst->next_check, &next_check); + char buffer1[GM_BUFFERSIZE]; + strftime(buffer1, sizeof(buffer1), "%Y-%m-%d %H:%M:%S", &next_check ); + gm_log( GM_LOG_DEBUG, "host: '%s', next_check is at %s, latency: %i\n", hst->name, buffer1, ((int) t - (int)hst->next_check)); + } + /* increment number of host checks that are currently running */ currently_running_host_checks++; @@ -622,6 +632,16 @@ return NEBERROR_CALLBACKCANCEL; } + /* log latency */ + if(mod_gm_opt->debug_level >= GM_LOG_DEBUG) { + time_t t = time(NULL); + struct tm next_check; + localtime_r(&svc->next_check, &next_check); + char buffer1[GM_BUFFERSIZE]; + strftime(buffer1, sizeof(buffer1), "%Y-%m-%d %H:%M:%S", &next_check ); + gm_log( GM_LOG_DEBUG, "service: '%s' - '%s', next_check is at %s, latency: %i\n", svcdata->host_name, svcdata->service_description, buffer1, ((int) t - (int)svc->next_check)); + } + /* increment number of service checks that are currently running... */ currently_running_service_checks++; | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/support/mod_gearman.spec ^ |
@@ -1,5 +1,5 @@ Name: mod_gearman -Version: 1.1.0 +Version: 1.1.1 Release: 1%{?dist} License: GNU Public License version 2 Packager: Michael Friedrich <michael.friedrich@univie.ac.at> | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/t/01-utils.c ^ |
@@ -28,7 +28,7 @@ } int main(void) { - plan(58); + plan(60); /* lowercase */ char test[100]; @@ -204,6 +204,18 @@ is(escaped, "test", "trimmed escape string"); free(escaped); + /* md5 sum */ + char * sum = NULL; + strcpy(test, ""); + sum = md5sum(test); + like(sum, "d41d8cd98f00b204e9800998ecf8427e", "md5sum()"); + free(sum); + + strcpy(test, "The quick brown fox jumps over the lazy dog."); + sum = md5sum(test); + like(sum, "e4d909c290d0fb1ca068ffaddf22cbd0", "md5sum()"); + free(sum); + mod_gm_free_opt(mod_gm_opt); return exit_status(); | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/t/02-full.c ^ |
@@ -234,7 +234,7 @@ /* main tests */ int main(void) { int status, chld; - int tests = 55; + int tests = 57; int rrc; char cmd[150]; char *result, *error; @@ -345,6 +345,16 @@ rrc = real_exit_code(run_check(cmd, &result, &error)); cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); like(result, "send_multi OK: 2 check_multi child checks submitted", "output from ./send_multi"); + free(result); + free(error); + + /***************************************** + * check_gearman + */ + snprintf(cmd, 150, "./check_gearman -H localhost:%d -s check -a -q worker_test", GEARMAND_TEST_PORT); + rrc = real_exit_code(run_check(cmd, &result, &error)); + cmp_ok(rrc, "==", 0, "cmd '%s' returned rc %d", cmd, rrc); + like(result, "check_gearman OK - sending background job succeded", "output from ./check_gearman"); /* cleanup */ | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/tools/check_gearman.c ^ |
@@ -37,6 +37,7 @@ char * opt_queue = NULL; char * opt_send = NULL; char * opt_expect = NULL; +int send_async = 0; char * server_list[GM_LISTSIZE]; int server_list_num = 0; @@ -55,7 +56,7 @@ /* * and parse command line */ - while((opt = getopt(argc, argv, "vVhH:t:w:c:W:C:q:s:e:p:")) != -1) { + while((opt = getopt(argc, argv, "vVhaH:t:w:c:W:C:q:s:e:p:")) != -1) { switch(opt) { case 'h': print_usage(); break; @@ -78,6 +79,8 @@ break; case 's': opt_send = optarg; break; + case 'a': send_async = 1; + break; case 'e': opt_expect = optarg; break; case 'q': opt_queue = optarg; @@ -143,6 +146,7 @@ printf("to send a test job:\n"); printf(" [ -s=<send text> ]\n"); printf(" [ -e=<expect text> ]\n"); + printf(" [ -a send async ] will ignore -e\n"); printf("\n"); printf(" [ -h print help ]\n"); printf(" [ -v verbose output ]\n"); @@ -303,6 +307,7 @@ gearman_return_t ret; char * result; size_t result_size; + char * job_handle; /* create client */ if ( create_client( server_list, &client ) != GM_OK ) { @@ -312,13 +317,27 @@ gearman_client_set_timeout(&client, (opt_timeout-1)*1000/server_list_num); while (1) { - result= (char *)gearman_client_do_high( &client, - queue, - "check", - (void *)to_send, - (size_t)strlen(to_send), - &result_size, - &ret); + if (send_async) { + result = "sending background job succeded"; + job_handle = malloc(GEARMAN_JOB_HANDLE_SIZE * sizeof(char)); + ret= gearman_client_do_high_background( &client, + queue, + "check", + (void *)to_send, + (size_t)strlen(to_send), + job_handle); + free(job_handle); + } + else { + result= (char *)gearman_client_do_high( &client, + queue, + "check", + (void *)to_send, + (size_t)strlen(to_send), + &result_size, + &ret); + } + if (ret == GEARMAN_WORK_DATA) { free(result); continue; @@ -342,7 +361,7 @@ break; } - if( expect != NULL ) { + if( !send_async && expect != NULL && result != NULL ) { if( strstr(result, expect) != NULL) { printf("%s OK - send worker '%s' response: '%s'\n", PLUGIN_NAME, to_send, result); return( STATE_OK ); | ||
[-] [+] | Changed | mod_gearman-1.1.1.tar.bz2/worker/worker_client.c ^ |
@@ -299,12 +299,12 @@ exec_job->timeout = mod_gm_opt->job_timeout; } - gm_log( GM_LOG_TRACE, "timeout %i\n", exec_job->timeout); - /* get the check start time */ gettimeofday(&start_time,NULL); exec_job->start_time = start_time; - latency = exec_job->core_start_time.tv_sec - start_time.tv_sec; + latency = start_time.tv_sec - exec_job->core_start_time.tv_sec; + + gm_log( GM_LOG_TRACE, "timeout: %i, core latency: %i\n", exec_job->timeout, latency); /* job is too old */ if(latency > mod_gm_opt->max_age) { |