diff options
10 files changed, 996 insertions, 11 deletions
diff --git a/sys-auth/pam_mobile_otp/Manifest b/sys-auth/pam_mobile_otp/Manifest index b0e6c8f0..9874d4f1 100644 --- a/sys-auth/pam_mobile_otp/Manifest +++ b/sys-auth/pam_mobile_otp/Manifest @@ -1,7 +1,11 @@ -AUX Makefile.patch 765 SHA256 97e02b3316d05b4ed4fc1f587aaaf3230bb6424367ab3373a17972cbb90674b8 SHA512 9fa77cc799305377f8878b51f359faa53087eb11b12ffcd3ec8cb62d91153a44b3f180a85db112d69517a187aad8801dc98bf7b07573ef02e973612e895aa3be WHIRLPOOL 03711b6b9782136558e8e36be903f902c8a952d402813052f637b1b5257d949bbe186f70355ceda95553dee62015b558cb8c5df7ee534208570d034023a843c6 -AUX __stack_chk_fail_local.patch 367 SHA256 3fa34ae31c12b159f69ed4a86760891968792bd3056b90a077dae8ed61f8986c SHA512 f1b3ddcc781ab42d01e0f79b6648ddf982c16e154d3ca28d8dd609b730539f6653e9db73a9a1cf3ae3cf35acac3b9d35f51217c8e866b46568c506dcb01f0b79 WHIRLPOOL 25b8ad04c3da72eb3de38e48970dcfdeb3429e5358ecc67f90e4e8edb080c8e32f7d8167b91835c2a063e441814a4ac677ef10def349abffa74b4b32c50f49af -AUX motp-manager.patch 411 SHA256 e852bb0272e9dbba8532c0304ce81468c960500908e94e5bac7b672634836374 SHA512 aba1a5f14f9af3377eaa1df826ddbc772bc0fd35363e1cd628011ee672990cdf115515ce85a381ae4556154cb80261ffcdd00de65e126979cd229207794bddf8 WHIRLPOOL 07b4d5496fb1b50ad29a1de86372f12237caddcf68fe94f5f9998a03ab6ff23837571db2d19b9a45c8c89f2912fdd47fd204de46284658815b1672523176db9d -AUX motp.conf 78 SHA256 c85aa5384ef8f7364b483129d6e46c1505ecc0115bb8cd1084f6c7139f17a48e SHA512 6ae7b767cb42719ed3e3b011e4771fb3dd3b2267585defe3ac110d4888699ec3651904e0421997b737265b9ce4283ba89b4783ccdbd65205e905035bafa1e59a WHIRLPOOL 6c9721c987d74c2bc514f719eb2aa7de8066f06bc3c95f3779a9c5cc5949bf7cf846e6fd95cd856caadf036017f55d818e9cda69dec475d7018027464c82e5a7 -AUX prompt.patch 410 SHA256 a84b2ebb5e74f6d1d386d4bdf3bc910ded5f79ae046daa390c408d8323e163f2 SHA512 56fefadbc0f304402faae41772d914fdee7087778fee7461444874ef84cc61f26c647b52de94e6340841018e17309ef14a224dfcfcf31ecae5df066e09bebbe3 WHIRLPOOL b94e7320a1f90d8e2f3dc2d9debc7602eb10604642dfef7c3cb7e27971572a61006dccdd777d001b80f22ec38fb9ca04fa20c6a66919bab1a0fb3c74582456b2 +AUX pam_mobile_otp-0.6.1-Makefile.patch 765 SHA256 97e02b3316d05b4ed4fc1f587aaaf3230bb6424367ab3373a17972cbb90674b8 SHA512 9fa77cc799305377f8878b51f359faa53087eb11b12ffcd3ec8cb62d91153a44b3f180a85db112d69517a187aad8801dc98bf7b07573ef02e973612e895aa3be WHIRLPOOL 03711b6b9782136558e8e36be903f902c8a952d402813052f637b1b5257d949bbe186f70355ceda95553dee62015b558cb8c5df7ee534208570d034023a843c6 +AUX pam_mobile_otp-0.6.1-__stack_chk_fail_local.patch 367 SHA256 3fa34ae31c12b159f69ed4a86760891968792bd3056b90a077dae8ed61f8986c SHA512 f1b3ddcc781ab42d01e0f79b6648ddf982c16e154d3ca28d8dd609b730539f6653e9db73a9a1cf3ae3cf35acac3b9d35f51217c8e866b46568c506dcb01f0b79 WHIRLPOOL 25b8ad04c3da72eb3de38e48970dcfdeb3429e5358ecc67f90e4e8edb080c8e32f7d8167b91835c2a063e441814a4ac677ef10def349abffa74b4b32c50f49af +AUX pam_mobile_otp-0.6.1-motp-manager.patch 411 SHA256 e852bb0272e9dbba8532c0304ce81468c960500908e94e5bac7b672634836374 SHA512 aba1a5f14f9af3377eaa1df826ddbc772bc0fd35363e1cd628011ee672990cdf115515ce85a381ae4556154cb80261ffcdd00de65e126979cd229207794bddf8 WHIRLPOOL 07b4d5496fb1b50ad29a1de86372f12237caddcf68fe94f5f9998a03ab6ff23837571db2d19b9a45c8c89f2912fdd47fd204de46284658815b1672523176db9d +AUX pam_mobile_otp-0.6.1-motp.conf 78 SHA256 c85aa5384ef8f7364b483129d6e46c1505ecc0115bb8cd1084f6c7139f17a48e SHA512 6ae7b767cb42719ed3e3b011e4771fb3dd3b2267585defe3ac110d4888699ec3651904e0421997b737265b9ce4283ba89b4783ccdbd65205e905035bafa1e59a WHIRLPOOL 6c9721c987d74c2bc514f719eb2aa7de8066f06bc3c95f3779a9c5cc5949bf7cf846e6fd95cd856caadf036017f55d818e9cda69dec475d7018027464c82e5a7 +AUX pam_mobile_otp-0.6.1-prompt.patch 410 SHA256 a84b2ebb5e74f6d1d386d4bdf3bc910ded5f79ae046daa390c408d8323e163f2 SHA512 56fefadbc0f304402faae41772d914fdee7087778fee7461444874ef84cc61f26c647b52de94e6340841018e17309ef14a224dfcfcf31ecae5df066e09bebbe3 WHIRLPOOL b94e7320a1f90d8e2f3dc2d9debc7602eb10604642dfef7c3cb7e27971572a61006dccdd777d001b80f22ec38fb9ca04fa20c6a66919bab1a0fb3c74582456b2 +AUX pam_mobile_otp-0.6.2-Makefile.patch 790 SHA256 2ef7a3b3d8464caa2b2216f8e1528bb1695e1c5359c241636baecc6a36b2ad18 SHA512 3dd5619546027771ec14808b0607e1409d50434ca141e6b9c6eb4def09effd44c868d8a15eafa05c193007a09448a11da978e2b4a7cdaece3c8683a0ee371e9a WHIRLPOOL 971a6207d39fd93409f9c328eb61128e5a94bdab4f636353ebc15d64af755d27030bf873a860c4891453b153fac187727ac854c60c6f03fed17bf5e58e299d06 +AUX pam_mobile_otp-0.6.2-md5.patch 32494 SHA256 634b95357d172632e863aae9c2950379d13545729e41c119bf23c69bd545ace9 SHA512 a9cfc935b9e965ae1a30419a0d8c46ae990f3c4b9696bcfaf4589a61459ab1768135ab58b7ef62881823ff3d2421a843cb3b2bf46cc9f8b75b0fd0847456ec7e WHIRLPOOL e5fa6615d132115ef93d71911296ab5a37924dd2a18cf53df9b804f016ac70f194b0a21add56768ff70a9522bbec2f645f695eff92fa65ea3a677ab45a68f7af DIST pam_mobile_otp-0.6.1.tgz 26425 SHA256 c26050358674ff2a2e4e4377e56aa3e1e348813936176bbc6957e84bdb2e6ba8 SHA512 99027a0e9e5bc65fe2c0c27fde5cd267dfd5743b522169ceedcd01e43f5af49d25cbb1a0d0693fcf87e0cc58908434f037475f971bb56370a7897ab0a00ef02f WHIRLPOOL 665a4f1a51703edddeab95d33dfc3b596f14c0f7d23b9a41c4b12c2682cfa5bddd83bc6970e175c712f0f428346a3ffe89208d382fc94b19fae9c570b0088934 -EBUILD pam_mobile_otp-0.6.1.ebuild 1632 SHA256 bd2e6f4b21d5fd476db27bff09471763c5ab90217624acf26ef400a1d1fb0adb SHA512 ee7788307c26469f3ae0074f13b710a5d13c0b625078259cbf1731b428d890be495ae91d7a77d3427d09ff84e6757219b6fbb57615410a9722dd4867dec2a3f0 WHIRLPOOL 9f3ac663f39b93e9b30f13553b33e85ea79803a0285cebe48e512d798e94d4a38a55e77a0e30b7b4f9343426071c30f9c4725926348bfb3c97ed494ebe49979b +DIST pam_mobile_otp-0.6.2.tgz 25477 SHA256 188eef3337e78f92d6b584cf4afa04a88d0ea70a0042f26715fbb94b28d39871 SHA512 a7e0a7245e611713c83b5a47b423e482068984be43a2e9f0256eb36680a6bdc18129e2d14e5c012285553067e1815a93989196663610128d2f7a6cdabb3bffb9 WHIRLPOOL a31749ae8b98d8b57793a93292300c8ed3d85ad247ea4d2b8d7f8826ef8c9f99f49eca2a7d02e200839e2f0342b5ad431ba2fdd719a1d7c234dd213fb1e4e0d4 +EBUILD pam_mobile_otp-0.6.1.ebuild 1666 SHA256 c8f26d186fe8e7b830db8c051a3ef90d0ee749f4b0cd6c7c93e0bd6fd2cad743 SHA512 872ca4dc74b3cffd9caf88b8d386010a319e23bc4aec59ba694bb30f03799e4e1b7fa9c9a6ad7f4b33a81427d3d2dd58032d521017eba6cb8460a4d18291021e WHIRLPOOL 12a7a2d826502770b3fae48e06674b0e7ce4bfb2096e17e8243e41713b17a57c1717de54b9f68de90e032e6ed0c4fad03060c7dec0575078b9784033bff6ca23 +EBUILD pam_mobile_otp-0.6.2.ebuild 1843 SHA256 019322d43ddb0f91d22ecbe2ef5ef8f0fbe132d8c7daa96ca51799f3e3be0631 SHA512 7c448dc28cf3d7d218ce9d1697de12c2c0e5ac8409f5223eac2e8020a3f6938b19e9d4ca1011c87c1678aa006cde10be8e5f0d3ff0914045cdd4df88add4713f WHIRLPOOL fa4f02bd47dc9e1736d814a9cc4abb160b1f358dd35fe87190c2c573b8ed9ce13274e5a43a8943a3ebdb6954d365f8cec4f5d4ecc431acf2075b34fc354faaa2 diff --git a/sys-auth/pam_mobile_otp/files/Makefile.patch b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-Makefile.patch index ab24da8c..ab24da8c 100644 --- a/sys-auth/pam_mobile_otp/files/Makefile.patch +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-Makefile.patch diff --git a/sys-auth/pam_mobile_otp/files/__stack_chk_fail_local.patch b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-__stack_chk_fail_local.patch index 73dc64ce..73dc64ce 100644 --- a/sys-auth/pam_mobile_otp/files/__stack_chk_fail_local.patch +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-__stack_chk_fail_local.patch diff --git a/sys-auth/pam_mobile_otp/files/motp-manager.patch b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-motp-manager.patch index 148461d8..148461d8 100644 --- a/sys-auth/pam_mobile_otp/files/motp-manager.patch +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-motp-manager.patch diff --git a/sys-auth/pam_mobile_otp/files/motp.conf b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-motp.conf index 9f3989e4..9f3989e4 100644 --- a/sys-auth/pam_mobile_otp/files/motp.conf +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-motp.conf diff --git a/sys-auth/pam_mobile_otp/files/prompt.patch b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-prompt.patch index 04b2caa9..04b2caa9 100644 --- a/sys-auth/pam_mobile_otp/files/prompt.patch +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.1-prompt.patch diff --git a/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.2-Makefile.patch b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.2-Makefile.patch new file mode 100644 index 00000000..890eb455 --- /dev/null +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.2-Makefile.patch @@ -0,0 +1,28 @@ +--- Makefile.dist 2011-08-16 15:02:44.128755738 +0100 ++++ Makefile 2011-08-16 15:06:03.346319737 +0100 +@@ -1,18 +1,21 @@ + ++OPT = -D_TRACE_ -Wall ++ + all: pam_mobile_otp.so + + debug: +- OPTS="-D_TRACE_ -Wall" make all ++ OPT = -D_TRACE_ -Wall ++ pam_mobile_otp.so + + pam_mobile_otp.o : pam_mobile_otp.c +- gcc -fPIC -c pam_mobile_otp.c ++ $(CC) $(CFLAGS) $(OPT) -fPIC -c pam_mobile_otp.c + + pam_mobile_otp.so : pam_mobile_otp.o md5.o +- gcc --shared -fPIC -o pam_mobile_otp.so pam_mobile_otp.o \ ++ $(CC) $(CFLAGS) $(OPT) $(LDFLAGS) -Wl,-x --shared -o pam_mobile_otp.so pam_mobile_otp.o \ + md5.o -lpam + + md5.o : md5.c +- gcc -fPIC -c md5.c -DSTDC_HEADERS ++ $(CC) $(CFLAGS) $(OPT) -fPIC -c md5.c -DSTDC_HEADERS + + install : pam_mobile_otp.so + cp pam_mobile_otp.so /lib/security/pam_mobile_otp.so diff --git a/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.2-md5.patch b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.2-md5.patch new file mode 100644 index 00000000..5d103ebe --- /dev/null +++ b/sys-auth/pam_mobile_otp/files/pam_mobile_otp-0.6.2-md5.patch @@ -0,0 +1,891 @@ +# Headers and library code from include/ and libiberty/ from GCC release 4.9.3. +# +--- /dev/null ++++ ansidecl.h +@@ -0,0 +1,313 @@ ++/* ANSI and traditional C compatability macros ++ Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, ++ 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2013 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++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. */ ++ ++/* ANSI and traditional C compatibility macros ++ ++ ANSI C is assumed if __STDC__ is #defined. ++ ++ Macro ANSI C definition Traditional C definition ++ ----- ---- - ---------- ----------- - ---------- ++ PTR `void *' `char *' ++ const not defined `' ++ volatile not defined `' ++ signed not defined `' ++ ++ For ease of writing code which uses GCC extensions but needs to be ++ portable to other compilers, we provide the GCC_VERSION macro that ++ simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various ++ wrappers around __attribute__. Also, __extension__ will be #defined ++ to nothing if it doesn't work. See below. */ ++ ++#ifndef _ANSIDECL_H ++#define _ANSIDECL_H 1 ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* Every source file includes this file, ++ so they will all get the switch for lint. */ ++/* LINTLIBRARY */ ++ ++/* Using MACRO(x,y) in cpp #if conditionals does not work with some ++ older preprocessors. Thus we can't define something like this: ++ ++#define HAVE_GCC_VERSION(MAJOR, MINOR) \ ++ (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR))) ++ ++and then test "#if HAVE_GCC_VERSION(2,7)". ++ ++So instead we use the macro below and test it against specific values. */ ++ ++/* This macro simplifies testing whether we are using gcc, and if it ++ is of a particular minimum version. (Both major & minor numbers are ++ significant.) This macro will evaluate to 0 if we are not using ++ gcc at all. */ ++#ifndef GCC_VERSION ++#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) ++#endif /* GCC_VERSION */ ++ ++#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) ++/* All known AIX compilers implement these things (but don't always ++ define __STDC__). The RISC/OS MIPS compiler defines these things ++ in SVR4 mode, but does not define __STDC__. */ ++/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other ++ C++ compilers, does not define __STDC__, though it acts as if this ++ was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */ ++ ++#define PTR void * ++ ++#undef const ++#undef volatile ++#undef signed ++ ++/* inline requires special treatment; it's in C99, and GCC >=2.7 supports ++ it too, but it's not in C89. */ ++#undef inline ++#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__)) ++/* it's a keyword */ ++#else ++# if GCC_VERSION >= 2007 ++# define inline __inline__ /* __inline__ prevents -pedantic warnings */ ++# else ++# define inline /* nothing */ ++# endif ++#endif ++ ++#else /* Not ANSI C. */ ++ ++#define PTR char * ++ ++/* some systems define these in header files for non-ansi mode */ ++#undef const ++#undef volatile ++#undef signed ++#undef inline ++#define const ++#define volatile ++#define signed ++#define inline ++ ++#endif /* ANSI C. */ ++ ++/* Define macros for some gcc attributes. This permits us to use the ++ macros freely, and know that they will come into play for the ++ version of gcc in which they are supported. */ ++ ++#if (GCC_VERSION < 2007) ++# define __attribute__(x) ++#endif ++ ++/* Attribute __malloc__ on functions was valid as of gcc 2.96. */ ++#ifndef ATTRIBUTE_MALLOC ++# if (GCC_VERSION >= 2096) ++# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) ++# else ++# define ATTRIBUTE_MALLOC ++# endif /* GNUC >= 2.96 */ ++#endif /* ATTRIBUTE_MALLOC */ ++ ++/* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For ++ g++ an attribute on a label must be followed by a semicolon. */ ++#ifndef ATTRIBUTE_UNUSED_LABEL ++# ifndef __cplusplus ++# if GCC_VERSION >= 2093 ++# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ++# else ++# define ATTRIBUTE_UNUSED_LABEL ++# endif ++# else ++# if GCC_VERSION >= 4005 ++# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ; ++# else ++# define ATTRIBUTE_UNUSED_LABEL ++# endif ++# endif ++#endif ++ ++/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend ++ couldn't parse attributes placed after the identifier name, and now ++ the entire compiler is built with C++. */ ++#ifndef ATTRIBUTE_UNUSED ++#if GCC_VERSION >= 3004 ++# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) ++#else ++#define ATTRIBUTE_UNUSED ++#endif ++#endif /* ATTRIBUTE_UNUSED */ ++ ++/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the ++ identifier name. */ ++#if ! defined(__cplusplus) || (GCC_VERSION >= 3004) ++# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED ++#else /* !__cplusplus || GNUC >= 3.4 */ ++# define ARG_UNUSED(NAME) NAME ++#endif /* !__cplusplus || GNUC >= 3.4 */ ++ ++#ifndef ATTRIBUTE_NORETURN ++#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) ++#endif /* ATTRIBUTE_NORETURN */ ++ ++/* Attribute `nonnull' was valid as of gcc 3.3. */ ++#ifndef ATTRIBUTE_NONNULL ++# if (GCC_VERSION >= 3003) ++# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) ++# else ++# define ATTRIBUTE_NONNULL(m) ++# endif /* GNUC >= 3.3 */ ++#endif /* ATTRIBUTE_NONNULL */ ++ ++/* Attribute `returns_nonnull' was valid as of gcc 4.9. */ ++#ifndef ATTRIBUTE_RETURNS_NONNULL ++# if (GCC_VERSION >= 4009) ++# define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) ++# else ++# define ATTRIBUTE_RETURNS_NONNULL ++# endif /* GNUC >= 4.9 */ ++#endif /* ATTRIBUTE_RETURNS_NONNULL */ ++ ++/* Attribute `pure' was valid as of gcc 3.0. */ ++#ifndef ATTRIBUTE_PURE ++# if (GCC_VERSION >= 3000) ++# define ATTRIBUTE_PURE __attribute__ ((__pure__)) ++# else ++# define ATTRIBUTE_PURE ++# endif /* GNUC >= 3.0 */ ++#endif /* ATTRIBUTE_PURE */ ++ ++/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL. ++ This was the case for the `printf' format attribute by itself ++ before GCC 3.3, but as of 3.3 we need to add the `nonnull' ++ attribute to retain this behavior. */ ++#ifndef ATTRIBUTE_PRINTF ++#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m) ++#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) ++#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) ++#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) ++#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) ++#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) ++#endif /* ATTRIBUTE_PRINTF */ ++ ++/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on ++ a function pointer. Format attributes were allowed on function ++ pointers as of gcc 3.1. */ ++#ifndef ATTRIBUTE_FPTR_PRINTF ++# if (GCC_VERSION >= 3001) ++# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n) ++# else ++# define ATTRIBUTE_FPTR_PRINTF(m, n) ++# endif /* GNUC >= 3.1 */ ++# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2) ++# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3) ++# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4) ++# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5) ++# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6) ++#endif /* ATTRIBUTE_FPTR_PRINTF */ ++ ++/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A ++ NULL format specifier was allowed as of gcc 3.3. */ ++#ifndef ATTRIBUTE_NULL_PRINTF ++# if (GCC_VERSION >= 3003) ++# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ++# else ++# define ATTRIBUTE_NULL_PRINTF(m, n) ++# endif /* GNUC >= 3.3 */ ++# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2) ++# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3) ++# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4) ++# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5) ++# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6) ++#endif /* ATTRIBUTE_NULL_PRINTF */ ++ ++/* Attribute `sentinel' was valid as of gcc 3.5. */ ++#ifndef ATTRIBUTE_SENTINEL ++# if (GCC_VERSION >= 3005) ++# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__)) ++# else ++# define ATTRIBUTE_SENTINEL ++# endif /* GNUC >= 3.5 */ ++#endif /* ATTRIBUTE_SENTINEL */ ++ ++ ++#ifndef ATTRIBUTE_ALIGNED_ALIGNOF ++# if (GCC_VERSION >= 3000) ++# define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m)))) ++# else ++# define ATTRIBUTE_ALIGNED_ALIGNOF(m) ++# endif /* GNUC >= 3.0 */ ++#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */ ++ ++/* Useful for structures whose layout must much some binary specification ++ regardless of the alignment and padding qualities of the compiler. */ ++#ifndef ATTRIBUTE_PACKED ++# define ATTRIBUTE_PACKED __attribute__ ((packed)) ++#endif ++ ++/* Attribute `hot' and `cold' was valid as of gcc 4.3. */ ++#ifndef ATTRIBUTE_COLD ++# if (GCC_VERSION >= 4003) ++# define ATTRIBUTE_COLD __attribute__ ((__cold__)) ++# else ++# define ATTRIBUTE_COLD ++# endif /* GNUC >= 4.3 */ ++#endif /* ATTRIBUTE_COLD */ ++#ifndef ATTRIBUTE_HOT ++# if (GCC_VERSION >= 4003) ++# define ATTRIBUTE_HOT __attribute__ ((__hot__)) ++# else ++# define ATTRIBUTE_HOT ++# endif /* GNUC >= 4.3 */ ++#endif /* ATTRIBUTE_HOT */ ++ ++/* We use __extension__ in some places to suppress -pedantic warnings ++ about GCC extensions. This feature didn't work properly before ++ gcc 2.8. */ ++#if GCC_VERSION < 2008 ++#define __extension__ ++#endif ++ ++/* This is used to declare a const variable which should be visible ++ outside of the current compilation unit. Use it as ++ EXPORTED_CONST int i = 1; ++ This is because the semantics of const are different in C and C++. ++ "extern const" is permitted in C but it looks strange, and gcc ++ warns about it when -Wc++-compat is not used. */ ++#ifdef __cplusplus ++#define EXPORTED_CONST extern const ++#else ++#define EXPORTED_CONST const ++#endif ++ ++/* Be conservative and only use enum bitfields with C++ or GCC. ++ FIXME: provide a complete autoconf test for buggy enum bitfields. */ ++ ++#ifdef __cplusplus ++#define ENUM_BITFIELD(TYPE) enum TYPE ++#elif (GCC_VERSION > 2000) ++#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE ++#else ++#define ENUM_BITFIELD(TYPE) unsigned int ++#endif ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* ansidecl.h */ +--- md5.h ++++ md5.h +@@ -1,6 +1,6 @@ + /* md5.h - Declaration of functions and data types used for MD5 sum + computing library functions. +- Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. ++ Copyright 1995, 1996, 2000 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +@@ -16,7 +16,7 @@ + + 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ++ Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + + #ifndef _MD5_H + #define _MD5_H 1 +@@ -27,6 +27,8 @@ + # include <limits.h> + #endif + ++#include "ansidecl.h" ++ + /* The following contortions are an attempt to use the C preprocessor + to determine an unsigned integral type that is 32 bits wide. An + alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but +@@ -37,29 +39,31 @@ + #ifdef _LIBC + # include <sys/types.h> + typedef u_int32_t md5_uint32; ++typedef uintptr_t md5_uintptr; ++#elif defined (HAVE_SYS_TYPES_H) && defined (HAVE_STDINT_H) ++#include <stdint.h> ++#include <sys/types.h> ++typedef uint32_t md5_uint32; ++typedef uintptr_t md5_uintptr; + #else +-# if defined __STDC__ && __STDC__ +-# define UINT_MAX_32_BITS 4294967295U +-# else +-# define UINT_MAX_32_BITS 0xFFFFFFFF +-# endif ++# define INT_MAX_32_BITS 2147483647 + + /* If UINT_MAX isn't defined, assume it's a 32-bit type. + This should be valid for all systems GNU cares about because + that doesn't include 16-bit systems, and only modern systems + (that certainly have <limits.h>) have 64+-bit integral types. */ + +-# ifndef UINT_MAX +-# define UINT_MAX UINT_MAX_32_BITS ++# ifndef INT_MAX ++# define INT_MAX INT_MAX_32_BITS + # endif + +-# if UINT_MAX == UINT_MAX_32_BITS ++# if INT_MAX == INT_MAX_32_BITS + typedef unsigned int md5_uint32; + # else +-# if USHRT_MAX == UINT_MAX_32_BITS ++# if SHRT_MAX == INT_MAX_32_BITS + typedef unsigned short md5_uint32; + # else +-# if ULONG_MAX == UINT_MAX_32_BITS ++# if LONG_MAX == INT_MAX_32_BITS + typedef unsigned long md5_uint32; + # else + /* The following line is intended to evoke an error. +@@ -68,13 +72,13 @@ typedef u_int32_t md5_uint32; + # endif + # endif + # endif ++/* We have to make a guess about the integer type equivalent in size ++ to pointers which should always be correct. */ ++typedef unsigned long int md5_uintptr; + #endif + +-#undef __P +-#if defined (__STDC__) && __STDC__ +-#define __P(x) x +-#else +-#define __P(x) () ++#ifdef __cplusplus ++extern "C" { + #endif + + /* Structure to save state of computation between the single steps. */ +@@ -87,7 +91,7 @@ struct md5_ctx + + md5_uint32 total[2]; + md5_uint32 buflen; +- char buffer[128]; ++ char buffer[128] ATTRIBUTE_ALIGNED_ALIGNOF(md5_uint32); + }; + + /* +@@ -97,30 +101,30 @@ struct md5_ctx + + /* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ +-extern void md5_init_ctx __P ((struct md5_ctx *ctx)); ++extern void md5_init_ctx (struct md5_ctx *ctx); + + /* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is necessary that LEN is a multiple of 64!!! */ +-extern void md5_process_block __P ((const void *buffer, size_t len, +- struct md5_ctx *ctx)); ++extern void md5_process_block (const void *buffer, size_t len, ++ struct md5_ctx *ctx); + + /* Starting with the result of former calls of this function (or the + initialization function update the context for the next LEN bytes + starting at BUFFER. + It is NOT required that LEN is a multiple of 64. */ +-extern void md5_process_bytes __P ((const void *buffer, size_t len, +- struct md5_ctx *ctx)); ++extern void md5_process_bytes (const void *buffer, size_t len, ++ struct md5_ctx *ctx); + + /* Process the remaining bytes in the buffer and put result from CTX + in first 16 bytes following RESBUF. The result is always in little + endian byte order, so that a byte-wise output yields to the wanted + ASCII representation of the message digest. + +- IMPORTANT: On some systems it is required that RESBUF be correctly ++ IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +-extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); ++extern void *md5_finish_ctx (struct md5_ctx *ctx, void *resbuf); + + + /* Put result from CTX in first 16 bytes following RESBUF. The result is +@@ -129,33 +133,22 @@ extern void *md5_finish_ctx __P ((struct + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +-extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); ++extern void *md5_read_ctx (const struct md5_ctx *ctx, void *resbuf); + + + /* Compute MD5 message digest for bytes read from STREAM. The + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ +-extern int md5_stream __P ((FILE *stream, void *resblock)); ++extern int md5_stream (FILE *stream, void *resblock); + + /* Compute MD5 message digest for LEN bytes beginning at BUFFER. The + result is always in little endian byte order, so that a byte-wise + output yields to the wanted ASCII representation of the message + digest. */ +-extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); ++extern void *md5_buffer (const char *buffer, size_t len, void *resblock); + +-/* The following is from gnupg-1.0.2's cipher/bithelp.h. */ +-/* Rotate a 32 bit integer by n bytes */ +-#if defined __GNUC__ && defined __i386__ +-static inline md5_uint32 +-rol(md5_uint32 x, int n) +-{ +- __asm__("roll %%cl,%0" +- :"=r" (x) +- :"0" (x),"c" (n)); +- return x; ++#ifdef __cplusplus + } +-#else +-# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) + #endif + + #endif +--- md5.c ++++ md5.c +@@ -1,8 +1,9 @@ + /* md5.c - Functions to compute MD5 message digest of files or memory blocks + according to the definition of MD5 in RFC 1321 from April 1992. +- Copyright (C) 1995, 1996 Free Software Foundation, Inc. +- NOTE: The canonical source of this file is maintained with the GNU C +- Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. ++ Copyright (C) 1995, 1996, 2011 Free Software Foundation, Inc. ++ ++ NOTE: This source is derived from an old version taken from the GNU C ++ Library (glibc). + + 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 +@@ -16,7 +17,7 @@ + + 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ ++ Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + + /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */ + +@@ -35,6 +36,7 @@ + # endif + #endif + ++#include "ansidecl.h" + #include "md5.h" + + #ifdef _LIBC +@@ -60,13 +62,12 @@ static const unsigned char fillbuf[64] = + /* Initialize structure containing state of computation. + (RFC 1321, 3.3: Step 3) */ + void +-md5_init_ctx (ctx) +- struct md5_ctx *ctx; ++md5_init_ctx (struct md5_ctx *ctx) + { +- ctx->A = 0x67452301; +- ctx->B = 0xefcdab89; +- ctx->C = 0x98badcfe; +- ctx->D = 0x10325476; ++ ctx->A = (md5_uint32) 0x67452301; ++ ctx->B = (md5_uint32) 0xefcdab89; ++ ctx->C = (md5_uint32) 0x98badcfe; ++ ctx->D = (md5_uint32) 0x10325476; + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; +@@ -75,17 +76,19 @@ md5_init_ctx (ctx) + /* Put result from CTX in first 16 bytes following RESBUF. The result + must be in little endian byte order. + +- IMPORTANT: On some systems it is required that RESBUF is correctly +- aligned for a 32 bits value. */ ++ IMPORTANT: RESBUF may not be aligned as strongly as MD5_UNIT32 so we ++ put things in a local (aligned) buffer first, then memcpy into RESBUF. */ + void * +-md5_read_ctx (ctx, resbuf) +- const struct md5_ctx *ctx; +- void *resbuf; ++md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) + { +- ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); +- ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); +- ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); +- ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); ++ md5_uint32 buffer[4]; ++ ++ buffer[0] = SWAP (ctx->A); ++ buffer[1] = SWAP (ctx->B); ++ buffer[2] = SWAP (ctx->C); ++ buffer[3] = SWAP (ctx->D); ++ ++ memcpy (resbuf, buffer, 16); + + return resbuf; + } +@@ -96,12 +99,11 @@ md5_read_ctx (ctx, resbuf) + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ + void * +-md5_finish_ctx (ctx, resbuf) +- struct md5_ctx *ctx; +- void *resbuf; ++md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) + { + /* Take yet unprocessed bytes into account. */ + md5_uint32 bytes = ctx->buflen; ++ md5_uint32 swap_bytes; + size_t pad; + + /* Now count remaining bytes. */ +@@ -112,10 +114,13 @@ md5_finish_ctx (ctx, resbuf) + pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; + memcpy (&ctx->buffer[bytes], fillbuf, pad); + +- /* Put the 64-bit file length in *bits* at the end of the buffer. */ +- *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); +- *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | +- (ctx->total[0] >> 29)); ++ /* Put the 64-bit file length in *bits* at the end of the buffer. ++ Use memcpy to avoid aliasing problems. On most systems, this ++ will be optimized away to the same code. */ ++ swap_bytes = SWAP (ctx->total[0] << 3); ++ memcpy (&ctx->buffer[bytes + pad], &swap_bytes, sizeof (swap_bytes)); ++ swap_bytes = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); ++ memcpy (&ctx->buffer[bytes + pad + 4], &swap_bytes, sizeof (swap_bytes)); + + /* Process last bytes. */ + md5_process_block (ctx->buffer, bytes + pad + 8, ctx); +@@ -127,9 +132,7 @@ md5_finish_ctx (ctx, resbuf) + resulting message digest number will be written into the 16 bytes + beginning at RESBLOCK. */ + int +-md5_stream (stream, resblock) +- FILE *stream; +- void *resblock; ++md5_stream (FILE *stream, void *resblock) + { + /* Important: BLOCKSIZE must be a multiple of 64. */ + #define BLOCKSIZE 4096 +@@ -184,10 +187,7 @@ md5_stream (stream, resblock) + output yields to the wanted ASCII representation of the message + digest. */ + void * +-md5_buffer (buffer, len, resblock) +- const char *buffer; +- size_t len; +- void *resblock; ++md5_buffer (const char *buffer, size_t len, void *resblock) + { + struct md5_ctx ctx; + +@@ -203,10 +203,7 @@ md5_buffer (buffer, len, resblock) + + + void +-md5_process_bytes (buffer, len, ctx) +- const void *buffer; +- size_t len; +- struct md5_ctx *ctx; ++md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) + { + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ +@@ -227,16 +224,36 @@ md5_process_bytes (buffer, len, ctx) + ctx->buflen = (left_over + add) & 63; + } + +- buffer = (const char *) buffer + add; ++ buffer = (const void *) ((const char *) buffer + add); + len -= add; + } + + /* Process available complete blocks. */ + if (len > 64) + { +- md5_process_block (buffer, len & ~63, ctx); +- buffer = (const char *) buffer + (len & ~63); +- len &= 63; ++#if !_STRING_ARCH_unaligned ++/* To check alignment gcc has an appropriate operator. Other ++ compilers don't. */ ++# if __GNUC__ >= 2 ++# define UNALIGNED_P(p) (((md5_uintptr) p) % __alignof__ (md5_uint32) != 0) ++# else ++# define UNALIGNED_P(p) (((md5_uintptr) p) % sizeof (md5_uint32) != 0) ++# endif ++ if (UNALIGNED_P (buffer)) ++ while (len > 64) ++ { ++ memcpy (ctx->buffer, buffer, 64); ++ md5_process_block (ctx->buffer, 64, ctx); ++ buffer = (const char *) buffer + 64; ++ len -= 64; ++ } ++ else ++#endif ++ { ++ md5_process_block (buffer, len & ~63, ctx); ++ buffer = (const void *) ((const char *) buffer + (len & ~63)); ++ len &= 63; ++ } + } + + /* Move remaining bytes in internal buffer. */ +@@ -261,13 +278,10 @@ md5_process_bytes (buffer, len, ctx) + It is assumed that LEN % 64 == 0. */ + + void +-md5_process_block (buffer, len, ctx) +- const void *buffer; +- size_t len; +- struct md5_ctx *ctx; ++md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) + { + md5_uint32 correct_words[16]; +- const md5_uint32 *words = buffer; ++ const md5_uint32 *words = (const md5_uint32 *) buffer; + size_t nwords = len / sizeof (md5_uint32); + const md5_uint32 *endp = words + nwords; + md5_uint32 A = ctx->A; +@@ -279,8 +293,7 @@ md5_process_block (buffer, len, ctx) + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; +- if (ctx->total[0] < len) +- ++ctx->total[1]; ++ ctx->total[1] += ((len >> 31) >> 1) + (ctx->total[0] < len); + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ +@@ -304,102 +317,113 @@ md5_process_block (buffer, len, ctx) + { \ + a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ + ++words; \ +- a = rol (a, s); \ ++ CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + ++ /* It is unfortunate that C does not provide an operator for ++ cyclic rotation. Hope the C compiler is smart enough. */ ++#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) ++ + /* Before we start, one word to the strange constants. + They are defined in RFC 1321 as + +- T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64, or +- perl -e 'foreach(1..64){printf "0x%08x\n", int (4294967296 * abs (sin $_))}' ++ T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 + */ + + /* Round 1. */ +- OP (A, B, C, D, 7, 0xd76aa478); +- OP (D, A, B, C, 12, 0xe8c7b756); +- OP (C, D, A, B, 17, 0x242070db); +- OP (B, C, D, A, 22, 0xc1bdceee); +- OP (A, B, C, D, 7, 0xf57c0faf); +- OP (D, A, B, C, 12, 0x4787c62a); +- OP (C, D, A, B, 17, 0xa8304613); +- OP (B, C, D, A, 22, 0xfd469501); +- OP (A, B, C, D, 7, 0x698098d8); +- OP (D, A, B, C, 12, 0x8b44f7af); +- OP (C, D, A, B, 17, 0xffff5bb1); +- OP (B, C, D, A, 22, 0x895cd7be); +- OP (A, B, C, D, 7, 0x6b901122); +- OP (D, A, B, C, 12, 0xfd987193); +- OP (C, D, A, B, 17, 0xa679438e); +- OP (B, C, D, A, 22, 0x49b40821); ++ OP (A, B, C, D, 7, (md5_uint32) 0xd76aa478); ++ OP (D, A, B, C, 12, (md5_uint32) 0xe8c7b756); ++ OP (C, D, A, B, 17, (md5_uint32) 0x242070db); ++ OP (B, C, D, A, 22, (md5_uint32) 0xc1bdceee); ++ OP (A, B, C, D, 7, (md5_uint32) 0xf57c0faf); ++ OP (D, A, B, C, 12, (md5_uint32) 0x4787c62a); ++ OP (C, D, A, B, 17, (md5_uint32) 0xa8304613); ++ OP (B, C, D, A, 22, (md5_uint32) 0xfd469501); ++ OP (A, B, C, D, 7, (md5_uint32) 0x698098d8); ++ OP (D, A, B, C, 12, (md5_uint32) 0x8b44f7af); ++ OP (C, D, A, B, 17, (md5_uint32) 0xffff5bb1); ++ OP (B, C, D, A, 22, (md5_uint32) 0x895cd7be); ++ OP (A, B, C, D, 7, (md5_uint32) 0x6b901122); ++ OP (D, A, B, C, 12, (md5_uint32) 0xfd987193); ++ OP (C, D, A, B, 17, (md5_uint32) 0xa679438e); ++ OP (B, C, D, A, 22, (md5_uint32) 0x49b40821); + + /* For the second to fourth round we have the possibly swapped words + in CORRECT_WORDS. Redefine the macro to take an additional first + argument specifying the function to use. */ + #undef OP +-#define OP(f, a, b, c, d, k, s, T) \ ++#define OP(a, b, c, d, k, s, T) \ + do \ + { \ +- a += f (b, c, d) + correct_words[k] + T; \ +- a = rol (a, s); \ ++ a += FX (b, c, d) + correct_words[k] + T; \ ++ CYCLIC (a, s); \ + a += b; \ + } \ + while (0) + ++#define FX(b, c, d) FG (b, c, d) ++ + /* Round 2. */ +- OP (FG, A, B, C, D, 1, 5, 0xf61e2562); +- OP (FG, D, A, B, C, 6, 9, 0xc040b340); +- OP (FG, C, D, A, B, 11, 14, 0x265e5a51); +- OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); +- OP (FG, A, B, C, D, 5, 5, 0xd62f105d); +- OP (FG, D, A, B, C, 10, 9, 0x02441453); +- OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); +- OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); +- OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); +- OP (FG, D, A, B, C, 14, 9, 0xc33707d6); +- OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); +- OP (FG, B, C, D, A, 8, 20, 0x455a14ed); +- OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); +- OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); +- OP (FG, C, D, A, B, 7, 14, 0x676f02d9); +- OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); ++ OP (A, B, C, D, 1, 5, (md5_uint32) 0xf61e2562); ++ OP (D, A, B, C, 6, 9, (md5_uint32) 0xc040b340); ++ OP (C, D, A, B, 11, 14, (md5_uint32) 0x265e5a51); ++ OP (B, C, D, A, 0, 20, (md5_uint32) 0xe9b6c7aa); ++ OP (A, B, C, D, 5, 5, (md5_uint32) 0xd62f105d); ++ OP (D, A, B, C, 10, 9, (md5_uint32) 0x02441453); ++ OP (C, D, A, B, 15, 14, (md5_uint32) 0xd8a1e681); ++ OP (B, C, D, A, 4, 20, (md5_uint32) 0xe7d3fbc8); ++ OP (A, B, C, D, 9, 5, (md5_uint32) 0x21e1cde6); ++ OP (D, A, B, C, 14, 9, (md5_uint32) 0xc33707d6); ++ OP (C, D, A, B, 3, 14, (md5_uint32) 0xf4d50d87); ++ OP (B, C, D, A, 8, 20, (md5_uint32) 0x455a14ed); ++ OP (A, B, C, D, 13, 5, (md5_uint32) 0xa9e3e905); ++ OP (D, A, B, C, 2, 9, (md5_uint32) 0xfcefa3f8); ++ OP (C, D, A, B, 7, 14, (md5_uint32) 0x676f02d9); ++ OP (B, C, D, A, 12, 20, (md5_uint32) 0x8d2a4c8a); ++ ++#undef FX ++#define FX(b, c, d) FH (b, c, d) + + /* Round 3. */ +- OP (FH, A, B, C, D, 5, 4, 0xfffa3942); +- OP (FH, D, A, B, C, 8, 11, 0x8771f681); +- OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); +- OP (FH, B, C, D, A, 14, 23, 0xfde5380c); +- OP (FH, A, B, C, D, 1, 4, 0xa4beea44); +- OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); +- OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); +- OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); +- OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); +- OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); +- OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); +- OP (FH, B, C, D, A, 6, 23, 0x04881d05); +- OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); +- OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); +- OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); +- OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); ++ OP (A, B, C, D, 5, 4, (md5_uint32) 0xfffa3942); ++ OP (D, A, B, C, 8, 11, (md5_uint32) 0x8771f681); ++ OP (C, D, A, B, 11, 16, (md5_uint32) 0x6d9d6122); ++ OP (B, C, D, A, 14, 23, (md5_uint32) 0xfde5380c); ++ OP (A, B, C, D, 1, 4, (md5_uint32) 0xa4beea44); ++ OP (D, A, B, C, 4, 11, (md5_uint32) 0x4bdecfa9); ++ OP (C, D, A, B, 7, 16, (md5_uint32) 0xf6bb4b60); ++ OP (B, C, D, A, 10, 23, (md5_uint32) 0xbebfbc70); ++ OP (A, B, C, D, 13, 4, (md5_uint32) 0x289b7ec6); ++ OP (D, A, B, C, 0, 11, (md5_uint32) 0xeaa127fa); ++ OP (C, D, A, B, 3, 16, (md5_uint32) 0xd4ef3085); ++ OP (B, C, D, A, 6, 23, (md5_uint32) 0x04881d05); ++ OP (A, B, C, D, 9, 4, (md5_uint32) 0xd9d4d039); ++ OP (D, A, B, C, 12, 11, (md5_uint32) 0xe6db99e5); ++ OP (C, D, A, B, 15, 16, (md5_uint32) 0x1fa27cf8); ++ OP (B, C, D, A, 2, 23, (md5_uint32) 0xc4ac5665); ++ ++#undef FX ++#define FX(b, c, d) FI (b, c, d) + + /* Round 4. */ +- OP (FI, A, B, C, D, 0, 6, 0xf4292244); +- OP (FI, D, A, B, C, 7, 10, 0x432aff97); +- OP (FI, C, D, A, B, 14, 15, 0xab9423a7); +- OP (FI, B, C, D, A, 5, 21, 0xfc93a039); +- OP (FI, A, B, C, D, 12, 6, 0x655b59c3); +- OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); +- OP (FI, C, D, A, B, 10, 15, 0xffeff47d); +- OP (FI, B, C, D, A, 1, 21, 0x85845dd1); +- OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); +- OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); +- OP (FI, C, D, A, B, 6, 15, 0xa3014314); +- OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); +- OP (FI, A, B, C, D, 4, 6, 0xf7537e82); +- OP (FI, D, A, B, C, 11, 10, 0xbd3af235); +- OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); +- OP (FI, B, C, D, A, 9, 21, 0xeb86d391); ++ OP (A, B, C, D, 0, 6, (md5_uint32) 0xf4292244); ++ OP (D, A, B, C, 7, 10, (md5_uint32) 0x432aff97); ++ OP (C, D, A, B, 14, 15, (md5_uint32) 0xab9423a7); ++ OP (B, C, D, A, 5, 21, (md5_uint32) 0xfc93a039); ++ OP (A, B, C, D, 12, 6, (md5_uint32) 0x655b59c3); ++ OP (D, A, B, C, 3, 10, (md5_uint32) 0x8f0ccc92); ++ OP (C, D, A, B, 10, 15, (md5_uint32) 0xffeff47d); ++ OP (B, C, D, A, 1, 21, (md5_uint32) 0x85845dd1); ++ OP (A, B, C, D, 8, 6, (md5_uint32) 0x6fa87e4f); ++ OP (D, A, B, C, 15, 10, (md5_uint32) 0xfe2ce6e0); ++ OP (C, D, A, B, 6, 15, (md5_uint32) 0xa3014314); ++ OP (B, C, D, A, 13, 21, (md5_uint32) 0x4e0811a1); ++ OP (A, B, C, D, 4, 6, (md5_uint32) 0xf7537e82); ++ OP (D, A, B, C, 11, 10, (md5_uint32) 0xbd3af235); ++ OP (C, D, A, B, 2, 15, (md5_uint32) 0x2ad7d2bb); ++ OP (B, C, D, A, 9, 21, (md5_uint32) 0xeb86d391); + + /* Add the starting values of the context. */ + A += A_save; diff --git a/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.1.ebuild b/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.1.ebuild index 02de6418..03176fad 100644 --- a/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.1.ebuild +++ b/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.1.ebuild @@ -19,10 +19,10 @@ KEYWORDS="~x86" S="${WORKDIR}/${PN}" src_prepare() { - epatch "${FILESDIR}/motp-manager.patch" || die "Failed to patch motp-manager" - epatch "${FILESDIR}/prompt.patch" || die "Failed to patch pam_mobile_otp.c" - epatch "${FILESDIR}/Makefile.patch" || die "Failed to patch Makefile" - epatch "${FILESDIR}/__stack_chk_fail_local.patch" || die "Failed to patch pam_mobile_otp.c" + epatch "${FILESDIR}/${P}-motp-manager.patch" || die "Failed to patch motp-manager" + epatch "${FILESDIR}/${P}-prompt.patch" || die "Failed to patch pam_mobile_otp.c" + epatch "${FILESDIR}/${P}-Makefile.patch" || die "Failed to patch Makefile" + epatch "${FILESDIR}/${P}-__stack_chk_fail_local.patch" || die "Failed to patch pam_mobile_otp.c" } src_compile() { @@ -39,7 +39,7 @@ src_install() { dosbin motp-manager || die "Cannot install 'motp-manager'" dodir /var/cache/motp dodir /etc/security - cp "${FILESDIR}/motp.conf" "${ED}/etc/security/" + cp "${FILESDIR}/${P}-motp.conf" "${ED}/etc/security/motp.conf" dopammod pam_mobile_otp.so || die "Cannot install pam_mobile_otp.so PAM module" dodoc README || die "Cannot install pam_mobile_otp README" } diff --git a/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.2.ebuild b/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.2.ebuild new file mode 100644 index 00000000..b4c74685 --- /dev/null +++ b/sys-auth/pam_mobile_otp/pam_mobile_otp-0.6.2.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=4 + +inherit toolchain-funcs pam + +DESCRIPTION="Mobile-OTP: Strong, two-factor authentication with mobile phones" +HOMEPAGE="http://motp.sourceforge.net/" +SRC_URI="http://motp.sourceforge.net/pam_mobile_otp-0.6.2.tgz" +RESTICT="mirror" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" +IUSE="-android manager" + +S="${WORKDIR}/${PN}" + +src_prepare() { + epatch "${FILESDIR}/${P}-Makefile.patch" || die "Failed to patch Makefile" + epatch "${FILESDIR}/${P}-md5.patch" || die "Failed to patch md5 library code" + epatch "${FILESDIR}/${PN}-0.6.1-prompt.patch" || die "Failed to patch pam_mobile_otp.c" + epatch "${FILESDIR}/${PN}-0.6.1-__stack_chk_fail_local.patch" || die "Failed to patch pam_mobile_otp.c" + + if use android; then + sed -i '/^#define LEN_PIN/s/4$/7/' pam_mobile_otp.c || die "Failed to update PIN length for Android devices" + fi +} + +src_install() { + if use manager; then + fperms 600 motp-manager || die "Cannot set permissions on 'motp-manager'" + dosbin motp-manager || die "Cannot install 'motp-manager'" + fi + + insinto /etc/security + newins "${FILESDIR}/${PN}-0.6.1-motp.conf" "motp.conf" + + dopammod pam_mobile_otp.so || die "Cannot install pam_mobile_otp.so PAM module" + + dodoc README || die "Cannot install pam_mobile_otp README" +} + +pkg_postinst() { + # Create cache directory for motp + mkdir -p -m 0755 "${EROOT%/}"/var/cache + mkdir -p -m 0700 "${EROOT%/}"/var/cache/motp + + elog "To enable pam_mobile_otp put something similar to:" + elog + elog " auth sufficient /lib/security/pam_mobile_otp.so not_set_pass" + if ! use android; then + elog " password required /lib/security/pam_mobile_otp.so debug" + fi + elog " and" + elog " account required /lib/security/pam_mobile_otp.so" + elog + elog "... into /etc/pam.d/login" +} + |