diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-08-18 18:07:00 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-08-18 18:07:00 +0200 |
commit | 0ca10e0baec316591e8f4e949d82e6530708bcd6 (patch) | |
tree | 426b97a89c8040ff1c85461f69f101f3eae873c5 | |
parent | 2fabaea7074e41a161c9dbabca35bdb8ecba78d0 (diff) | |
parent | d37c350287cf601dd69ddac857a2fb6aeeb4249d (diff) |
Merge commit 'ooo/OOO330_m4'
165 files changed, 19221 insertions, 36341 deletions
diff --git a/afms/download/Adobe-Core35_AFMs-314.tar.gz b/afms/download/Adobe-Core35_AFMs-314.tar.gz Binary files differdeleted file mode 100644 index 77b30cf..0000000 --- a/afms/download/Adobe-Core35_AFMs-314.tar.gz +++ /dev/null diff --git a/afms/makefile.mk b/afms/makefile.mk index a1bdf23..b1d2eaf 100644 --- a/afms/makefile.mk +++ b/afms/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -37,13 +33,12 @@ TARGET=afms # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" # --- Files -------------------------------------------------------- TARFILE_NAME=Adobe-Core35_AFMs-314 +TARFILE_MD5=1756c4fa6c616ae15973c104cd8cb256 TARFILE_ROOTDIR=Adobe-Core35_AFMs-314 -# TAR_EXCLUDES broken for solaris tar - #i77247# -# TAR_EXCLUDES=*/*Helvetica-Narrow* # --- Targets ------------------------------------------------------ @@ -53,9 +48,11 @@ ZIP1DIR = $(MISC)$/build$/$(TARFILE_NAME) ZIP1TARGET = fontunxafm ZIP1LIST = *.afm -x "*Helvetica-Narrow*" +.ENDIF # L10N_framework .INCLUDE : target.mk .INCLUDE : tg_ext.mk - +.IF "$(L10N_framework)"=="" $(ZIP1TARGETN): $(PACKAGE_DIR)$/$(UNTAR_FLAG_FILE) +.ENDIF # L10N_framework diff --git a/agg/prj/build.lst b/agg/prj/build.lst index d1456c6..57a0932 100755 --- a/agg/prj/build.lst +++ b/agg/prj/build.lst @@ -1,4 +1,4 @@ -ag agg : sal xml2cmp soltools NULL +ag agg : soltools stlport NULL ag agg usr1 - all ag_mkout NULL ag agg\inc get - all ag_inc NULL ag agg\prj get - all ag_prj NULL diff --git a/agg/source/makefile.mk b/agg/source/makefile.mk index 807a2c0..e29f2c3 100755 --- a/agg/source/makefile.mk +++ b/agg/source/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -37,7 +33,7 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" # don't link default libraries from sal UWINAPILIB= LIBSALCPPRT= @@ -86,7 +82,10 @@ DEFLIB1NAME =$(TARGET) # --- Targets ---------------------------------- +.ENDIF # L10N_framework .INCLUDE : target.mk - +.IF "$(L10N_framework)"=="" $(MISC)$/$(SHL1TARGET).flt : makefile.mk $(TARGET).flt @$(TYPE) $(TARGET).flt > $@ + +.ENDIF # L10N_framework diff --git a/apple_remote/AppleRemote.m b/apple_remote/AppleRemote.m index 25a6771..a65cc64 100644 --- a/apple_remote/AppleRemote.m +++ b/apple_remote/AppleRemote.m @@ -42,6 +42,9 @@ const char* AppleRemoteDeviceName = "AppleIRController"; #ifndef NSAppKitVersionNumber10_4 #define NSAppKitVersionNumber10_4 824 #endif +#ifndef NSAppKitVersionNumber10_5 + #define NSAppKitVersionNumber10_5 949 +#endif @implementation AppleRemote @@ -53,6 +56,9 @@ const char* AppleRemoteDeviceName = "AppleIRController"; // TODO : avoid such magics if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4) { + #ifdef DEBUG + NSLog( @"setting 10.4 cookies" ); + #endif // 10.4.x Tiger [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus] forKey:@"14_12_11_6_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus] forKey:@"14_13_11_6_"]; @@ -65,7 +71,10 @@ const char* AppleRemoteDeviceName = "AppleIRController"; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold] forKey:@"14_6_14_6_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold] forKey:@"18_14_6_18_14_6_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"]; - } else { + } else if( floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_5 ) { + #ifdef DEBUG + NSLog( @"setting 10.5 cookies" ); + #endif // 10.5.x Leopard [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus] forKey:@"31_29_28_19_18_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus] forKey:@"31_30_28_19_18_"]; @@ -79,6 +88,24 @@ const char* AppleRemoteDeviceName = "AppleIRController"; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold] forKey:@"35_31_19_18_35_31_19_18_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"]; } + else + { + #ifdef DEBUG + NSLog( @"setting 10.6 cookies" ); + #endif + // 10.6.x Snow Leopard + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus] forKey:@"33_31_30_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus] forKey:@"33_32_30_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu] forKey:@"33_22_21_20_2_33_22_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay] forKey:@"33_23_21_20_2_33_23_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight] forKey:@"33_24_21_20_2_33_24_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft] forKey:@"33_25_21_20_2_33_25_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight_Hold] forKey:@"33_21_20_14_12_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft_Hold] forKey:@"33_21_20_13_12_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold] forKey:@"33_21_20_2_33_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold] forKey:@"37_33_21_20_2_37_33_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"]; + } } - (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL) pressedDown { diff --git a/apple_remote/makefile.mk b/apple_remote/makefile.mk index b0da501..d261d51 100644 --- a/apple_remote/makefile.mk +++ b/apple_remote/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.2 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -39,7 +35,6 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/makefile2.pmk # --- Files -------------------------------------------------------- diff --git a/beanshell/bsh-2.0b1-src.patch b/beanshell/bsh-2.0b1-src.patch index aa88097..99e8b8b 100644 --- a/beanshell/bsh-2.0b1-src.patch +++ b/beanshell/bsh-2.0b1-src.patch @@ -31,20 +31,16 @@ <property name="legacy-excludes" --- misc/BeanShell/makefile.mk Fri Mar 28 15:56:40 2008 +++ misc/build/BeanShell/makefile.mk Fri Mar 28 15:56:06 2008 -@@ -1 +1,39 @@ +@@ -1 +1,35 @@ -dummy +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# -+# Copyright 2008 by Sun Microsystems, Inc. ++# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# -+# $RCSfile: bsh-2.0b1-src.patch,v $ -+# -+# $Revision: 1.7 $ -+# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/beanshell/download/bsh-2.0b1-src.tar.gz b/beanshell/download/bsh-2.0b1-src.tar.gz Binary files differdeleted file mode 100644 index 3ed3c69..0000000 --- a/beanshell/download/bsh-2.0b1-src.tar.gz +++ /dev/null diff --git a/beanshell/makefile.mk b/beanshell/makefile.mk index 215c598..6e89a00 100644 --- a/beanshell/makefile.mk +++ b/beanshell/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -42,6 +38,7 @@ TARGET=ooo_beanshell # --- Files -------------------------------------------------------- TARFILE_NAME=bsh-2.0b1-src +TARFILE_MD5=ea570af93c284aa9e5621cd563f54f4d TARFILE_ROOTDIR=BeanShell PATCH_FILES=bsh-2.0b1-src.patch diff --git a/cppunit/cppunit-1.8.0-r1.patch b/cppunit/cppunit-1.8.0-r1.patch deleted file mode 100644 index 426051d..0000000 --- a/cppunit/cppunit-1.8.0-r1.patch +++ /dev/null @@ -1,9830 +0,0 @@ ---- misc/cppunit-1.8.0/AUTHORS 2002-03-26 09:29:58.000000000 +0100 -+++ misc/build/cppunit-1.8.0/AUTHORS 2008-12-09 08:01:30.000000000 +0100 -@@ -5,3 +5,4 @@ - Baptiste Lepilleur <gaiacrtn@free.fr> <blep@sourceforge.net> - Bastiaan Bakker <bastiaan.bakker@lifeline.nl> - Steve Robbins <smr99@sourceforge.net> -+Lars Langhans <lla@openoffice.org> ---- misc/cppunit-1.8.0/ChangeLog 2002-04-11 11:53:02.000000000 +0200 -+++ misc/build/cppunit-1.8.0/ChangeLog 2008-12-09 08:08:42.000000000 +0100 -@@ -1,3 +1,9 @@ -+2008-12-09 Lars Langhans <lla@openoffice.org> -+ * create with some source files a new library -+ * lot of source changes to build it within OOo environment. -+ * lot of additional code to build within OOo environment. -+ * Configure is no longer supported. -+ - 2002-04-11 Baptiste Lepilleur <gaiacrtn@free.fr> - - * doc/FAQ: removed question about the Exception::operator =() problem. ---- misc/cppunit-1.8.0/INSTALL 2001-07-06 19:48:28.000000000 +0200 -+++ misc/build/cppunit-1.8.0/INSTALL 2008-12-09 09:39:09.000000000 +0100 -@@ -1,6 +1,12 @@ - Basic Installation - ================== - -+<IMPORTANT> -+This is a patched Version of CppUnit and works only in a OpenOffice.org -+environment. -+All other information here are expired. -+</IMPORTANT> -+ - These are generic installation instructions. - - The `configure' shell script attempts to guess correct values for ---- misc/cppunit-1.8.0/include/cppunit/Asserter.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/Asserter.h 2008-02-27 17:09:30.000000000 +0100 -@@ -4,6 +4,7 @@ - #include <cppunit/Portability.h> - #include <cppunit/SourceLine.h> - #include <string> -+#include <rtl/ustring.hxx> - - namespace CppUnit - { -@@ -44,8 +45,8 @@ - - /*! Throws a Exception with the specified message and location. - */ -- void CPPUNIT_API fail( std::string message, -- SourceLine sourceLine = SourceLine() ); -+ void CPPUNIT_API fail( std::string const& message, -+ SourceLine const& sourceLine = SourceLine() ); - - /*! Throws a Exception with the specified message and location. - * \param shouldFail if \c true then the exception is thrown. Otherwise -@@ -54,8 +55,14 @@ - * \param sourceLine Location of the assertion. - */ - void CPPUNIT_API failIf( bool shouldFail, -- std::string message, -- SourceLine sourceLine = SourceLine() ); -+ std::string const& message, -+ SourceLine const& sourceLine = SourceLine() ); -+ -+ -+ // LLA: test, if it's possible to use a DEFINE twice ;-) -+ void CPPUNIT_API failIf( bool shouldFail, -+ rtl::OUString const& message, -+ SourceLine const& sourceLine = SourceLine() ); - - /*! Throws a NotEqualException with the specified message and location. - * \param expected Text describing the expected value. -@@ -64,10 +71,10 @@ - * where the "difference" is located. - * \param sourceLine Location of the assertion. - */ -- void CPPUNIT_API failNotEqual( std::string expected, -- std::string actual, -- SourceLine sourceLine = SourceLine(), -- std::string additionalMessage ="" ); -+ void CPPUNIT_API failNotEqual( std::string const& expected, -+ std::string const& actual, -+ SourceLine const& sourceLine = SourceLine(), -+ std::string const& additionalMessage ="" ); - - /*! Throws a NotEqualException with the specified message and location. - * \param shouldFail if \c true then the exception is thrown. Otherwise -@@ -79,10 +86,18 @@ - * \param sourceLine Location of the assertion. - */ - void CPPUNIT_API failNotEqualIf( bool shouldFail, -- std::string expected, -- std::string actual, -- SourceLine sourceLine = SourceLine(), -- std::string additionalMessage ="" ); -+ std::string const& expected, -+ std::string const& actual, -+ SourceLine const& sourceLine = SourceLine(), -+ std::string const& additionalMessage ="" ); -+ -+ -+ /*! Throws an Exception with the specified message and location. -+ * \param message Message explaining the assertion failure. -+ * \param sourceLine Location of the assertion. -+ */ -+ void CPPUNIT_API failStub( std::string const& message, -+ SourceLine const& sourceLine = SourceLine() ); - - } // namespace Asserter - } // namespace CppUnit ---- misc/cppunit-1.8.0/include/cppunit/Exception.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/Exception.h 2008-02-27 17:10:36.000000000 +0100 -@@ -21,7 +21,7 @@ - class Type - { - public: -- Type( std::string type ) : m_type ( type ) {} -+ Type( std::string const& _type ) : m_type ( _type ) {} - - bool operator ==( const Type &other ) const - { -@@ -32,13 +32,13 @@ - }; - - -- Exception( std::string message = "", -- SourceLine sourceLine = SourceLine() ); -+ Exception( std::string const& message = "", -+ SourceLine const& sourceLine = SourceLine() ); - - #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED -- Exception( std::string message, -+ Exception( std::string const& message, - long lineNumber, -- std::string fileName ); -+ std::string const& fileName ); - #endif - - Exception (const Exception& other); -@@ -74,6 +74,41 @@ - SourceLine m_sourceLine; - }; - -+// ----------------------------------------------------------------------------- -+ -+class StubException : public Exception -+{ -+public: -+ StubException( std::string const& _message = "", -+ SourceLine const& _sourceLine = SourceLine() ) -+ :Exception(_message, _sourceLine) {} -+ -+ -+#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED -+ StubException( std::string const& message, -+ long lineNumber, -+ std::string const& fileName ) -+ :Exception(message, lineNumber, fileName) {} -+#endif -+}; -+ -+// ----------------------------------------------------------------------------- -+ -+class SignalException : public Exception -+{ -+public: -+ SignalException( std::string const& _message = "", -+ SourceLine const& _sourceLine = SourceLine() ) -+ :Exception(_message, _sourceLine) {} -+ -+ -+#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED -+ SignalException( std::string const& message, -+ long lineNumber, -+ std::string const& fileName ) -+ :Exception(message, lineNumber, fileName) {} -+#endif -+}; - - } // namespace CppUnit - ---- misc/cppunit-1.8.0/include/cppunit/NotEqualException.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/NotEqualException.h 2008-02-27 17:11:12.000000000 +0100 -@@ -19,16 +19,16 @@ - * \param additionalMessage Additionnal information provided to further qualify - * the inequality. - */ -- NotEqualException( std::string expected, -- std::string actual, -- SourceLine sourceLine = SourceLine(), -- std::string additionalMessage = "" ); -+ NotEqualException( std::string const& expected, -+ std::string const& actual, -+ SourceLine const& sourceLine = SourceLine(), -+ std::string const& additionalMessage = "" ); - - #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED -- NotEqualException( std::string expected, -- std::string actual, -+ NotEqualException( std::string const& expected, -+ std::string const& actual, - long lineNumber, -- std::string fileName ); -+ std::string const& fileName ); - #endif - - NotEqualException( const NotEqualException &other ); ---- misc/cppunit-1.8.0/include/cppunit/Portability.h 2002-03-25 19:41:39.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/Portability.h 2008-02-27 17:12:24.000000000 +0100 -@@ -3,11 +3,11 @@ - - /* include platform specific config */ - #if defined(__BORLANDC__) --# include <cppunit/config-bcb5.h> -+# include <cppunit/portability/config-bcb5.h> - #elif defined (_MSC_VER) --# include <cppunit/config-msvc6.h> -+# include <cppunit/portability/config-msvc6.h> - #else --# include <cppunit/config-auto.h> -+# include <cppunit/portability/config-auto.h> - #endif - - ---- misc/cppunit-1.8.0/include/cppunit/Test.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/Test.h 2008-02-27 17:09:20.000000000 +0100 -@@ -3,14 +3,15 @@ - - #include <cppunit/Portability.h> - #include <string> -+#include <cppunit/autoregister/htestresult.h> - - namespace CppUnit { - --class TestResult; -+//# class TestResult; - - /*! \brief Base class for all test objects. - * \ingroup BrowsingCollectedTestResult -- * -+ *l- - * All test objects should be a subclass of Test. Some test objects, - * TestCase for example, represent one individual test. Other test - * objects, such as TestSuite, are comprised of several tests. -@@ -27,7 +28,7 @@ - - /*! \brief Run the test, collecting results. - */ -- virtual void run (TestResult *result) = 0; -+ virtual void run (hTestResult pResult) = 0; - - /*! \brief Return the number of test cases invoked by run(). - * ---- misc/cppunit-1.8.0/include/cppunit/TestAssert.h 2002-04-04 17:39:37.000000000 +0200 -+++ misc/build/cppunit-1.8.0/include/cppunit/TestAssert.h 2008-02-27 17:12:12.000000000 +0100 -@@ -5,9 +5,12 @@ - #include <cppunit/Exception.h> - #include <cppunit/Asserter.h> - -+#include <cppunit/checkboom.hxx> - - namespace CppUnit { - -+ -+ - /*! \brief Traits used by CPPUNIT_ASSERT_EQUAL(). - * - * Here is an example of specialization of that traits: -@@ -31,83 +34,83 @@ - * }; - * \endcode - */ -- template <class T> -- struct assertion_traits -- { -- static bool equal( const T& x, const T& y ) -- { -- return x == y; -- } -- -- static std::string toString( const T& x ) -- { -- OStringStream ost; -- ost << x; -- return ost.str(); -- } -- }; - - -- namespace TestAssert -- { -+template <class T> -+struct assertion_traits -+{ -+ static bool equal( const T& x, const T& y ) -+ { -+ return x == y; -+ } -+ -+ static std::string toString( const T& x ) -+ { -+ OStringStream ost; -+ ost << x; -+ return ost.str(); -+ } -+}; -+ -+namespace TestAssert -+{ - #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED -- void CPPUNIT_API assertImplementation( bool condition, -- std::string conditionExpression = "", -- long lineNumber, -- std::string fileName ); -- -- void CPPUNIT_API assertNotEqualImplementation( std::string expected, -- std::string actual, -- long lineNumber, -- std::string fileName ); -- -- -- template <class T> -- void assertEquals( const T& expected, -- const T& actual, -- long lineNumber, -- std::string fileName ) -- { -- if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion... -- { -- assertNotEqualImplementation( assertion_traits<T>::toString(expected), -- assertion_traits<T>::toString(actual), -- lineNumber, -- fileName ); -- } -- } -- -- void CPPUNIT_API assertEquals( double expected, -- double actual, -- double delta, -- long lineNumber, -- std::string fileName ); -+ void CPPUNIT_API assertImplementation( bool condition, -+ std::string conditionExpression = "", -+ long lineNumber, -+ std::string fileName ); -+ -+ void CPPUNIT_API assertNotEqualImplementation( std::string expected, -+ std::string actual, -+ long lineNumber, -+ std::string fileName ); -+ -+ -+ template <class T> -+ void assertEquals( const T& expected, -+ const T& actual, -+ long lineNumber, -+ std::string fileName ) -+ { -+ if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion... -+ { -+ assertNotEqualImplementation( assertion_traits<T>::toString(expected), -+ assertion_traits<T>::toString(actual), -+ lineNumber, -+ fileName ); -+ } -+ } -+ -+ void CPPUNIT_API assertEquals( double expected, -+ double actual, -+ double delta, -+ long lineNumber, -+ std::string fileName ); - - #else // using SourceLine - -- template <class T> -- void assertEquals( const T& expected, -- const T& actual, -- SourceLine sourceLine, -- const std::string &message ="" ) -- { -- if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion... -- { -- Asserter::failNotEqual( assertion_traits<T>::toString(expected), -- assertion_traits<T>::toString(actual), -- sourceLine, -- message ); -- } -- } -- -- void CPPUNIT_API assertDoubleEquals( double expected, -- double actual, -- double delta, -- SourceLine sourceLine ); -+ template <class T> -+ void assertEquals( const T& expected, -+ const T& actual, -+ SourceLine sourceLine, -+ const std::string &message ="" ) -+ { -+ if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion... -+ { -+ Asserter::failNotEqual( assertion_traits<T>::toString(expected), -+ assertion_traits<T>::toString(actual), -+ sourceLine, -+ message ); -+ } -+ } -+ -+ void CPPUNIT_API assertDoubleEquals( double expected, -+ double actual, -+ double delta, -+ SourceLine sourceLine ); - - #endif -- } -- -+} - - /* A set of macros which allow us to get the line number - * and file name at the point of an error. -@@ -118,15 +121,22 @@ - /** Assertions that a condition is \c true. - * \ingroup Assertions - */ --#define CPPUNIT_ASSERT(condition) \ -- ( ::CppUnit::Asserter::failIf( !(condition), \ -- (#condition), \ -- CPPUNIT_SOURCELINE() ) ) -+ // LLA: due to the fact, that side effects are not wished, we create a local scope, -+ // assign the condition to a local variable and check this variable again and again. -+ -+#define CPPUNIT_ASSERT(condition) \ -+ { bool __bLocalCondition = condition; \ -+ CheckBoom((__bLocalCondition), (#condition)); \ -+ (::CppUnit::Asserter::failIf( !(__bLocalCondition), \ -+ (#condition), \ -+ CPPUNIT_SOURCELINE() ) ); } - #else --#define CPPUNIT_ASSERT(condition) \ -- ( ::CppUnit::Asserter::failIf( !(condition), \ -- "", \ -- CPPUNIT_SOURCELINE() ) ) -+#define CPPUNIT_ASSERT(condition) \ -+ { bool __bLocalCondition = condition; \ -+ CheckBoom((__bLocalCondition), ""); \ -+ (::CppUnit::Asserter::failIf( !(__bLocalCondition), \ -+ "", \ -+ CPPUNIT_SOURCELINE() ) ); } - #endif - - /** Assertion with a user specified message. -@@ -136,25 +146,33 @@ - * \param condition If this condition evaluates to \c false then the - * test failed. - */ --#define CPPUNIT_ASSERT_MESSAGE(message,condition) \ -- ( ::CppUnit::Asserter::failIf( !(condition), \ -- (message), \ -- CPPUNIT_SOURCELINE() ) ) -+#define CPPUNIT_ASSERT_MESSAGE(message,condition) \ -+ { bool __bLocalCondition = (condition); \ -+ CheckBoom((__bLocalCondition), (message)); \ -+ (::CppUnit::Asserter::failIf( !(__bLocalCondition), \ -+ (message), \ -+ CPPUNIT_SOURCELINE() ) ); } -+ -+#define CPPUNIT_ASSERT_STUB() \ -+ CheckBoom((1 == 0), ("This is only a stub.")); \ -+ (::CppUnit::Asserter::failStub("This is only a stub.", \ -+ CPPUNIT_SOURCELINE() ) ) -+ - - /** Fails with the specified message. - * \ingroup Assertions - * \param message Message reported in diagnostic. - */ - #define CPPUNIT_FAIL( message ) \ -- ( ::CppUnit::Asserter::fail( message, \ -- CPPUNIT_SOURCELINE() ) ) -+ ( ::CppUnit::Asserter::fail( message, \ -+ CPPUNIT_SOURCELINE() ) ) - - #ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED - /// Generalized macro for primitive value comparisons - #define CPPUNIT_ASSERT_EQUAL(expected,actual) \ -- ( ::CppUnit::TestAssert::assertEquals( (expected), \ -- (actual), \ -- __LINE__, __FILE__ ) ) -+ ( ::CppUnit::TestAssert::assertEquals( (expected), \ -+ (actual), \ -+ __LINE__, __FILE__ ) ) - #else - /** Asserts that two values are equals. - * \ingroup Assertions -@@ -173,9 +191,9 @@ - * removed by specializing the CppUnit::assertion_traits. - */ - #define CPPUNIT_ASSERT_EQUAL(expected,actual) \ -- ( ::CppUnit::TestAssert::assertEquals( (expected), \ -- (actual), \ -- CPPUNIT_SOURCELINE() ) ) -+ ( ::CppUnit::TestAssert::assertEquals( (expected), \ -+ (actual), \ -+ CPPUNIT_SOURCELINE() ) ) - - /** Asserts that two values are equals, provides additional messafe on failure. - * \ingroup Assertions -@@ -196,20 +214,20 @@ - * removed by specializing the CppUnit::assertion_traits. - */ - #define CPPUNIT_ASSERT_EQUAL_MESSAGE(message,expected,actual) \ -- ( ::CppUnit::TestAssert::assertEquals( (expected), \ -- (actual), \ -- CPPUNIT_SOURCELINE(), \ -- (message) ) ) -+ ( ::CppUnit::TestAssert::assertEquals( (expected), \ -+ (actual), \ -+ CPPUNIT_SOURCELINE(), \ -+ (message) ) ) - #endif - - /*! \brief Macro for primitive value comparisons - * \ingroup Assertions - */ - #define CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual,delta) \ -- ( ::CppUnit::TestAssert::assertDoubleEquals( (expected), \ -- (actual), \ -- (delta), \ -- CPPUNIT_SOURCELINE() ) ) -+ ( ::CppUnit::TestAssert::assertDoubleEquals( (expected), \ -+ (actual), \ -+ (delta), \ -+ CPPUNIT_SOURCELINE() ) ) - - // Backwards compatibility - -@@ -223,7 +241,6 @@ - - #endif - -- - } // namespace CppUnit - - #endif // CPPUNIT_TESTASSERT_H ---- misc/cppunit-1.8.0/include/cppunit/TestCaller.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/TestCaller.h 2008-02-27 17:09:40.000000000 +0100 -@@ -111,7 +111,7 @@ - * \param name name of this TestCaller - * \param test the method this TestCaller calls in runTest() - */ -- TestCaller( std::string name, TestMethod test ) : -+ TestCaller( std::string const& name, TestMethod test ) : - TestCase( name ), - m_ownFixture( true ), - m_fixture( new Fixture() ), -@@ -128,7 +128,7 @@ - * \param test the method this TestCaller calls in runTest() - * \param fixture the Fixture to invoke the test method on. - */ -- TestCaller(std::string name, TestMethod test, Fixture& fixture) : -+ TestCaller(std::string const& name, TestMethod test, Fixture& fixture) : - TestCase( name ), - m_ownFixture( false ), - m_fixture( &fixture ), -@@ -145,7 +145,7 @@ - * \param test the method this TestCaller calls in runTest() - * \param fixture the Fixture to invoke the test method on. - */ -- TestCaller(std::string name, TestMethod test, Fixture* fixture) : -+ TestCaller(std::string const& name, TestMethod test, Fixture* fixture) : - TestCase( name ), - m_ownFixture( true ), - m_fixture( fixture ), ---- misc/cppunit-1.8.0/include/cppunit/TestCase.h 2002-03-27 18:56:45.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/TestCase.h 2008-02-27 17:11:00.000000000 +0100 -@@ -3,15 +3,13 @@ - - #include <cppunit/Portability.h> - #include <cppunit/Test.h> --#include <cppunit/TestAssert.h> - #include <cppunit/TestFixture.h> - #include <string> -- -+#include <cppunit/autoregister/htestresult.h> - - namespace CppUnit { - --class TestResult; -- -+//# class TestResult; - - /*! \brief A single test object. - * -@@ -28,25 +26,25 @@ - { - public: - -- TestCase( std::string Name ); -+ TestCase( std::string const& Name ); - //! \internal - TestCase(); - ~TestCase(); - -- virtual void run(TestResult *result); -+ virtual void run(hTestResult pResult); - virtual int countTestCases() const; - std::string getName() const; - std::string toString() const; - - //! FIXME: what is this for? -- virtual TestResult *run(); -+ //# virtual TestResult *run(); - - protected: - //! FIXME: this should probably be pure virtual. - virtual void runTest(); - - //! Create TestResult for the run(void) method. -- TestResult *defaultResult(); -+ //# TestResult *defaultResult(); - - private: - TestCase( const TestCase &other ); ---- misc/cppunit-1.8.0/include/cppunit/TestFailure.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/TestFailure.h 2008-02-27 17:09:50.000000000 +0100 -@@ -4,6 +4,16 @@ - #include <cppunit/Portability.h> - #include <string> - -+namespace ErrorType -+{ -+ enum num -+ { -+ ET_FAILURE = 1, -+ ET_ERROR = 2, -+ ET_SIGNAL = 4 -+ }; -+} -+ - namespace CppUnit { - - class Exception; -@@ -20,12 +30,13 @@ - * TestFailure assumes lifetime control for any exception - * passed to it. - */ -+ - class CPPUNIT_API TestFailure - { - public: - TestFailure( Test *failedTest, - Exception *thrownException, -- bool isError ); -+ ErrorType::num eError ); - - virtual ~TestFailure (); - -@@ -36,6 +47,7 @@ - virtual SourceLine sourceLine() const; - - virtual bool isError() const; -+ virtual ErrorType::num getErrorType() const; - - virtual std::string failedTestName() const; - -@@ -46,7 +58,7 @@ - protected: - Test *m_failedTest; - Exception *m_thrownException; -- bool m_isError; -+ ErrorType::num m_eError; - - private: - TestFailure( const TestFailure &other ); ---- misc/cppunit-1.8.0/include/cppunit/TestFixture.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/TestFixture.h 2008-02-27 17:10:26.000000000 +0100 -@@ -74,11 +74,6 @@ - * } - * \endcode - * -- * A set of macros have been created for convenience. They are located in HelperMacros.h. -- * -- * \see TestResult, TestSuite, TestCaller, -- * \see CPPUNIT_TEST_SUB_SUITE, CPPUNIT_TEST, CPPUNIT_TEST_SUITE_END, -- * \see CPPUNIT_TEST_SUITE_REGISTRATION, CPPUNIT_TEST_EXCEPTION, CPPUNIT_TEST_FAIL. - */ - class CPPUNIT_API TestFixture - { ---- misc/cppunit-1.8.0/include/cppunit/TestSuite.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/TestSuite.h 2008-02-27 17:11:24.000000000 +0100 -@@ -4,17 +4,20 @@ - #include <cppunit/Portability.h> - - #if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER - #pragma warning( push ) - #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z - #endif -+#endif - - #include <cppunit/Test.h> - #include <vector> - #include <string> -+#include <cppunit/autoregister/htestresult.h> - - namespace CppUnit { - --class TestResult; -+//# class TestResult; - - #if CPPUNIT_NEED_DLL_DECL - template class CPPUNIT_API std::vector<Test *>; -@@ -35,7 +38,6 @@ - * Note that TestSuites assume lifetime - * control for any tests added to them. - * -- * TestSuites do not register themselves in the TestRegistry. - * \see Test - * \see TestCaller - */ -@@ -44,10 +46,10 @@ - class CPPUNIT_API TestSuite : public Test - { - public: -- TestSuite( std::string name = "" ); -+ TestSuite( std::string const& name = "" ); - ~TestSuite(); - -- void run( TestResult *result ); -+ void run( hTestResult pResult ); - int countTestCases() const; - std::string getName() const; - std::string toString() const; -@@ -71,7 +73,9 @@ - - - #if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER - #pragma warning( pop ) - #endif -+#endif - - #endif // CPPUNIT_TESTSUITE_H ---- misc/cppunit-1.8.0/include/cppunit/additionalfunc.hxx 2008-12-10 20:46:05.823290260 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/additionalfunc.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,61 @@ --dummy -+#ifndef ADDITIONALFUNC_HXX -+#define ADDITIONALFUNC_HXX -+ -+#include "cppunit/autoregister/registertestfunction.h" -+#include "sal/types.h" -+ -+extern "C" void SAL_CALL RegisterAdditionalFunctions(FktRegFuncPtr _pFunc); -+ -+#define NOADDITIONAL \ -+void RegisterAdditionalFunctions(FktRegFuncPtr){} -+ -+namespace { -+ -+enum T2_OSType { -+ T2_OS_WNT32 = 1, -+ T2_OS_UNIX, -+ T2_OS_OS2 -+}; -+ -+inline T2_OSType getOSType() -+{ -+#if defined WNT -+ return T2_OS_WNT32; -+#elif defined OS2 -+ return T2_OS_OS2; -+#else -+ return T2_OS_UNIX; -+#endif -+} -+ -+} -+ -+#define TESTSHL2_UNO_BOOTSTRAP(file) \ -+void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc) \ -+{ \ -+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory> xMS; \ -+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > xComponentContext; \ -+ try { \ -+ if (strlen(#file) > 0) { \ -+ ::rtl::OUString iniFile(rtl::OUString::createFromAscii(#file)); \ -+ if (getOSType() == T2_OS_WNT32 || getOSType() == T2_OS_OS2) { \ -+ iniFile += ::rtl::OUString::createFromAscii(".ini"); \ -+ } else { \ -+ iniFile += ::rtl::OUString::createFromAscii("rc"); \ -+ } \ -+ xComponentContext = cppu::defaultBootstrap_InitialComponentContext(iniFile); \ -+ } else { \ -+ xComponentContext = cppu::defaultBootstrap_InitialComponentContext(); \ -+ } \ -+ xMS.set(xComponentContext->getServiceManager(), com::sun::star::uno::UNO_QUERY); \ -+ comphelper::setProcessServiceFactory(xMS); \ -+ } \ -+ catch (::com::sun::star::uno::Exception e ) { \ -+ rtl::OString aError; \ -+ aError = rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US); \ -+ printf("Error at UNO bootstrap time caught: %s\nMust quit.\n", aError.getStr()); \ -+ exit(1); \ -+ } \ -+} -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: additionalfunc.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/autoregister/callbackfunc_fktptr.h 2008-12-10 20:46:05.931077489 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/autoregister/callbackfunc_fktptr.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,63 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef _callbackfunc_fktptr_h -+#define _callbackfunc_fktptr_h -+ -+#include <sal/types.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+// these typedefs are used for the TestCase, to call the TestResult functions. -+// The TestResult is only in the testshl tool, not in the test libraries. -+ -+typedef void* hTest; -+typedef void* hException; -+ -+typedef sal_Int32 (* FktPtr_CallbackDispatch)(int x, ...); -+ -+//# typedef void (* FktPtr_TestResult_startTest)(hTestResult, hTest ); -+//# typedef void (* FktPtr_TestResult_addFailure)( hTestResult, hTest , hException pException ); -+//# typedef void (* FktPtr_TestResult_addError)( hTestResult, hTest , hException pException ); -+//# typedef void (* FktPtr_TestResult_endTest)( hTestResult, hTest ); -+//# typedef bool (* FktPtr_TestResult_shouldStop)(hTestResult); -+//# -+//# // Additional functions -+//# typedef void (* FktPtr_TestResult_addInfo)( hTestResult, hTest, const char* ); -+//# typedef void (* FktPtr_TestResult_enterNode)( hTestResult, const char* ); -+//# typedef void (* FktPtr_TestResult_leaveNode)( hTestResult, const char* ); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/autoregister: callbackfunc_fktptr.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/autoregister/callbackstructure.h 2008-12-10 20:46:06.013912039 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/autoregister/callbackstructure.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,89 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef _callbackstructure_h -+#define _callbackstructure_h -+ -+#include <sal/types.h> -+#include <cppunit/autoregister/callbackfunc_fktptr.h> -+#include <cppunit/autoregister/registerfunc.h> -+#include <cppunit/autoregister/registertestfunction.h> -+#include <cppunit/cmdlinebits.hxx> -+ -+// this structure will filled by the testshl tool and hand to the testdll -+ -+struct CallbackStructure -+{ -+ // a version number, if we want to change/expand this struct -+ sal_Int32 nVersion; -+ sal_Int64 nMagic; -+ -+ FktRegFuncPtr aRegisterFunction; -+ -+ FktPtr_CallbackDispatch aCallbackDispatch; -+ -+ //# FktPtr_TestResult_startTest aStartTest; -+ //# FktPtr_TestResult_addFailure aAddFailure; -+ //# FktPtr_TestResult_addError aAddError; -+ //# FktPtr_TestResult_endTest aEndTest; -+ //# FktPtr_TestResult_shouldStop aShouldStop; -+ //# -+ //# FktPtr_TestResult_addInfo aAddInfo; -+ //# FktPtr_TestResult_enterNode aEnterNode; -+ //# FktPtr_TestResult_leaveNode aLeaveNode; -+ -+ const char* psForward; -+ CmdLineBits nBits; -+ -+ // void* pJobList; -+ -+ sal_Int64 nMagic2; -+ -+ CallbackStructure() -+ :nVersion(1), -+ nMagic(SAL_CONST_INT64(0x0123456789abcdef)), -+ aRegisterFunction(NULL), -+ aCallbackDispatch(NULL), -+ /* aStartTest(NULL), -+ aAddFailure(NULL), -+ aAddError(NULL), -+ aEndTest(NULL), -+ aShouldStop(NULL), -+ aAddInfo(NULL), -+ aEnterNode(NULL), -+ aLeaveNode(NULL), */ -+ psForward(NULL), -+ nBits(0), -+ /* pJobList(NULL), */ -+ nMagic2(0) -+ {} -+}; -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/autoregister: callbackstructure.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/autoregister/htestresult.h 2008-12-10 20:46:06.090738039 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/autoregister/htestresult.h 2008-02-27 17:17:34.000000000 +0100 -@@ -1 +1,6 @@ --dummy -+#ifndef _htestresult_h -+#define _htestresult_h -+ -+typedef void* hTestResult; -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/autoregister: htestresult.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/autoregister/registerfunc.h 2008-12-10 20:46:06.135034318 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/autoregister/registerfunc.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,50 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef _registerfunc_h -+#define _registerfunc_h -+ -+#include <sal/types.h> -+#include <cppunit/autoregister/htestresult.h> -+#include <cppunit/autoregister/callbackfunc_fktptr.h> -+#include <cppunit/autoregister/testfunc.h> -+ -+struct CallbackStructure; -+ -+// this function is used to register one function into a Container in the testshl tool. -+extern "C" void SAL_CALL registerFunction(FktPtr aFunc, const char* aFuncName); -+ -+// this function is the register function for auto registering -+ -+extern "C" void SAL_CALL registerAllTestFunction(CallbackStructure* ); -+typedef void (* FktRegAllPtr)(CallbackStructure*); -+ -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/autoregister: registerfunc.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/autoregister/registertestfunction.h 2008-12-10 20:46:06.214882818 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/autoregister/registertestfunction.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,54 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef _registertestfunction_h -+#define _registertestfunction_h -+ -+#include <sal/types.h> -+#include <cppunit/autoregister/testfunc.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+// function ptr, to register a function -+typedef void (* FktRegFuncPtr)(FktPtr aFunc, const char* aFuncName); -+ -+// this function is used in the testdll to register the given function -+// into the testshl -+extern "C" void SAL_CALL RegisterTestFunctions(FktRegFuncPtr aFunc); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/autoregister: registertestfunction.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/autoregister/testfunc.h 2008-12-10 20:46:06.292344601 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/autoregister/testfunc.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,47 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef _testfunc_h -+#define _testfunc_h -+ -+#include <cppunit/autoregister/htestresult.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+// typedef for a testfunction -+typedef void (* FktPtr)(hTestResult); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/autoregister: testfunc.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/checkboom.hxx 2008-12-10 20:46:06.371034174 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/checkboom.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,40 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef CHECKBOOM_HXX -+#define CHECKBOOM_HXX -+ -+#include <string> -+#include <rtl/ustring.hxx> -+ -+void CheckBoom(bool bCondition, std::string const& msg); -+void CheckBoom(bool bCondition, rtl::OUString const& msg); -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: checkboom.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/cmdlinebits.hxx 2008-12-10 20:46:06.465888459 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/cmdlinebits.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,52 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef CMDLINEBITS_HXX -+#define CMDLINEBITS_HXX -+ -+#include <sal/types.h> -+ -+typedef sal_uInt32 CmdLineBits; -+const char* getForwardString(); -+ -+#include <stdarg.h> -+ -+enum T_Print_Params { -+ T_INFO = 1, -+ T_VERBOSE, -+ T_DEBUG, -+ T_ERROR -+}; -+ -+// void t_print(const char*); -+void t_print(const char*, ...); -+void t_print(T_Print_Params, const char*, ...); -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: cmdlinebits.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/extensions/AutoRegisterSuite.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/extensions/AutoRegisterSuite.h 2008-02-27 17:16:16.000000000 +0100 -@@ -1,6 +1,7 @@ - #ifndef CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H - #define CPPUNIT_EXTENSIONS_AUTOREGISTERSUITE_H - -+#include <stdio.h> - #include <string> - #include <cppunit/extensions/TestSuiteFactory.h> - #include <cppunit/extensions/TestFactoryRegistry.h> -@@ -30,19 +31,20 @@ - /** Auto-register the suite factory in the global registry. - */ - AutoRegisterSuite() -- { -- TestFactory *factory = new TestSuiteFactory<TestCaseType>(); -- TestFactoryRegistry::getRegistry().registerFactory( factory ); -- } -- -+ { -+ TestFactory *factory = new TestSuiteFactory<TestCaseType>(); -+ TestFactoryRegistry::getRegistry().registerFactory( factory ); -+ } -+ - /** Auto-register the suite factory in the specified registry. - * \param name Name of the registry. - */ - AutoRegisterSuite( const std::string &name ) -- { -- TestFactory *factory = new TestSuiteFactory<TestCaseType>(); -- TestFactoryRegistry::getRegistry( name ).registerFactory( factory ); -- } -+ { -+ // printf("AutoRegisterSuite %s\n", name.c_str()); -+ TestFactory *factory = new TestSuiteFactory<TestCaseType>(); -+ TestFactoryRegistry::getRegistry( name ).registerFactory( factory ); -+ } - }; - - } // namespace CppUnit ---- misc/cppunit-1.8.0/include/cppunit/extensions/HelperMacros.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/extensions/HelperMacros.h 2008-02-27 17:17:12.000000000 +0100 -@@ -132,6 +132,14 @@ - } \ - }; \ - public: \ -+ static CppUnit::TestSuite *suite() \ -+ { \ -+ CppUnit::TestSuiteBuilder<__ThisTestFixtureType> \ -+ builder __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType ); \ -+ ThisTestFixtureFactory factory; \ -+ __ThisTestFixtureType::registerTests( builder.suite(), &factory ); \ -+ return builder.takeSuite(); \ -+ } \ - static void \ - registerTests( CppUnit::TestSuite *suite, \ - CppUnit::TestFixtureFactory *factory ) \ -@@ -245,14 +253,6 @@ - #define CPPUNIT_TEST_SUITE_END() \ - builder.takeSuite(); \ - } \ -- static CppUnit::TestSuite *suite() \ -- { \ -- CppUnit::TestSuiteBuilder<__ThisTestFixtureType> \ -- builder __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType ); \ -- ThisTestFixtureFactory factory; \ -- __ThisTestFixtureType::registerTests( builder.suite(), &factory ); \ -- return builder.takeSuite(); \ -- } \ - private: /* dummy typedef so that the macro can still end with ';'*/ \ - typedef ThisTestFixtureFactory __ThisTestFixtureFactory - -@@ -283,10 +283,12 @@ - * \see CPPUNIT_TEST_SUITE, CppUnit::AutoRegisterSuite, - * CppUnit::TestFactoryRegistry. - */ --#define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \ -- static CppUnit::AutoRegisterSuite< ATestFixtureType > \ -- __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite ) - -+/* LLA: -+ #define CPPUNIT_TEST_SUITE_REGISTRATION( ATestFixtureType ) \ -+ static CppUnit::AutoRegisterSuite< ATestFixtureType > \ -+ __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite ) -+*/ - - /** Adds the specified fixture suite to the specified registry suite. - * \ingroup CreatingTestSuite -@@ -325,21 +327,7 @@ - */ - #define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ATestFixtureType, suiteName ) \ - static CppUnit::AutoRegisterSuite< ATestFixtureType > \ -- __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )(suiteName) -- -- --// Backwards compatibility --// (Not tested!) -- --#if CPPUNIT_ENABLE_CU_TEST_MACROS -- --#define CU_TEST_SUITE(tc) CPPUNIT_TEST_SUITE(tc) --#define CU_TEST_SUB_SUITE(tc,sc) CPPUNIT_TEST_SUB_SUITE(tc,sc) --#define CU_TEST(tm) CPPUNIT_TEST(tm) --#define CU_TEST_SUITE_END() CPPUNIT_TEST_SUITE_END() --#define CU_TEST_SUITE_REGISTRATION(tc) CPPUNIT_TEST_SUITE_REGISTRATION(tc) -- --#endif -+ __CPPUNIT_MAKE_UNIQUE_NAME(__autoRegisterSuite )( suiteName ) - - - #endif // CPPUNIT_EXTENSIONS_HELPERMACROS_H ---- misc/cppunit-1.8.0/include/cppunit/extensions/TestFactoryRegistry.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/extensions/TestFactoryRegistry.h 2008-02-27 17:16:38.000000000 +0100 -@@ -4,14 +4,18 @@ - #include <cppunit/Portability.h> - - #if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER - #pragma warning( push ) - #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z - #endif -+#endif - - #include <cppunit/extensions/TestFactory.h> - #include <map> - #include <string> - -+#include <cppunit/autoregister/htestresult.h> -+ - namespace CppUnit { - - class TestSuite; -@@ -79,7 +83,7 @@ - * \param name Name of the registry. It is the name of TestSuite returned by - * makeTest(). - */ -- TestFactoryRegistry( std::string name = "All Tests" ); -+ TestFactoryRegistry( std::string const& name = "All Tests" ); - - /// Destructor. - virtual ~TestFactoryRegistry(); -@@ -105,6 +109,7 @@ - * specified name. - */ - static TestFactoryRegistry &getRegistry( const std::string &name ); -+ static void testRegistries(hTestResult _pResult); - - /** Adds the registered tests to the specified suite. - * \param suite Suite the tests are added to. -@@ -116,9 +121,12 @@ - * \param factory Factory to register. - * \deprecated Use registerFactory( TestFactory *) instead. - */ -+protected: -+ - void registerFactory( const std::string &name, - TestFactory *factory ); -- -+public: -+ - /** Adds the specified TestFactory to the registry. - * - * \param factory Factory to register. -@@ -141,8 +149,10 @@ - - - #if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER - #pragma warning( pop ) - #endif -+#endif - - - #endif // CPPUNIT_EXTENSIONS_TESTFACTORYREGISTRY_H ---- misc/cppunit-1.8.0/include/cppunit/extensions/TestSuiteBuilder.h 2002-03-28 16:47:07.000000000 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/extensions/TestSuiteBuilder.h 2008-02-27 17:17:22.000000000 +0100 -@@ -34,11 +34,11 @@ - } - #endif - -- TestSuiteBuilder( TestSuite *suite ) : m_suite( suite ) -+ TestSuiteBuilder( TestSuite *_suite ) : m_suite( _suite ) - { - } - -- TestSuiteBuilder(std::string name) : m_suite( new TestSuite(name) ) -+ TestSuiteBuilder(std::string const& name) : m_suite( new TestSuite(name) ) - { - } - -@@ -57,7 +57,7 @@ - m_suite->addTest( test ); - } - -- void addTestCaller( std::string methodName, -+ void addTestCaller( std::string const& methodName, - TestMethod testMethod ) - { - Test *test = -@@ -66,7 +66,7 @@ - addTest( test ); - } - -- void addTestCaller( std::string methodName, -+ void addTestCaller( std::string const& methodName, - TestMethod testMethod, - Fixture *fixture ) - { -@@ -78,7 +78,7 @@ - } - - template<typename ExceptionType> -- void addTestCallerForException( std::string methodName, -+ void addTestCallerForException( std::string const& methodName, - TestMethod testMethod, - Fixture *fixture, - ExceptionType *dummyPointer ) -@@ -93,7 +93,8 @@ - - std::string makeTestName( const std::string &methodName ) - { -- return m_suite->getName() + "." + methodName; -+ // return m_suite->getName() + "." + methodName; -+ return methodName; - } - - private: ---- misc/cppunit-1.8.0/include/cppunit/externcallbackfunc.hxx 2008-12-10 20:46:06.550085206 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/externcallbackfunc.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,58 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef _externcallbackfunc_hxx -+#define _externcallbackfunc_hxx -+ -+#include <cppunit/autoregister/callbackfunc_fktptr.h> -+ -+// these pointers have they origin in 'tresregister.cxx' -+extern FktPtr_CallbackDispatch pCallbackFunc; -+ -+//# extern FktPtr_TestResult_startTest pTestResult_StartTest; -+//# extern FktPtr_TestResult_addFailure pTestResult_AddFailure; -+//# extern FktPtr_TestResult_addError pTestResult_AddError; -+//# extern FktPtr_TestResult_endTest pTestResult_EndTest; -+//# extern FktPtr_TestResult_addInfo pTestResult_AddInfo; -+ -+// these pointers have they origin in 'tresregister.cxx' -+// extern FktPtr_TestResult_Starter pTestResult_Starter; -+ -+//# extern FktPtr_TestResult_startTest pTestResult_StartTest; -+//# extern FktPtr_TestResult_addFailure pTestResult_AddFailure; -+//# extern FktPtr_TestResult_addError pTestResult_AddError; -+//# extern FktPtr_TestResult_endTest pTestResult_EndTest; -+//# extern FktPtr_TestResult_addInfo pTestResult_AddInfo; -+//# -+//# extern FktPtr_TestResult_enterNode pTestResult_EnterNode; -+//# extern FktPtr_TestResult_leaveNode pTestResult_LeaveNode; -+//# -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: externcallbackfunc.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/joblist.hxx 2008-12-10 20:46:06.643901729 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/joblist.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,99 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef CPPUNIT_JOBLIST_HXX -+#define CPPUNIT_JOBLIST_HXX -+ -+#include <vector> -+#include <string> -+#include <hash_map> -+#include "sal/types.h" -+ -+// #include <cppunit/nocopy.hxx> -+ -+/* -+ struct eqstr -+ { -+ bool operator()( std::string const & s1, std::string const& s2 ) const -+ { -+ return ( s1 == s2 ); -+ } -+ }; -+*/ -+ -+/* -+ struct hashstr -+ { -+ sal_uInt32 operator()( std::string const & str ) const -+ { -+ return str.hashCode(); -+ } -+ }; -+*/ -+typedef std::hash_map< std::string, int > HashMap; -+ -+// typedef std::vector<std::string> StringList; -+ -+#define JOB_UNKNOWN 0 -+#define JOB_NOT_FOUND 1 -+#define JOB_PASSED 2 -+#define JOB_FAILED 3 -+#define JOB_ACCESS 4 -+ -+#define JOB_EXCLUDE_LIST 0x1000 -+#define JOB_ONLY_LIST 0x1001 -+ -+typedef sal_Int16 JobType; -+ -+class JobList /* : NOCOPY */ -+{ -+ HashMap m_aJobList; -+ char** ppsJobList; -+ -+ // returns true if the given List contains unxlngi or unxsols or wntmsci... -+ bool isInCurrentEnvironment(std::string const& _sString); -+ std::string trim(std::string const& _sStringToTrim); -+ -+public: -+ JobList(); -+ ~JobList(); -+ -+ bool readfile(std::string const& _sFilename, JobType _nJobType); -+ const char** getList() const {return (const char**)ppsJobList;} -+ -+ int getJobListEntry(std::string const& _sIndexName); -+ void setJobListEntry(std::string const& _sIndexName, int _nValue); -+ -+ int size() {return m_aJobList.size();} -+ HashMap const& getHashMap() {return m_aJobList;} -+}; -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit: joblist.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/nocopy.hxx 2008-12-10 20:46:06.720535461 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/nocopy.hxx 2008-02-27 17:08:42.000000000 +0100 -@@ -1 +1,13 @@ --dummy -+#ifndef NOCOPY_HXX -+#define NOCOPY_HXX -+ -+// prevent illegal copies -+class NOCOPY -+{ -+ NOCOPY(NOCOPY const&); -+ NOCOPY& operator=(NOCOPY const&); -+public: -+ NOCOPY(){} -+}; -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: nocopy.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/portability/config-auto.h 2008-12-10 20:46:06.802507987 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/portability/config-auto.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,64 @@ --dummy -+#ifndef _INCLUDE_CPPUNIT_CONFIG_AUTO_H -+#define _INCLUDE_CPPUNIT_CONFIG_AUTO_H 1 -+ -+/* include/cppunit/config-auto.h. Generated automatically at end of configure. */ -+/* config/config.h. Generated automatically by configure. */ -+/* config/config.h.in. Generated automatically from configure.in by autoheader. */ -+ -+/* define if library uses std::string::compare(string,pos,n) */ -+#ifndef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST -+#define CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 1 -+#endif -+ -+/* define if the library defines sstream */ -+#ifndef CPPUNIT_HAVE_SSTREAM -+#define CPPUNIT_HAVE_SSTREAM 1 -+#endif -+ -+/* Define if you have the <cmath> header file. */ -+#ifndef CPPUNIT_HAVE_CMATH -+#define CPPUNIT_HAVE_CMATH 1 -+#endif -+ -+/* Define if you have the <dlfcn.h> header file. */ -+#ifndef CPPUNIT_HAVE_DLFCN_H -+#define CPPUNIT_HAVE_DLFCN_H 1 -+#endif -+ -+/* define to 1 if the compiler implements namespaces */ -+#ifndef CPPUNIT_HAVE_NAMESPACES -+#define CPPUNIT_HAVE_NAMESPACES 1 -+#endif -+ -+/* define if the compiler supports Run-Time Type Identification */ -+#ifndef CPPUNIT_HAVE_RTTI -+#define CPPUNIT_HAVE_RTTI 0 -+#endif -+ -+/* define if the compiler has stringstream */ -+#ifndef CPPUNIT_HAVE_SSTREAM -+#define CPPUNIT_HAVE_SSTREAM 1 -+#endif -+ -+/* Define if you have the <strstream> header file. */ -+#ifndef CPPUNIT_HAVE_STRSTREAM -+#define CPPUNIT_HAVE_STRSTREAM 1 -+#endif -+ -+/* Name of package */ -+#ifndef CPPUNIT_PACKAGE -+#define CPPUNIT_PACKAGE "cppunit" -+#endif -+ -+/* Define to 1 to use type_info::name() for class names */ -+#ifndef CPPUNIT_USE_TYPEINFO_NAME -+#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI -+#endif -+ -+/* Version number of package */ -+#ifndef CPPUNIT_VERSION -+#define CPPUNIT_VERSION "1.8.0" -+#endif -+ -+/* _INCLUDE_CPPUNIT_CONFIG_AUTO_H */ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/portability: config-auto.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/portability/config-bcb5.h 2008-12-10 20:46:05.287223886 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/portability/config-bcb5.h 2008-02-27 17:15:52.000000000 +0100 -@@ -1 +1,48 @@ --dummy -+#ifndef _INCLUDE_CPPUNIT_CONFIG_BCB5_H -+#define _INCLUDE_CPPUNIT_CONFIG_BCB5_H 1 -+ -+#define HAVE_CMATH 1 -+ -+/* include/cppunit/config-bcb5.h. Manually adapted from -+ include/cppunit/config-auto.h */ -+ -+/* define if library uses std::string::compare(string,pos,n) */ -+#ifndef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST -+#define CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 1 -+#endif -+ -+/* Define if you have the <dlfcn.h> header file. */ -+#ifdef CPPUNIT_HAVE_DLFCN_H -+#undef CPPUNIT_HAVE_DLFCN_H -+#endif -+ -+/* define to 1 if the compiler implements namespaces */ -+#ifndef CPPUNIT_HAVE_NAMESPACES -+#define CPPUNIT_HAVE_NAMESPACES 1 -+#endif -+ -+/* define if the compiler supports Run-Time Type Identification */ -+#ifndef CPPUNIT_HAVE_RTTI -+#define CPPUNIT_HAVE_RTTI 1 -+#endif -+ -+/* Define to 1 to use type_info::name() for class names */ -+#ifndef CPPUNIT_USE_TYPEINFO_NAME -+#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI -+#endif -+ -+#define CPPUNIT_HAVE_SSTREAM 1 -+ -+/* Name of package */ -+#ifndef CPPUNIT_PACKAGE -+#define CPPUNIT_PACKAGE "cppunit" -+#endif -+ -+/* Version number of package */ -+#ifndef CPPUNIT_VERSION -+#define CPPUNIT_VERSION "1.5.5" -+#endif -+ -+ -+/* _INCLUDE_CPPUNIT_CONFIG_BCB5_H */ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/portability: config-bcb5.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/portability/config-msvc6.h 2008-12-10 20:46:05.392326519 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/portability/config-msvc6.h 2008-02-27 17:15:40.000000000 +0100 -@@ -1 +1,62 @@ --dummy -+#ifndef _INCLUDE_CPPUNIT_CONFIG_MSVC6_H -+#define _INCLUDE_CPPUNIT_CONFIG_MSVC6_H 1 -+ -+#define HAVE_CMATH 1 -+ -+/* include/cppunit/config-msvc6.h. Manually adapted from -+ include/cppunit/config-auto.h */ -+ -+/* define if library uses std::string::compare(string,pos,n) */ -+#ifdef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST -+#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST -+#endif -+ -+/* Define if you have the <dlfcn.h> header file. */ -+#ifdef CPPUNIT_HAVE_DLFCN_H -+#undef CPPUNIT_HAVE_DLFCN_H -+#endif -+ -+/* define to 1 if the compiler implements namespaces */ -+#ifndef CPPUNIT_HAVE_NAMESPACES -+#define CPPUNIT_HAVE_NAMESPACES 1 -+#endif -+ -+#ifndef CPPUNIT_HAVE_RTTI -+#define CPPUNIT_HAVE_RTTI 0 -+#endif -+ -+#ifndef CPPUNIT_USE_TYPEINFO_NAME -+#define CPPUNIT_USE_TYPEINFO_NAME CPPUNIT_HAVE_RTTI -+#endif -+ -+#define CPPUNIT_HAVE_SSTREAM 1 -+ -+/* Name of package */ -+#ifndef CPPUNIT_PACKAGE -+#define CPPUNIT_PACKAGE "cppunit" -+#endif -+ -+#undef CPPUNIT_API -+ -+// define CPPUNIT_DLL_BUILD when building CppUnit dll. -+#ifdef CPPUNIT_BUILD_DLL -+#define CPPUNIT_API __declspec(dllexport) -+#endif -+ -+// define CPPUNIT_DLL when linking to CppUnit dll. -+#ifdef CPPUNIT_DLL -+#define CPPUNIT_API __declspec(dllimport) -+#endif -+ -+#ifdef CPPUNIT_API -+#undef CPPUNIT_NEED_DLL_DECL -+#define CPPUNIT_NEED_DLL_DECL 1 -+#endif -+ -+#if _MSC_VER > 1000 // VC++ -+#pragma warning( disable : 4786 ) // disable warning debug symbol > 255... -+#endif // _MSC_VER > 1000 -+ -+ -+/* _INCLUDE_CPPUNIT_CONFIG_MSVC6_H */ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/portability: config-msvc6.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/SynchronizedObject.h 2008-12-10 20:46:04.893658092 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/SynchronizedObject.h 2008-02-27 17:14:06.000000000 +0100 -@@ -1 +1,82 @@ --dummy -+#ifndef CPPUNIT_SYNCHRONIZEDOBJECT_H -+#define CPPUNIT_SYNCHRONIZEDOBJECT_H -+ -+#include <cppunit/Portability.h> -+#include <cppunit/nocopy.hxx> -+ -+namespace CppUnit -+{ -+ -+/*! \brief Base class for synchronized object. -+ * -+ * Synchronized object are object which members are used concurrently by mutiple -+ * threads. -+ * -+ * This class define the class SynchronizationObject which must be subclassed -+ * to implement an actual lock. -+ * -+ * Each instance of this class holds a pointer on a lock object. -+ * -+ * See src/msvc6/MfcSynchronizedObject.h for an example. -+ */ -+class CPPUNIT_API SynchronizedObject -+{ -+public: -+ /*! \brief Abstract synchronization object (mutex) -+ */ -+ class SynchronizationObject -+ { -+ public: -+ SynchronizationObject() {} -+ virtual ~SynchronizationObject() {} -+ -+ virtual void lock() {} -+ virtual void unlock() {} -+ }; -+ -+ /*! Constructs a SynchronizedObject object. -+ */ -+ SynchronizedObject( SynchronizationObject *syncObject =0 ); -+ -+ /// Destructor. -+ virtual ~SynchronizedObject(); -+ -+protected: -+ /*! \brief Locks a synchronization object in the current scope. -+ */ -+ class ExclusiveZone : NOCOPY -+ { -+ SynchronizationObject *m_syncObject; -+ -+ public: -+ ExclusiveZone( SynchronizationObject *syncObject ) -+ : m_syncObject( syncObject ) -+ { -+ m_syncObject->lock(); -+ } -+ -+ ~ExclusiveZone() -+ { -+ m_syncObject->unlock (); -+ } -+ }; -+ -+ virtual void setSynchronizationObject( SynchronizationObject *syncObject ); -+ -+protected: -+ SynchronizationObject *m_syncObject; -+ -+private: -+ /// Prevents the use of the copy constructor. -+ SynchronizedObject( const SynchronizedObject © ); -+ -+ /// Prevents the use of the copy operator. -+ void operator =( const SynchronizedObject © ); -+}; -+ -+ -+ -+} // namespace CppUnit -+ -+ -+#endif // CPPUNIT_SYNCHRONIZEDOBJECT_H -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: SynchronizedObject.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/TestListener.h 2008-12-10 20:46:04.938237839 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/TestListener.h 2008-02-27 17:14:38.000000000 +0100 -@@ -1 +1,62 @@ --dummy -+#ifndef CPPUNIT_TESTLISTENER_H // -*- C++ -*- -+#define CPPUNIT_TESTLISTENER_H -+ -+#include <cppunit/Portability.h> -+ -+ -+namespace CppUnit { -+ -+class Exception; -+class Test; -+class TestFailure; -+ -+ -+/*! \brief Listener for test progress and result. -+ * \ingroup TrackingTestExecution -+ * -+ * Implementing the Observer pattern a TestListener may be registered -+ * to a TestResult to obtain information on the testing progress. Use -+ * specialized sub classes of TestListener for text output -+ * (TextTestProgressListener). Do not use the Listener for the test -+ * result output, use a subclass of Outputter instead. -+ * -+ * The test framework distinguishes between failures and errors. -+ * A failure is anticipated and checked for with assertions. Errors are -+ * unanticipated problems signified by exceptions that are not generated -+ * by the framework. -+ * -+ * \see TestResult -+ */ -+class CPPUNIT_API TestListener -+{ -+public: -+ virtual ~TestListener() {} -+ -+ /// Called when just before a TestCase is run. -+ virtual void startTest( Test *test ) =0 ; -+ -+ /*! Called when a failure occurs while running a test. -+ * \see TestFailure. -+ * \warning \a failure is a temporary object that is destroyed after the -+ * method call. Use TestFailure::clone() to create a duplicate. -+ */ -+ virtual void addFailure( const TestFailure &failure ) =0; -+ -+ /// Called just after a TestCase was run (even if a failure occured). -+ virtual void endTest( Test *test ) =0; -+ -+ // additional info -+ virtual void addInfo(Test *test, const char*) =0; -+ -+ // info in which node we are -+ // helper functions to create tree structures -+ // old: virtual void enterNode( const char* ) =0; -+ // old: virtual void leaveNode( const char* ) =0; -+}; -+ -+ -+} // namespace CppUnit -+ -+#endif // CPPUNIT_TESTLISTENER_H -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: TestListener.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/TestResult.h 2008-12-10 20:46:05.070889564 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/TestResult.h 2008-02-27 17:13:08.000000000 +0100 -@@ -1 +1,123 @@ --dummy -+#ifndef CPPUNIT_TESTRESULT_H -+#define CPPUNIT_TESTRESULT_H -+ -+#include <cppunit/Portability.h> -+ -+#if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER -+#pragma warning( push ) -+#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z -+#endif -+#endif -+ -+#include <cppunit/result/SynchronizedObject.h> -+#include <vector> -+#include <string> -+#include <deque> -+//!io #include <iostream> -+ -+#include "cppunit/result/optionhelper.hxx" -+#include "cppunit/TestFailure.h" -+ -+class Outputter; -+namespace CppUnit { -+ -+class Exception; -+class Test; -+// class TestFailure; -+class TestListener; -+ -+#if CPPUNIT_NEED_DLL_DECL -+ template class CPPUNIT_API std::deque<TestListener *>; -+#endif -+ -+/*! \brief Manages TestListener. -+ * \ingroup TrackingTestExecution -+ * -+ * A single instance of this class is used when running the test. It is usually -+ * created by the test runner (TestRunner). -+ * -+ * This class shouldn't have to be inherited from. Use a TestListener -+ * or one of its subclasses to be informed of the ongoing tests. -+ * Use a Outputter to receive a test summary once it has finished -+ * -+ * TestResult supplies a template method 'setSynchronizationObject()' -+ * so that subclasses can provide mutual exclusion in the face of multiple -+ * threads. This can be useful when tests execute in one thread and -+ * they fill a subclass of TestResult which effects change in another -+ * thread. To have mutual exclusion, override setSynchronizationObject() -+ * and make sure that you create an instance of ExclusiveZone at the -+ * beginning of each method. -+ * -+ * \see Test, TestListener, TestResultCollector, Outputter. -+ */ -+class CPPUNIT_API TestResult : protected SynchronizedObject -+{ -+protected: -+ OptionHelper m_aOptionHelper; -+ -+public: -+ TestResult( GetOpt & _aOptions, SynchronizationObject *syncObject = 0 ); -+ virtual ~TestResult(); -+ -+ virtual void addListener( TestListener *listener ); -+ virtual void removeListener( TestListener *listener ); -+ -+ virtual void reset(); -+ virtual void stop(); -+ -+ virtual bool shouldStop() const; -+ -+ virtual void startTest( Test *test ); -+ virtual void addError( Test *test, Exception *e, ErrorType::num eType=ErrorType::ET_ERROR); -+ virtual void addFailure( Test *test, Exception *e ); -+ virtual void endTest( Test *test ); -+ -+ // LLA: additionals -+ virtual void addInfo(Test *test, const char *sInfo); -+ -+ virtual void enterNode(const char* Node); -+ virtual void leaveNode(const char* Node); -+ virtual std::string getNodeName(); -+ -+ // if true, execution is allowed. -+ virtual bool isAllowedToExecute(std::string const & sName); -+ bool isOnlyShowJobs() {return m_aOptionHelper.isOnlyShowJobs();} -+ bool isOptionWhereAmI(); -+ -+ virtual void print(Outputter &); -+ void setExitValue(int _nValue) {m_nExitValue = _nValue;} -+ int getExitValue() {return m_nExitValue;} -+ -+protected: -+ void addFailure( const TestFailure &failure ); -+ -+protected: -+ typedef std::deque<TestListener *> TestListeners; -+ TestListeners m_listeners; -+ bool m_stop; -+ -+ // this vector is used to expand the test name with a current node name -+ std::vector<std::string> m_aCurrentNodeNames; -+ -+ //# std::vector<std::string> m_aNodes; -+ -+private: -+ TestResult( const TestResult &other ); -+ TestResult &operator =( const TestResult &other ); -+ int m_nExitValue; -+}; -+ -+ -+} // namespace CppUnit -+ -+ -+#if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER -+#pragma warning( pop ) -+#endif -+#endif -+ -+#endif // CPPUNIT_TESTRESULT_H -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: TestResult.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/TestResultCollector.h 2008-12-10 20:46:05.024473262 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/TestResultCollector.h 2008-02-27 17:14:48.000000000 +0100 -@@ -1 +1,165 @@ --dummy -+#ifndef CPPUNIT_TESTRESULTCOLLECTOR_H -+#define CPPUNIT_TESTRESULTCOLLECTOR_H -+ -+#include <cppunit/Portability.h> -+ -+#if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER -+#pragma warning( push ) -+#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z -+#endif -+#endif -+ -+#include <cppunit/result/TestResult.h> -+#include <cppunit/result/TestSucessListener.h> -+#include <deque> -+#include <vector> -+ -+namespace CppUnit -+{ -+ -+ -+#if CPPUNIT_NEED_DLL_DECL -+ template class CPPUNIT_API std::deque<TestFailure *>; -+ template class CPPUNIT_API std::deque<Test *>; -+#endif -+ -+ -+/*! \brief Collects test result. -+ * \ingroup WritingTestResult -+ * \ingroup BrowsingCollectedTestResult -+ * -+ * A TestResultCollector is a TestListener which collects the results of executing -+ * a test case. It is an instance of the Collecting Parameter pattern. -+ * -+ * The test framework distinguishes between failures and errors. -+ * A failure is anticipated and checked for with assertions. Errors are -+ * unanticipated problems signified by exceptions that are not generated -+ * by the framework. -+ * \see TestListener, TestFailure. -+ */ -+ -+class OneStringContainer -+{ -+ std::string m_sName; -+protected: -+ OneStringContainer() {} -+public: -+ OneStringContainer(std::string const& _sName) -+ :m_sName(_sName){} -+ std::string getString() const {return m_sName;} -+ virtual ~OneStringContainer(){} -+}; -+ -+// ----------------------------------------------------------------------------- -+class TestEnvelope : public OneStringContainer -+{ -+ Test* m_pTest; -+public: -+ TestEnvelope():m_pTest(NULL){} -+ -+ TestEnvelope(Test* _pTest, std::string const& _sName) -+ : OneStringContainer(_sName), -+ m_pTest(_pTest) -+ {} -+ -+ Test* getTest() {return m_pTest;} -+ virtual ~TestEnvelope(){} -+ -+}; -+ -+// ----------------------------------------------------------------------------- -+class TestInfo : public TestEnvelope -+{ -+public: -+ TestInfo(Test* _pTest, std::string const& _sName) -+ :TestEnvelope(_pTest, _sName) -+ {} -+}; -+ -+// ----------------------------------------------------------------------------- -+class TestFailureEnvelope : public OneStringContainer -+{ -+ TestFailure* m_pTestFailure; -+public: -+ TestFailureEnvelope():m_pTestFailure(NULL){} -+ -+ TestFailureEnvelope(TestFailure* _pTestFailure, std::string const& _sName) -+ :OneStringContainer(_sName), -+ m_pTestFailure(_pTestFailure) -+ {} -+ -+ TestFailure* getTestFailure() {return m_pTestFailure;} -+ virtual ~TestFailureEnvelope(){} -+ -+}; -+// ----------------------------------------------------------------------------- -+ -+class CPPUNIT_API TestResultCollector : public TestSucessListener -+{ -+ TestResult* m_pResult; -+public: -+ typedef std::deque<TestFailureEnvelope *> TestFailures; -+ typedef std::deque<TestEnvelope *> Tests; -+ typedef std::vector<TestInfo *> TestInfos; -+ -+ -+ /*! Constructs a TestResultCollector object. -+ */ -+ TestResultCollector( TestResult *_pResult, SynchronizationObject *syncObject = 0 ); -+ -+ /// Destructor. -+ virtual ~TestResultCollector(); -+ -+ void startTest( Test *test ); -+ void endTest( Test *test ); -+ -+ void addFailure( const TestFailure &failure ); -+ -+ virtual void reset(); -+ -+ virtual int runTests() const; -+ virtual int testErrors() const; -+ virtual int testFailures() const; -+ virtual int testFailuresTotal() const; -+ -+ virtual const TestFailures& failures() const; -+ virtual const Tests &tests() const; -+ virtual std::string getInfo(Test*); -+ -+ virtual void addInfo(Test *test, const char *sInfo); -+ -+ // virtual void enterNode(const char* Node); -+ // virtual void leaveNode(const char* Node); -+ -+protected: -+ Tests m_tests; -+ TestFailures m_failures; -+ TestInfos m_aInfos; -+ -+ int m_testErrors; -+ -+ // this vector is used to expand the test name with a current node name -+ // std::vector<std::string> m_aCurrentNodeNames; -+ // std::string getNodeName(); -+private: -+ /// Prevents the use of the copy constructor. -+ TestResultCollector( const TestResultCollector © ); -+ -+ /// Prevents the use of the copy operator. -+ void operator =( const TestResultCollector © ); -+}; -+ -+ -+ -+} // namespace CppUnit -+ -+ -+#if CPPUNIT_NEED_DLL_DECL -+#ifdef _MSC_VER -+#pragma warning( pop ) -+#endif -+#endif -+ -+ -+#endif // CPPUNIT_TESTRESULTCOLLECTOR_H -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: TestResultCollector.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/TestSucessListener.h 2008-12-10 20:46:05.161106554 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/TestSucessListener.h 2008-02-27 17:14:16.000000000 +0100 -@@ -1 +1,40 @@ --dummy -+#ifndef CPPUNIT_TESTSUCESSLISTENER_H -+#define CPPUNIT_TESTSUCESSLISTENER_H -+ -+#include <cppunit/result/SynchronizedObject.h> -+#include <cppunit/result/TestListener.h> -+ -+ -+namespace CppUnit -+{ -+ -+/*! \brief TestListener that checks if any test case failed. -+ * \ingroup TrackingTestExecution -+ */ -+class CPPUNIT_API TestSucessListener : public TestListener, -+ public SynchronizedObject -+{ -+public: -+ /*! Constructs a TestSucessListener object. -+ */ -+ TestSucessListener( SynchronizationObject *syncObject = 0 ); -+ -+ /// Destructor. -+ virtual ~TestSucessListener(); -+ -+ virtual void reset(); -+ -+ void addFailure( const TestFailure &failure ); -+ -+ /// Returns whether the entire test was successful or not. -+ virtual bool wasSuccessful() const; -+ -+private: -+ bool m_sucess; -+}; -+ -+ -+} // namespace CppUnit -+ -+ -+#endif // CPPUNIT_TESTSUCESSLISTENER_H -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: TestSucessListener.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/TextTestResult.h 2008-12-10 20:46:05.242583534 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/TextTestResult.h 2008-02-27 17:14:28.000000000 +0100 -@@ -1 +1,62 @@ --dummy -+#ifndef CPPUNIT_TEXTTESTRESULT_H -+#define CPPUNIT_TEXTTESTRESULT_H -+ -+#include <cppunit/result/TestResult.h> -+#include <cppunit/result/TestResultCollector.h> -+#include <ostream> -+ -+class GetOpt; -+namespace CppUnit { -+ -+class SourceLine; -+class Exception; -+class Test; -+ -+/*! \brief Holds printable test result (DEPRECATED). -+ * \ingroup TrackingTestExecution -+ * -+ * deprecated Use class TextTestProgressListener and TextOutputter instead. -+ */ -+class CPPUNIT_API TextTestResult : public TestResult -+/* public TestResultCollector*/ -+{ -+ TestResultCollector m_aResulter; -+public: -+ TextTestResult(GetOpt& _aOptions); -+ -+ virtual void addFailure( const TestFailure &failure ); -+ virtual void startTest( Test *test ); -+ virtual void endTest( Test *test ); -+ -+ virtual void print( std::ostream &stream ); -+protected: -+ -+ virtual void printFailures( std::ostream &stream ); -+ virtual void printHeader( std::ostream &stream ); -+ -+ virtual void printFailure( TestFailure *failure, -+ int failureNumber, -+ std::ostream &stream ); -+ virtual void printFailureListMark( int failureNumber, -+ std::ostream &stream ); -+ virtual void printFailureTestName( TestFailure *failure, -+ std::ostream &stream ); -+ virtual void printFailureType( TestFailure *failure, -+ std::ostream &stream ); -+ virtual void printFailureLocation( SourceLine sourceLine, -+ std::ostream &stream ); -+ virtual void printFailureDetail( Exception *thrownException, -+ std::ostream &stream ); -+ virtual void printFailureWarning( std::ostream &stream ); -+ virtual void printStatistics( std::ostream &stream ); -+}; -+ -+/** insertion operator for easy output */ -+std::ostream &operator <<( std::ostream &stream, -+ TextTestResult &result ); -+ -+} // namespace CppUnit -+ -+#endif // CPPUNIT_TEXTTESTRESULT_H -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: TextTestResult.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/callbackfunc.h 2008-12-10 20:46:06.881445744 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/callbackfunc.h 2008-02-27 17:15:00.000000000 +0100 -@@ -1 +1,25 @@ --dummy -+#ifndef _callbackfunc_h -+#define _callbackfunc_h -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+ // this is the entry point from the DLL back to the executable. -+ sal_Int32 CallbackDispatch(int x, ...); -+ -+//# void TestResult_startTest(hTestResult _pResult, hTest _pTest); -+//# void TestResult_addFailure( hTestResult _pResult, hTest _pTest, hException _pException ); -+//# void TestResult_addError( hTestResult _pResult, hTest _pTest, hException _pException ); -+//# void TestResult_endTest( hTestResult _pResult, hTest _pTest ); -+//# bool TestResult_shouldStop(hTestResult _pResult); -+//# void TestResult_addInfo( hTestResult _pResult, hTest _pTest, const char* _sInfo ); -+//# -+//# void TestResult_enterNode( hTestResult _pResult, const char* _sInfo ); -+//# void TestResult_leaveNode( hTestResult _pResult, const char* _sInfo ); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: callbackfunc.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/emacsTestResult.hxx 2008-12-10 20:46:06.924792880 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/emacsTestResult.hxx 2008-12-10 20:42:43.000000000 +0100 -@@ -1 +1,82 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef cppunit_emacstestresult_h -+#define cppunit_emacstestresult_h -+ -+#include <cppunit/result/TestResult.h> -+#include <cppunit/result/TestResultCollector.h> -+#include <ostream> -+#include "testshl/getopt.hxx" -+ -+class Outputter; -+namespace CppUnit { -+ -+class SourceLine; -+class Exception; -+class Test; -+ -+/*! \brief Holds printable test result (DEPRECATED). -+ * \ingroup TrackingTestExecution -+ * -+ * deprecated Use class TextTestProgressListener and TextOutputter instead. -+ */ -+ class CPPUNIT_API emacsTestResult : public TestResult -+ -+/* ,public TestResultCollector*/ -+ { -+ GetOpt & m_aOptions; -+ // OptionHelper m_aOptionHelper; -+ TestResultCollector m_aResulter; -+ -+ public: -+ emacsTestResult(GetOpt & _aOptions); -+ -+ // virtual void addFailure( const TestFailure &failure ); -+ // virtual void startTest( Test *test ); -+ // virtual void endTest( Test *test ); -+ -+ virtual void print( Outputter &stream ); -+ -+ protected: -+ virtual void printHeader( Outputter &stream ); -+ // virtual void printTestLine( Outputter &stream, Test* pTest, std::string const& _sNodeName, std::string const& _sInfo); -+ virtual void printFailureLine( Outputter &stream, TestFailure* pFailure, std::string const& _sNodeName ); -+ }; -+ -+/** insertion operator for easy output */ -+// std::ostream &operator <<( std::ostream &stream, -+// emacsTestResult &result ); -+ -+} // namespace CppUnit -+ -+#endif // CPPUNIT_testshlTESTRESULT_H -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: emacsTestResult.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/log.hxx 2008-12-10 20:46:07.004030154 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/log.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,106 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+#ifndef __QADEV_REGSCAN_LOG_HXX__ -+#define __QADEV_REGSCAN_LOG_HXX__ -+ -+#include <time.h> -+#include <rtl/ustring.hxx> -+#include <rtl/strbuf.hxx> -+#include <sal/types.h> -+#include <osl/thread.h> -+#include <osl/file.hxx> -+ -+#include <cppunit/nocopy.hxx> -+ -+//!io #include <iostream> -+#include <vector> -+ -+// using namespace std; -+ -+ -+/** -+ * Log derives the interface of the ::osl::File class ( is-a relation ). -+ * Its members (has-a relation) are the (full qualified)name of the log -+ * and an OStringBuffer which represents the content of the logfile. -+ * It provides the functionality of easy-to-use open and write logs -+ */ -+//: Log -+class Log : NOCOPY { -+ -+ ::osl::File* m_logfile; // fileobject -+ rtl::OUString m_logurl; // url of log -+ rtl::OStringBuffer m_buf; // content of log -+ -+ Log(); -+ -+public: -+ -+ //> c'tor -+ /** -+ * constructors argument is a full qualified UNC path -+ * @param OUString logfile ( full qualified UNC path ) -+ */ -+ Log( const rtl::OUString& logURL ) -+ : m_logfile( new ::osl::File( logURL )) -+ , m_logurl(logURL) -+ {} ///< c'tor -+ -+ //> d'tor -+ virtual ~Log() -+ { -+ m_logfile->close(); -+ delete( m_logfile ); -+ } ///< d'tor -+ -+ //> inline methods -+ // returns a reference to name instance -+ inline rtl::OUString getLogURL() { return m_logurl; } -+ inline rtl::OString getName() { return rtl::OUStringToOString( -+ m_logurl, RTL_TEXTENCODING_ASCII_US ); } -+ ///< inline methods -+ -+ // open logfile for overwrite (default) or append -+ ::osl::FileBase::RC open( sal_Bool append = sal_False ); -+ ::osl::FileBase::RC close() { return m_logfile->close(); } -+ -+ -+ // write methods without (default) or with echo on display -+ ::osl::FileBase::RC write( const sal_Char* buf, sal_Bool v = sal_False ); -+ ::osl::FileBase::RC write( const rtl::OString& buf, -+ sal_Bool v = sal_False ); -+ //! ::osl::FileBase::RC write( rtl::OStringBuffer& buf, -+ //! sal_Bool v = sal_False ); -+ ::osl::FileBase::RC write( const rtl::OUString& buf, -+ rtl_TextEncoding enc = RTL_TEXTENCODING_ASCII_US, -+ sal_Bool v = sal_False ); -+ -+}; ///:~ Log -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: log.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/optionhelper.hxx 2008-12-10 20:46:07.084399993 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/optionhelper.hxx 2008-12-10 20:42:43.000000000 +0100 -@@ -1 +1,98 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef optionhelper_hxx -+#define optionhelper_hxx -+ -+#include <string> -+ -+#include <sal/types.h> -+ -+#include "cppunit/nocopy.hxx" -+#include "testshl/getopt.hxx" -+#include "cppunit/joblist.hxx" -+ -+// ----------------------------------------------------------------------------- -+ -+typedef std::vector<rtl::OString> OStringList; -+ -+//!? Better: OptionHelper -+class OptionHelper : NOCOPY -+{ -+ GetOpt & m_aOption; -+ JobList m_aJobOnlyList; -+ JobList m_aJobExcludeList; -+ OStringList m_aJobFilter; -+ -+ std::string m_sProjectId; -+ std::string m_sBuildId; -+ -+ std::string getProjectId() const; -+ std::string getBuildId() const; -+ std::string createDateTag(std::string const& _sProjectId, std::string const& _sBuildId); -+ -+ void handleJobs(); -+public: -+ OptionHelper(GetOpt & _aOption) -+ :m_aOption(_aOption) -+ { -+ if (m_aOption.hasOpt("-projectid")) -+ m_sProjectId = m_aOption.getOpt("-projectid"); -+ -+ if (m_aOption.hasOpt("-buildid")) -+ m_sBuildId = m_aOption.getOpt("-buildid"); -+ -+ handleJobs(); -+ } -+ -+ static std::string integerToAscii(sal_Int32 nValue); -+ static std::string twoDigits(std::string const& _sValue); -+ -+ std::string createDateTag(); -+ bool showErrors(); -+ bool showTests(); -+ -+ JobList getJobOnlyList() {return m_aJobOnlyList;} -+ JobList getJobExcludeList() {return m_aJobExcludeList;} -+ -+ bool isAllowedToExecute(std::string const& _sNode, std::string const& _sName); -+ -+ bool isOnlyShowJobs() {return m_aOption.hasOpt("-onlyshowjobs") == sal_True ? true : false;} -+ GetOpt& getOptions() {return m_aOption;} -+ bool isVerbose() {return m_aOption.hasOpt("-verbose") == sal_True ? true : false;} -+ bool isOptionWhereAmI() {return m_aOption.hasOpt("-whereami") == sal_True ? true : false;} -+}; -+ -+// ----------------------------------------------------------------------------- -+ -+ -+#endif -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: optionhelper.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/outputter.hxx 2008-12-10 20:46:07.186579135 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/outputter.hxx 2008-12-10 20:42:43.000000000 +0100 -@@ -1 +1,85 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// -+ -+#ifndef outputter_hxx -+#define outputter_hxx -+ -+#include <string> -+#include <ostream> -+#include <memory> -+#include "testshl/log.hxx" -+#include <sal/types.h> -+#include "cppunit/nocopy.hxx" -+ -+// #include <fstream> -+ -+class Outputter : NOCOPY -+{ -+ std::auto_ptr<Log> m_pLog; -+ std::ostream* m_pStream; -+ -+ void writeToAll(const sal_Char* _pStr); -+public: -+ class endl -+ { -+ char c; -+ public: -+ endl():c('\0'){} -+ }; -+public: -+ Outputter(Log * _pLog ) -+ :m_pLog(_pLog), -+ m_pStream(NULL) {} -+ -+ Outputter(std::ostream& _aStream) -+ :m_pLog(NULL), -+ m_pStream(&_aStream) {} -+ -+ ~Outputter(); -+ -+ void write(const sal_Char*); -+ void write(std::string const&); -+ void write(sal_Int32); -+ // void write(double); -+}; -+ -+Outputter& operator <<( Outputter &stream, const sal_Char* ); -+Outputter& operator <<( Outputter &stream, std::string const& ); -+Outputter& operator <<( Outputter &stream, sal_Int32 ); -+// Outputter& operator <<( Outputter &stream, double ); -+ -+Outputter& operator <<( Outputter &stream, Outputter::endl const&); -+ -+// Outputter& operator <<( Outputter &stream, const char* ); -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: outputter.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/result/testshlTestResult.h 2008-12-10 20:46:07.267386761 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/result/testshlTestResult.h 2008-12-10 20:42:43.000000000 +0100 -@@ -1 +1,72 @@ --dummy -+#ifndef cppunit_testshltestresult_h -+#define cppunit_testshltestresult_h -+ -+#include <map> -+#include <cppunit/result/TestResult.h> -+#include <cppunit/result/TestResultCollector.h> -+#include <ostream> -+#include "testshl/getopt.hxx" -+ -+class Outputter; -+ -+namespace CppUnit { -+ -+class SourceLine; -+class Exception; -+class Test; -+ -+struct ltstr -+{ -+ bool operator()(const CppUnit::Test* p1, const CppUnit::Test* p2) const -+ { -+ return p1 < p2; -+ } -+}; -+typedef std::map<CppUnit::Test*, bool, ltstr> TestPtrList; -+ -+ -+/*! \brief Holds printable test result (DEPRECATED). -+ * \ingroup TrackingTestExecution -+ * -+ * deprecated Use class TextTestProgressListener and TextOutputter instead. -+ */ -+ class CPPUNIT_API testshlTestResult : public TestResult -+ -+/* ,public TestResultCollector*/ -+ { -+ GetOpt & m_aOptions; -+ // OptionHelper m_aOptionHelper; -+ TestResultCollector m_aResulter; -+ -+ public: -+ testshlTestResult(GetOpt & _aOptions); -+ virtual ~testshlTestResult(); -+ -+ // virtual void addFailure( const TestFailure &failure ); -+ // virtual void startTest( Test *test ); -+ // virtual void endTest( Test *test ); -+ -+ virtual void print( Outputter &stream ); -+ -+ protected: -+ virtual void printHeader( Outputter &stream ); -+ -+ void printLines(Outputter &stream, HashMap & _aJobList); -+ void printFailedTests(Outputter &stream, TestPtrList &aFailedTests); -+ void printTestLines(Outputter &stream, TestPtrList &aFailedTests); -+ void printUnknownLines(Outputter &stream, HashMap & _aJobList); -+ -+ virtual void printTestLine( Outputter &stream, Test* pTest, std::string const& _sNodeName, std::string const& _sInfo); -+ virtual void printFailureLine( Outputter &stream, TestFailure* pFailure, std::string const& _sNodeName ); -+ virtual void printUnknownLine( Outputter &stream, std::string const& _sTestName); -+ }; -+ -+/** insertion operator for easy output */ -+ Outputter &operator <<( Outputter &stream, -+ testshlTestResult &result ); -+ -+} // namespace CppUnit -+ -+#endif // CPPUNIT_testshlTESTRESULT_H -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit/result: testshlTestResult.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/signaltest.h 2008-12-10 20:46:07.349658445 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/signaltest.h 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,65 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef SIGNALTEST_H -+#define SIGNALTEST_H -+ -+#include <string> -+#include "cppunit/Test.h" -+#include <cppunit/autoregister/htestresult.h> -+ -+namespace CppUnit -+{ -+ -+class CPPUNIT_API SignalTest : public Test -+{ -+public: -+ -+ SignalTest( std::string const& Name ); -+ -+ ~SignalTest(); -+ -+ virtual void run(hTestResult pResult); -+ virtual int countTestCases() const; -+ std::string getName() const; -+ std::string toString() const; -+ -+private: -+ SignalTest( const SignalTest &other ); -+ SignalTest &operator=( const SignalTest &other ); -+ -+private: -+ const std::string m_sName; -+}; -+ -+} // namespace CppUnit -+ -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: signaltest.h.dummy. ---- misc/cppunit-1.8.0/include/cppunit/simpleheader.hxx 2008-12-10 20:46:07.425092111 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/simpleheader.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,45 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef CPPUNIT_SIMPLEHEADER_HXX -+#define CPPUNIT_SIMPLEHEADER_HXX -+ -+// This file contains only the cppunit header files, for simplification. -+ -+#include <cppunit/TestFixture.h> -+#include <cppunit/TestCaller.h> -+#include <cppunit/TestSuite.h> -+#include <cppunit/TestAssert.h> -+#include <cppunit/autoregister/registertestfunction.h> -+#include <cppunit/extensions/HelperMacros.h> -+#include <cppunit/additionalfunc.hxx> -+#include <cppunit/cmdlinebits.hxx> -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: simpleheader.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/stringhelper.hxx 2008-12-10 20:46:07.500255274 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/stringhelper.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,42 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef STRINGHELPER_HXX -+#define STRINGHELPER_HXX -+ -+#include <rtl/ustring.hxx> -+#include <rtl/string.hxx> -+ -+inline void operator <<= (rtl::OString& _rAsciiString, const rtl::OUString& _rUnicodeString) -+{ -+ _rAsciiString = rtl::OUStringToOString(_rUnicodeString,RTL_TEXTENCODING_ASCII_US); -+} -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: stringhelper.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/taghelper.hxx 2008-12-10 20:46:07.588895546 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/taghelper.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,91 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef TAGHELPER_HXX -+#define TAGHELPER_HXX -+ -+#include <map> -+#include <sal/types.h> -+#include <cppunit/nocopy.hxx> -+ -+/* Tags are a general mechanism of extensible data arrays for parameter -+ * specification and property inquiry. In practice, tags are used in arrays, -+ * or chain of arrays. -+ * -+ */ -+ -+typedef sal_IntPtr Tag; -+typedef sal_IntPtr TagData; -+ -+//# struct TagItem -+//# { -+//# Tag ti_Tag; /* identifies the type of data */ -+//# TagData ti_Data; /* type-specific data */ -+//# }; -+ -+/* constants for Tag.ti_Tag, control tag values */ -+#define TAG_DONE (Tag(0L)) /* terminates array of TagItems. ti_Data unused */ -+#define TAG_END (Tag(0L)) /* synonym for TAG_DONE */ -+#define TAG_IGNORE (Tag(1L)) /* ignore this item, not end of array */ -+#define TAG_MORE (Tag(2L)) /* ti_Data is pointer to another array of TagItems -+ * note that this tag terminates the current array -+ */ -+#define TAG_SKIP (Tag(3L)) /* skip this and the next ti_Data items */ -+ -+/* differentiates user tags from control tags */ -+#define TAG_USER (Tag(1L<<31)) -+ -+// ----------------------------------------------------------------------------- -+class TagHelper /* : NOCOPY */ -+{ -+ typedef std::map<Tag, TagData> TagItems; -+ TagItems m_aTagItems; -+ -+public: -+ TagHelper(){} -+ void insert(Tag _nTag, TagData _nData) -+ { -+ m_aTagItems[_nTag] = _nData; -+ } -+ // const TagItems& get() const { return m_aTagItems; } -+ -+ TagData GetTagData(Tag _aTagValue, TagData _aDefaultValue = 0 /* NULL */) const -+ { -+ TagItems::const_iterator it = m_aTagItems.find(_aTagValue); -+ if (it != m_aTagItems.end()) -+ return (*it).second; -+ else -+ return _aDefaultValue; -+ } -+}; -+ -+#endif -+ -+ -Nur in misc/build/cppunit-1.8.0/include/cppunit: taghelper.hxx.dummy. ---- misc/cppunit-1.8.0/include/cppunit/tagvalues.hxx 2008-12-10 20:46:07.672788513 +0100 -+++ misc/build/cppunit-1.8.0/include/cppunit/tagvalues.hxx 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,81 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef TAGVALUES_H -+#define TAGVALUES_H -+ -+#include <cppunit/taghelper.hxx> -+ -+#define TAG_TYPE (Tag(TAG_USER | (0x01L))) -+ -+#define TAG_RESULT (TAG_USER | 0x100) -+ -+#define RESULT_START (Tag(TAG_RESULT | (0x02L))) -+#define TAG_RESULT_PTR (Tag(TAG_RESULT | (0x03L))) -+#define TAG_TEST_PTR (Tag(TAG_RESULT | (0x04L))) -+ -+#define RESULT_END (Tag(TAG_RESULT | (0x05L))) -+ -+#define RESULT_ADD_FAILURE (Tag(TAG_RESULT | (0x06L))) -+#define RESULT_ADD_ERROR (Tag(TAG_RESULT | (0x07L))) -+ -+#define TAG_EXCEPTION (Tag(TAG_RESULT | (0x08L))) -+ -+#define RESULT_ADD_INFO (Tag(TAG_RESULT | (0x09L))) -+#define TAG_INFO (Tag(TAG_RESULT | (0x0aL))) -+ -+#define RESULT_ENTER_NODE (Tag(TAG_RESULT | (0x0bL))) -+#define RESULT_LEAVE_NODE (Tag(TAG_RESULT | (0x0cL))) -+#define TAG_NODENAME (Tag(TAG_RESULT | (0x0dL))) -+ -+#define RESULT_SHOULD_STOP (Tag(TAG_RESULT | (0x0eL))) -+ -+ -+#define TAG_SIGNAL (TAG_USER | 0x200) -+// #define SIGNAL_CHECK (Tag(TAG_SIGNAL | (0x01L))) -+// #define INIT_SIGNAL_HANDLING (Tag(TAG_SIGNAL | (0x04L))) -+// #define RELEASE_SIGNAL_HANDLING (Tag(TAG_SIGNAL | (0x05L))) -+ -+#define SIGNAL_START_TEST (Tag(TAG_SIGNAL | (0x06L))) -+#define SIGNAL_END_TEST (Tag(TAG_SIGNAL | (0x07L))) -+ -+#define TAG_EXECUTION (TAG_USER | 0x400) -+#define EXECUTION_CHECK (Tag(TAG_EXECUTION | (0x01))) -+#define INIT_TEST (Tag(TAG_EXECUTION | (0x02))) -+#define RELEASE_TEST (Tag(TAG_EXECUTION | (0x03))) -+// #define EXECUTION_PUSH_NAME (Tag(TAG_EXECUTION | (0x04))) -+// #define EXECUTION_POP_NAME (Tag(TAG_EXECUTION | (0x05))) -+ -+#define DO_NOT_EXECUTE 666 -+#define GO_EXECUTE 1 -+ -+typedef sal_Int32 ReturnValue; -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/cppunit: tagvalues.hxx.dummy. ---- misc/cppunit-1.8.0/include/makefile.mk 2008-12-10 20:46:08.530624271 +0100 -+++ misc/build/cppunit-1.8.0/include/makefile.mk 2008-07-14 07:25:14.000000000 +0200 -@@ -1 +1,52 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile$ -+# -+# $Revision$ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+PRJ=.. -+# PRJINC=.. -+ -+PRJNAME=cppunit -+TARGET=inc -+ -+# --- Settings ----------------------------------------------------- -+ -+.INCLUDE : settings.mk -+ -+# --- Files -------------------------------------------------------- -+# --- Targets ------------------------------------------------------- -+ -+.INCLUDE : target.mk -+ -+.IF "$(ENABLE_PCH)"!="" -+ALLTAR : \ -+ $(SLO)$/precompiled.pch \ -+ $(SLO)$/precompiled_ex.pch -+ -+.ENDIF # "$(ENABLE_PCH)"!="" -+ -Nur in misc/build/cppunit-1.8.0/include: makefile.mk.dummy. ---- misc/cppunit-1.8.0/include/testshl/autoregisterhelper.hxx 2008-12-10 20:46:07.771638742 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/autoregisterhelper.hxx 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,65 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef AUTOREGISTER_HXX -+#define AUTOREGISTER_HXX -+ -+#include <vector> -+#include <rtl/ustring.hxx> -+ -+#include <cppunit/autoregister/testfunc.h> -+ -+#include "dynamicregister.hxx" -+#include "getopt.hxx" -+ -+typedef std::vector<FktPtr> FunctionList; -+ -+// ----------------------------------------------------------------------------- -+class JobList; -+class AutomaticRegisterHelper : public DynamicLibraryHelper -+{ -+ FunctionList m_aFunctionList; -+ bool m_bLoadLibraryOK; -+ // GetOpt & m_aOptions; // use getOptions() instead! -+ -+public: -+ AutomaticRegisterHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions/* , JobList * _pJobList = NULL */ ); -+ -+ // FunctionList getFunctions(){return m_aFunctionList;} -+ void CallAll(hTestResult _hResult) const; -+ -+ /// @return true, if the given DLLName library could load and initialised. -+ bool isOkToStartTests() const {return m_bLoadLibraryOK;} -+ -+ virtual ~AutomaticRegisterHelper(); -+}; -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/testshl: autoregisterhelper.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/dynamicregister.hxx 2008-12-10 20:46:07.812458771 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/dynamicregister.hxx 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,67 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef DYNAMICREGISTER_HXX -+#define DYNAMICREGISTER_HXX -+ -+#include <rtl/ustring.hxx> -+#include <osl/module.hxx> -+ -+#include "getopt.hxx" -+#include "cppunit/nocopy.hxx" -+ -+// ------------------------------------------------- -+ -+class DynamicLibraryHelper : NOCOPY -+{ -+protected: -+ osl::Module* m_pModule; -+ rtl::OUString m_suDLLName; -+ GetOpt & m_aOptions; -+ -+ GetOpt& getOptions() {return m_aOptions;} -+ -+public: -+ DynamicLibraryHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions); -+ virtual ~DynamicLibraryHelper(); -+ -+private: -+ void showFilenameIfVerbose(); -+ void realLoadLibrary(rtl::OUString const& _sLibToLoad); -+ void loadLibraryFromAbsolutePath(); -+ void loadLibraryFromLocalPath(); -+ -+ rtl::OUString m_suAbsolutePathFile; // file:///D:/foo/bar/library.dll -+ rtl::OUString m_suAbsolutePath; // file:///D:/foo/bar -+ rtl::OUString m_suFilename; // library.dll -+}; -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/testshl: dynamicregister.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/filehelper.hxx 2008-12-10 20:46:07.901872218 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/filehelper.hxx 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,50 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef FILEHELPER_HXX -+#define FILEHELPER_HXX -+ -+#include <string> -+#include <rtl/ustring.hxx> -+#include <rtl/string.hxx> -+#include <cppunit/cmdlinebits.hxx> -+#include "getopt.hxx" -+ -+namespace FileHelper -+{ -+ -+ std::string getTempPath(); -+ rtl::OUString convertPath( rtl::OUString const& _suSysPath ); -+ rtl::OUString convertPath( rtl::OString const& sysPth ); -+ CmdLineBits createFlags( GetOpt & _aOptions ); -+ -+} -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/testshl: filehelper.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/getopt.hxx 2008-12-10 20:46:07.985642414 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/getopt.hxx 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,335 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+/************************************************************************* -+#* class GetOpt -+#* -+#* -+#* Implementation getopt.cxx -+#* -+#* Description: class to reflect the commandline options. In addition -+#* it provides functinality to get options from an inifile -+#* ( getIniOptions()), evaluate, test and get options -+#* ( hasOpt(), getOpt() ) and display an usage screen -+#* formated in dependance of the given optionset, as well -+#* as display a status about activ options -+#* -+#* -+#* further descriptions: -+#* -+#* the constructor is called with two parameters: -+#* char* argv[] and char* optionSet[], -+#* the commandline and the available set of options. -+#* Valid optionstrings have to start with a minus '-', otherwise it will -+#* be ignored. Optionstrings consist of one or two arguments divided by a -+#* comma separator, where the second (optional) argument is a short -+#* description of the option, called hint. It will be automatically -+#* formated and displayed in the usage screen if available. -+#* The first argument of the optionstring can consist of two sections, -+#* the name and the optional necessity and format. -+#* The name of the option will be the starting minus followed by a string -+#* like "-src". -+#* One section options will be treated as flag (see '-v' option in example). -+#* The second section consist of '=' or ':' which defines the necessity, -+#* in combination with a character 's' for string or 'n' for numeric and -+#* an optional '@' standing for 'vector of'. -+#* '=' means this option needs an argument, ':' means can take an argument -+#* followed by 's' is, as mentioned above, a single string paramenter, -+#* followed by a 's' in combination with '@' means this argument consists -+#* of one string or a vector of strings separated by commas -+#* -+#* an example for an optionset: -+#* -+#* static char* optionSet[] = { -+#* "-src=s, release or version of sources", -+#* "-ini=s, ini file with additional options", -+#* "-db=s, path of type description database", -+#* "-inPth=s, source path of component descriptions", -+#* "-outPth=s, destination path for testcases", -+#* "-logPth=s, destination path for logging", -+#* "-mdl=s@, name(s) of module(s) to generate", -+#* "-v, enable verbose screen messages", -+#* "-dbg, enable debug messages", -+#* "-h:s, display help or help on option", -+#* "-help:s, see -h", -+#* NULL -+#* }; -+#* -+#* As seen a GetOpt class object will be created via: -+#* GetOpt myOptions( argv, optionSet ); -+#* -+*************************************************************************/ -+#ifndef __QADEV_REGSCAN_GETOPT_HXX__ -+#define __QADEV_REGSCAN_GETOPT_HXX__ -+ -+#include <osl/file.hxx> -+#include <sal/types.h> -+#include <rtl/strbuf.hxx> -+ -+ -+#include <rtl/string.hxx> -+ -+// #ifndef __QADEV_REGSCAN_UTIL_HXX__ -+// #include "inc/util.hxx" -+// #endif -+ -+ -+#ifdef SOLARIS -+#include <sys/time.h> -+#endif -+ -+#include <iostream> -+#include <hash_map> -+// #include "rsexception.hxx" -+ -+// using namespace std; -+ -+struct gstr { -+ sal_Bool operator()( const rtl::OString& oStr1, -+ const rtl::OString& oStr2 ) const { -+ return( oStr1 == oStr2 ); -+ } -+}; -+ -+struct ghstr -+{ -+ sal_uInt32 operator()( const rtl::OString& str ) const { -+ return str.hashCode(); -+ } -+}; -+ -+struct frmt { -+ sal_uInt32 fCol; -+ sal_uInt32 sCol; -+ sal_uInt32 len; -+}; -+ -+typedef std::hash_map< rtl::OString, std::vector< rtl::OString >, ghstr, gstr > -+ optHashMap; -+ -+typedef frmt sFormat; -+typedef sal_uInt16 optType; -+ -+#define OT_INVALID 0x0000 -+#define OT_BOOL 0x0001 -+#define OT_STRING 0x0002 -+#define OT_NUMBER 0x0004 -+#define OT_SINGLE 0x0010 -+#define OT_MULTI 0x0020 -+#define OT_OPTIONAL 0x0100 -+ -+//: Option -+class OptDsc { -+ -+ rtl::OString m_name; -+ rtl::OString m_hint; -+ rtl::OString m_legend; -+ optType m_type; -+ -+ /** -+ * analysis of optionstring and creation of option description class -+ * @param const rtl::OString& opt = optionstring to analyse -+ * @return void -+ */ -+ void createOptDsc( const rtl::OString& opt ); -+ -+ /** -+ * splitting of an optionstring and creation of a tokenvector -+ * in dependance of a charset -+ * -+ * @param const rtl::OString& opt = optionstring to split -+ * @param const rtl::OString& cSet = delimiter charset -+ * @param vector< rtl::OString >& optLine = tokenvector to fill -+ * -+ * @return void -+ */ -+ void split( const rtl::OString& opt, const rtl::OString& charSet, -+ std::vector< rtl::OString >& optLine ); -+ -+ /** -+ * private default c'tor, copy c'tor and assignment operator -+ * to get compiler errors on dumb effords -+ */ -+ OptDsc(); -+ OptDsc( OptDsc& ); -+ OptDsc& operator = ( OptDsc& ); -+ -+public: -+ -+ //> c'tor -+ OptDsc( const rtl::OString& opt ) -+ : m_name(), -+ m_hint(), -+ m_legend(), -+ m_type( 0 ) { -+ -+ createOptDsc( opt ); -+ } ///< c'tor -+ -+ //> d'tor -+ ~OptDsc(){} -+ -+ /** -+ * returns the name of this option -+ * @return rtl::OString& -+ */ -+ inline rtl::OString& getName() { return m_name; } -+ /** -+ * returns the hint of this option -+ * @return rtl::OString& -+ */ -+ inline rtl::OString& getHint() { return m_hint; } -+ /** -+ * returns the legend of this option -+ * @return rtl::OString& -+ */ -+ inline rtl::OString& getLegend() { return m_legend; } -+ -+ /** -+ * returns the type of this option -+ * @return optType -+ */ -+ inline optType getType() { return m_type; } -+ -+ -+ inline sal_Bool isFlag() { -+ return( ( m_type &~ 0xfffe ) == OT_BOOL ) ? sal_True : sal_False; -+ } -+ inline sal_Bool isString() { -+ return( ( m_type &~ 0xfffd ) == OT_STRING ) ? sal_True : sal_False; -+ } -+ inline sal_Bool isNumber() { -+ return( ( m_type &~ 0xfffb ) == OT_NUMBER ) ? sal_True : sal_False; -+ } -+ inline sal_Bool isSingle() { -+ return( ( m_type &~ 0xffef ) == OT_SINGLE ) ? sal_True : sal_False; -+ } -+ inline sal_Bool isMulti() { -+ return( ( m_type &~ 0xffdf ) == OT_MULTI ) ? sal_True : sal_False; -+ } -+ inline sal_Bool isOptional() { -+ return( ( m_type &~ 0xfeff ) == OT_OPTIONAL ) ? sal_True : sal_False; -+ } -+ -+}; ///:~ Option -+ -+class Exception -+{ -+ rtl::OString m_sAsciiMessage; -+public: -+ Exception(); -+ virtual ~Exception(){} -+ -+ Exception(char const* sAsciiMessage); -+ Exception(rtl::OString const& sAsciiMessage); -+ -+ virtual rtl::OUString message() const; -+ virtual char const* what() const; -+}; -+ -+class ValueNotFoundException : public Exception -+{ -+public: -+ ValueNotFoundException(); -+ ValueNotFoundException(char const* sExit); -+}; -+ -+//: GetOpt -+class GetOpt { -+ -+ rtl::OString m_prgname; -+ rtl::OString m_vardelim; -+ std::vector< rtl::OString > m_cmdline; -+ std::vector< rtl::OString > m_param; -+ std::vector< rtl::OString > m_varvec; -+ std::vector< OptDsc* > m_optionset; -+ optHashMap m_opthash; -+ -+ //> private methods -+ void initialize( char* cmdLine[], char const * optSet[] ); -+ void createCmdLineOptions(); -+ sal_uInt32 getMaxNameLength(); -+ sal_uInt32 getMaxLegendLength(); -+ const rtl::OString optDsc2Str( OptDsc* optDsc , sFormat frm ); -+ void tokenize( const rtl::OString& opt, const rtl::OString& charSet, -+ std::vector< rtl::OString >& optLine, sal_Bool strip = sal_True ); -+ ///< private methods -+ -+ GetOpt(); -+ GetOpt( GetOpt& ); -+ GetOpt& operator = ( GetOpt& ); -+ -+public: -+ -+ //> c'tor -+ GetOpt( char* cmdLine[], char const * optSet[], rtl::OString varDelim = -+ rtl::OString( "$" ) ) -+ : m_vardelim( varDelim ) { -+ -+ initialize( cmdLine, optSet ); -+ createCmdLineOptions(); -+ } ///< c'tor -+ -+ //> d'tor -+ ~GetOpt(); -+ ///< d'tor -+ -+ //> inline methods -+ inline std::vector< rtl::OString >* getCmdLine() { return &m_cmdline; } -+ inline optHashMap* getOptions() { return ( &m_opthash ); } -+ inline rtl::OString& getName() { return m_prgname; } -+ inline rtl::OString& getFirstParam() { return *(m_param.begin()); } -+ inline std::vector< rtl::OString >& getParams() { return m_param; } -+ rtl::OString& getOpt( const rtl::OString& opt ); -+ void rmvOpt( rtl::OString& opt ) { -+ m_opthash.erase( opt ); -+ } -+ inline std::vector< rtl::OString >& getOptVec( const rtl::OString& opt ) { -+ return m_opthash[ opt ]; -+ } -+ ///< inline methods -+ -+ -+ sal_Bool exist( rtl::OString& opt ); -+ sal_Bool hasParam( std::vector< rtl::OString >::iterator iter ); -+ sal_Bool hasVars( void ); -+ sal_Bool evaluateOpt( std::vector< rtl::OString >::iterator iter ); -+ OptDsc* getOptDsc( rtl::OString& opt ); -+ sal_Bool hasOpt( const rtl::OString& opt ) const; -+ ::osl::FileBase::RC getIniOptions( rtl::OString iniPth ); -+ void createOpt( rtl::OString& optdsc ); -+ void str2Opt( rtl::OString iOpts ); -+ void addOpt( rtl::OString& opt, sal_Bool evaluate = sal_True ); -+ void replVars( void ); -+ void showUsage( void ); -+ void printStatus( void ); -+ -+}; ///:~ GetOpt -+#endif -Nur in misc/build/cppunit-1.8.0/include/testshl: getopt.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/log.hxx 2008-12-10 20:46:08.078572827 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/log.hxx 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,116 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************* -+ -+ Source Code Control System - Header -+ -+ $Header$ -+ -+ Source Code Control System - Update -+ -+*************************************************************************/ -+#ifndef __QADEV_REGSCAN_LOG_HXX__ -+#define __QADEV_REGSCAN_LOG_HXX__ -+ -+#include <time.h> -+#include <rtl/ustring.hxx> -+#include <rtl/strbuf.hxx> -+#include <sal/types.h> -+#include <osl/thread.h> -+#include <osl/file.hxx> -+ -+//!io #include <iostream> -+#include <vector> -+ -+// using namespace std; -+ -+ -+/** -+ * Log derives the interface of the ::osl::File class ( is-a relation ). -+ * Its members (has-a relation) are the (full qualified)name of the log -+ * and an OStringBuffer which represents the content of the logfile. -+ * It provides the functionality of easy-to-use open and write logs -+ */ -+//: Log -+class Log { -+ -+ ::osl::File* m_logfile; // fileobject -+ rtl::OUString m_logurl; // url of log -+ rtl::OStringBuffer m_buf; // content of log -+ -+ Log(); -+ -+public: -+ -+ //> c'tor -+ /** -+ * constructors argument is a full qualified UNC path -+ * @param OUString logfile ( full qualified UNC path ) -+ */ -+ Log( const rtl::OUString& logURL ) -+ : m_logfile( new ::osl::File( logURL )) -+ , m_logurl(logURL) -+ {} ///< c'tor -+ -+ //> d'tor -+ virtual ~Log() { -+ m_logfile->close(); -+ delete( m_logfile ); -+ } ///< d'tor -+ -+ //> inline methods -+ // returns a reference to name instance -+ inline rtl::OUString getLogURL() { return m_logurl; } -+ inline rtl::OString getName() { return rtl::OUStringToOString( -+ m_logurl, RTL_TEXTENCODING_ASCII_US ); } -+ ///< inline methods -+ -+ // open logfile for overwrite (default) or append -+ ::osl::FileBase::RC open( sal_Bool append = sal_False ); -+ ::osl::FileBase::RC close() { return m_logfile->close(); } -+ -+ -+ // write methods without (default) or with echo on display -+ ::osl::FileBase::RC write( const sal_Char* buf, sal_Bool v = sal_False ); -+ ::osl::FileBase::RC write( const rtl::OString& buf, -+ sal_Bool v = sal_False ); -+ // ::osl::FileBase::RC write( rtl::OStringBuffer const& buf, -+ // sal_Bool v = sal_False ); -+ ::osl::FileBase::RC write( const rtl::OUString& buf, -+ rtl_TextEncoding enc = RTL_TEXTENCODING_ASCII_US, -+ sal_Bool v = sal_False ); -+ -+}; ///:~ Log -+ -+Log &operator <<( Log &_aLog, const sal_Char * _sValue ); -+Log &operator <<( Log &_aLog, rtl::OString const& _sValue ); -+Log &operator <<( Log &_aLog, rtl::OUString const& _sValue ); -+// Log &operator <<( Log &_aLog, rtl::OStringBuffer const& _sValue ); -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/testshl: log.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/tresstatewrapper.h 2008-12-10 20:46:08.171096366 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/tresstatewrapper.h 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,66 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef TESTSTATEWRAPPER_H -+#define TESTSTATEWRAPPER_H -+ -+#ifdef _RTL_TRES_H_ -+#error "This is old code, please remove the include of rtl/tres.h" -+#endif -+ -+#include <sal/types.h> -+#include "cppunit/autoregister/registertestfunction.h" -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+// typedef void* hTestResult; -+typedef hTestResult rtlTestResult; -+ -+// ----------------------------------------------------------------------------- -+void c_rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName); -+void c_rtl_tres_state_end(hTestResult _aResult, const sal_Char* _pName); -+ -+// ----------------------------------------------------------------------------- -+// the old test state function, which here convert all values for using with the -+// new testshl tool -+ -+sal_Bool SAL_CALL c_rtl_tres_state( -+ hTestResult pResult, -+ sal_Bool bSuccess, -+ char const * pTestMsg, -+ char const * pFuncName); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/testshl: tresstatewrapper.h.dummy. ---- misc/cppunit-1.8.0/include/testshl/tresstatewrapper.hxx 2008-12-10 20:46:08.253163483 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/tresstatewrapper.hxx 2008-12-10 20:42:43.000000000 +0100 -@@ -1 +1,60 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef teststatewrapper_hxx -+#define teststatewrapper_hxx -+ -+#include <cppunit/nocopy.hxx> -+#include <sal/types.h> -+ -+#include <cppunit/simpleheader.hxx> -+#include <cppunit/autoregister/callbackfunc_fktptr.h> -+ -+// This is a hack, because it's possible that the testshl directory doesn't exist. -+#ifdef LOAD_TRESSTATEWRAPPER_LOCAL -+#include "tresstatewrapper.h" -+#else -+#include <testshl/tresstatewrapper.h> -+#endif -+ -+// ----------------------------------------------------------------------------- -+// helper class to mark the start off old test code -+// the name is need in the test result generator -+class rtl_tres_state_start : NOCOPY -+{ -+ const sal_Char* m_pName; -+ hTestResult m_aResult; -+public: -+ rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName); -+ ~rtl_tres_state_start(); -+}; -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/testshl: tresstatewrapper.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/versionhelper.hxx 2008-12-10 20:46:08.329903269 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/versionhelper.hxx 2008-07-07 08:13:42.000000000 +0200 -@@ -1 +1,87 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef AUTOREGISTER_HXX -+#define AUTOREGISTER_HXX -+ -+#include <stdio.h> -+#include <vector> -+#include <ostream> -+#include <iostream> -+ -+#include <rtl/ustring.hxx> -+#include <rtl/string.hxx> -+ -+#include "dynamicregister.hxx" -+ -+// ----------------------------------------------------------------------------- -+// ---------------------------------- Version ---------------------------------- -+// ----------------------------------------------------------------------------- -+// extern "C" const struct VersionInfo *GetVersionInfo(); -+ -+// this is a Hack, but at the moment, no change to handle this behaviour better. -+struct VersionInfo -+{ -+ const char* pTime; -+ const char* pDate; -+ const char* pUpd; -+ const char* pMinor; -+ const char* pBuild; -+ const char* pInpath; -+}; -+typedef const struct VersionInfo* (*FktGetVersionInfoPtr)(); -+ -+// ----------------------------------------------------------------------------- -+class VersionHelper : public DynamicLibraryHelper -+{ -+ const VersionInfo *m_pInfo; -+ -+public: -+ VersionHelper(rtl::OUString const& _sDLLName, GetOpt & _aOptions); -+// void print(std::ostream& _aStream); -+ void printall(FILE*); -+ -+ rtl::OString getTime() const; -+ rtl::OString getDate() const; -+ rtl::OString getUpd() const; -+ rtl::OString getMinor() const; -+ rtl::OString getBuild() const; -+ rtl::OString getInpath() const; -+ -+ bool isOk() const; -+}; -+ -+/** insertion operator for easy output */ -+// std::ostream &operator <<( std::ostream &stream, -+// VersionHelper &version ); -+ -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/include/testshl: versionhelper.hxx.dummy. ---- misc/cppunit-1.8.0/include/testshl/winstuff.hxx 2008-12-10 20:46:08.412541288 +0100 -+++ misc/build/cppunit-1.8.0/include/testshl/winstuff.hxx 2008-07-16 14:09:24.000000000 +0200 -@@ -1 +1,44 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef WINSTUFF_HXX -+#define WINSTUFF_HXX -+ -+#include <sal/types.h> -+ -+// Isolated into own compilation unit, to avoid interference with -+// windows headers -+void WinDebugBreak(); -+void WinSleep( sal_uInt32 sec ); -+sal_uInt32 WinGetCurrentProcessId(); -+void WinTerminateApp( sal_uInt32 dwPID, sal_uInt32 dwTimeout ); -+ -+#endif -Nur in misc/build/cppunit-1.8.0/include/testshl: winstuff.hxx.dummy. ---- misc/cppunit-1.8.0/makefile.mk 2008-12-10 20:46:08.628149187 +0100 -+++ misc/build/cppunit-1.8.0/makefile.mk 2008-12-09 14:43:50.000000000 +0100 -@@ -1 +1,35 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile$ -+# -+# $Revision$ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+target: -+ cd src$/win32 && $(MAKE) $(MFLAGS) $(CALLMACROS) -+ cd src$/result && $(MAKE) $(MFLAGS) $(CALLMACROS) -+ cd src$/cppunit && $(MAKE) $(MFLAGS) $(CALLMACROS) -Nur in misc/build/cppunit-1.8.0: makefile.mk.dummy. ---- misc/cppunit-1.8.0/src/cppunit/Asserter.cpp 2002-03-27 20:04:02.000000000 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/Asserter.cpp 2008-02-27 17:21:16.000000000 +0100 -@@ -1,52 +1,76 @@ - #include <cppunit/Asserter.h> - #include <cppunit/NotEqualException.h> -- -+#include <cppunit/stringhelper.hxx> - - namespace CppUnit - { -- -+ - - namespace Asserter - { - -+void -+fail( std::string const& message, -+ SourceLine const& sourceLine ) -+{ -+ throw Exception( message, sourceLine ); -+} - - void --fail( std::string message, -- SourceLine sourceLine ) -+failStub( std::string const& message, -+ SourceLine const& sourceLine ) - { -- throw Exception( message, sourceLine ); -+ throw StubException( message, sourceLine ); - } - - - void - failIf( bool shouldFail, -- std::string message, -- SourceLine location ) -+ std::string const& message, -+ SourceLine const& location ) - { - if ( shouldFail ) -- fail( message, location ); -+ { -+ fail( message, location ); -+ } - } - -- -+// ----------------------------------------------------------------------------- - void --failNotEqual( std::string expected, -- std::string actual, -- SourceLine sourceLine, -- std::string additionalMessage ) -+failIf( bool shouldFail, -+ rtl::OUString const& _suMessage, -+ SourceLine const& location ) - { -- throw NotEqualException( expected, -- actual, -- sourceLine, -- additionalMessage ); -+ if ( shouldFail ) -+ { -+ rtl::OString sMessage; -+ sMessage <<= _suMessage; -+ std::string message; -+ message = sMessage.getStr(); -+ fail( message, location ); -+ } -+} -+// ----------------------------------------------------------------------------- -+ -+void -+failNotEqual( std::string const& expected, -+ std::string const& actual, -+ SourceLine const& sourceLine, -+ std::string const& additionalMessage ) -+{ -+ throw NotEqualException( expected, -+ actual, -+ sourceLine, -+ additionalMessage ); - } - - - void - failNotEqualIf( bool shouldFail, -- std::string expected, -- std::string actual, -- SourceLine sourceLine, -- std::string additionalMessage ) -+ std::string const& expected, -+ std::string const& actual, -+ SourceLine const& sourceLine, -+ std::string const& additionalMessage ) - { - if ( shouldFail ) - failNotEqual( expected, actual, sourceLine, additionalMessage ); ---- misc/cppunit-1.8.0/src/cppunit/Exception.cpp 2001-10-19 20:37:24.000000000 +0200 -+++ misc/build/cppunit-1.8.0/src/cppunit/Exception.cpp 2008-02-27 17:21:46.000000000 +0100 -@@ -19,20 +19,19 @@ - - /// Construct the exception - Exception::Exception( const Exception &other ) : -- std::exception( other ) --{ -- m_message = other.m_message; -- m_sourceLine = other.m_sourceLine; --} -+ std::exception( other ), -+ m_message( other.m_message), -+ m_sourceLine(other.m_sourceLine) -+{} - - - /*! - * \deprecated Use other constructor instead. - */ --Exception::Exception( std::string message, -- SourceLine sourceLine ) : -- m_message( message ), -- m_sourceLine( sourceLine ) -+Exception::Exception( std::string const& _message, -+ SourceLine const& _sourceLine ) : -+ m_message( _message ), -+ m_sourceLine( _sourceLine ) - { - } - -@@ -41,9 +40,9 @@ - /*! - * \deprecated Use other constructor instead. - */ --Exception::Exception( std::string message, -+Exception::Exception( std::string const& message, - long lineNumber, -- std::string fileName ) : -+ std::string const& fileName ) : - m_message( message ), - m_sourceLine( fileName, lineNumber ) - { ---- misc/cppunit-1.8.0/src/cppunit/NotEqualException.cpp 2001-10-06 00:27:14.000000000 +0200 -+++ misc/build/cppunit-1.8.0/src/cppunit/NotEqualException.cpp 2008-02-27 17:21:34.000000000 +0100 -@@ -3,17 +3,17 @@ - namespace CppUnit { - - --NotEqualException::NotEqualException( std::string expected, -- std::string actual, -- SourceLine sourceLine , -- std::string additionalMessage ) : -- Exception( "Expected: " + expected + -- ", but was: " + actual + -- "." + additionalMessage , -- sourceLine), -- m_expected( expected ), -- m_actual( actual ), -- m_additionalMessage( additionalMessage ) -+NotEqualException::NotEqualException( std::string const& _expected, -+ std::string const& _actual, -+ SourceLine const& _sourceLine , -+ std::string const& _additionalMessage ) : -+ Exception( "Expected: " + _expected + -+ ", but was: " + _actual + -+ "." + _additionalMessage , -+ _sourceLine), -+ m_expected( _expected ), -+ m_actual( _actual ), -+ m_additionalMessage( _additionalMessage ) - { - } - -@@ -22,10 +22,10 @@ - /*! - * \deprecated Use other constructor instead. - */ --NotEqualException::NotEqualException( std::string expected, -- std::string actual, -+NotEqualException::NotEqualException( std::string const& expected, -+ std::string const& actual, - long lineNumber, -- std::string fileName ) : -+ std::string const& fileName ) : - Exception( "Expected: " + expected + ", but was: " + actual, - lineNumber, - fileName ), ---- misc/cppunit-1.8.0/src/cppunit/SourceLine.cpp 2001-10-06 00:27:14.000000000 +0200 -+++ misc/build/cppunit-1.8.0/src/cppunit/SourceLine.cpp 2008-02-27 17:23:14.000000000 +0100 -@@ -10,10 +10,10 @@ - } - - --SourceLine::SourceLine( const std::string &fileName, -- int lineNumber ) : -- m_fileName( fileName ), -- m_lineNumber( lineNumber ) -+SourceLine::SourceLine( const std::string &file, -+ int line ) : -+ m_fileName( file ), -+ m_lineNumber( line ) - { - } - ---- misc/cppunit-1.8.0/src/cppunit/TestAssert.cpp 2001-10-07 21:36:47.000000000 +0200 -+++ misc/build/cppunit-1.8.0/src/cppunit/TestAssert.cpp 2008-02-27 17:23:24.000000000 +0100 -@@ -1,4 +1,4 @@ --#if HAVE_CMATH -+#ifdef HAVE_CMATH - # include <cmath> - #else - # include <math.h> -@@ -15,56 +15,56 @@ - /// Check for a failed general assertion - void - TestAssert::assertImplementation( bool condition, -- std::string conditionExpression, -- long lineNumber, -- std::string fileName ) -+ std::string conditionExpression, -+ long lineNumber, -+ std::string fileName ) - { - Asserter::failIf( condition, -- conditionExpression, -- SourceLine( fileName, lineNumber ) ); -+ conditionExpression, -+ SourceLine( fileName, lineNumber ) ); - } - - - /// Reports failed equality - void - TestAssert::assertNotEqualImplementation( std::string expected, -- std::string actual, -- long lineNumber, -- std::string fileName ) -+ std::string actual, -+ long lineNumber, -+ std::string fileName ) - { - Asserter::failNotEqual( expected, -- actual, -- SouceLine( fileName, lineNumber ), "" ); -+ actual, -+ SouceLine( fileName, lineNumber ), "" ); - } - - - /// Check for a failed equality assertion - void - TestAssert::assertEquals( double expected, -- double actual, -- double delta, -- long lineNumber, -- std::string fileName ) -+ double actual, -+ double delta, -+ long lineNumber, -+ std::string fileName ) - { - if (fabs (expected - actual) > delta) -- assertNotEqualImplementation( assertion_traits<double>::toString(expected), -- assertion_traits<double>::toString(actual), -- lineNumber, -- fileName ); -+ assertNotEqualImplementation( assertion_traits<double>::toString(expected), -+ assertion_traits<double>::toString(actual), -+ lineNumber, -+ fileName ); - } - - #else // CPPUNIT_ENABLE_SOURCELINE_DEPRECATED - - void - TestAssert::assertDoubleEquals( double expected, -- double actual, -- double delta, -- SourceLine sourceLine ) -+ double actual, -+ double delta, -+ SourceLine sourceLine ) - { - Asserter::failNotEqualIf( fabs( expected - actual ) > delta, -- assertion_traits<double>::toString(expected), -- assertion_traits<double>::toString(actual), -- sourceLine ); -+ assertion_traits<double>::toString(expected), -+ assertion_traits<double>::toString(actual), -+ sourceLine ); - } - - ---- misc/cppunit-1.8.0/src/cppunit/TestCase.cpp 2002-03-25 23:35:34.000000000 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/TestCase.cpp 2008-02-27 17:21:24.000000000 +0100 -@@ -1,70 +1,141 @@ -+#include <stdlib.h> - #include <cppunit/Portability.h> - #include <typeinfo> - #include <stdexcept> - - #include "cppunit/TestCase.h" - #include "cppunit/Exception.h" --#include "cppunit/TestResult.h" -+// #include "cppunit/TestResult.h" - -+#include <cppunit/autoregister/callbackfunc_fktptr.h> -+#include <cppunit/tagvalues.hxx> -+#include <cppunit/externcallbackfunc.hxx> - - namespace CppUnit { - - /// Create a default TestResult --CppUnit::TestResult* --TestCase::defaultResult() --{ -- return new TestResult; --} -+//# CppUnit::TestResult* -+//# TestCase::defaultResult() -+//# { -+//# return new TestResult; -+//# } - - - /// Run the test and catch any exceptions that are triggered by it -+//# void -+//# TestCase::run( TestResult *result ) -+//# { -+//# result->startTest(this); -+//# -+//# try { -+//# setUp(); -+//# -+//# try { -+//# runTest(); -+//# } -+//# catch ( Exception &e ) { -+//# Exception *copy = e.clone(); -+//# result->addFailure( this, copy ); -+//# } -+//# catch ( std::exception &e ) { -+//# result->addError( this, new Exception( e.what() ) ); -+//# } -+//# catch (...) { -+//# Exception *e = new Exception( "caught unknown exception" ); -+//# result->addError( this, e ); -+//# } -+//# -+//# try { -+//# tearDown(); -+//# } -+//# catch (...) { -+//# result->addError( this, new Exception( "tearDown() failed" ) ); -+//# } -+//# } -+//# catch (...) { -+//# result->addError( this, new Exception( "setUp() failed" ) ); -+//# } -+//# -+//# result->endTest( this ); -+//# } -+//# -+ - void --TestCase::run( TestResult *result ) -+TestCase::run( hTestResult result ) - { -- result->startTest(this); -- -- try { -- setUp(); -+ Test* pTest = this; - -- try { -- runTest(); -- } -- catch ( Exception &e ) { -- Exception *copy = e.clone(); -- result->addFailure( this, copy ); -- } -- catch ( std::exception &e ) { -- result->addError( this, new Exception( e.what() ) ); -- } -- catch (...) { -- Exception *e = new Exception( "caught unknown exception" ); -- result->addError( this, e ); -- } -- -- try { -- tearDown(); -- } -- catch (...) { -- result->addError( this, new Exception( "tearDown() failed" ) ); -- } -- } -- catch (...) { -- result->addError( this, new Exception( "setUp() failed" ) ); -- } -- -- result->endTest( this ); -+ // if (signalCheck(pTest->getName()) == HAS_SIGNAL) -+ sal_Int32 nValue = (pCallbackFunc)(0 /* NULL */, TAG_TYPE, EXECUTION_CHECK, TAG_RESULT_PTR, result, TAG_NODENAME, pTest->getName().c_str(), TAG_DONE); -+ if (nValue == DO_NOT_EXECUTE) -+ { -+ return; -+ } -+ -+ // (pTestResult_StartTest)(result, pTest); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_START, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_DONE); -+ -+ try -+ { -+ setUp(); -+ -+ try -+ { -+ runTest(); -+ // (pTestResult_AddInfo)(result, pTest, "PASSED"); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_ADD_INFO, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_INFO, "PASSED", TAG_DONE); -+ } -+ catch ( StubException &) -+ { -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_ADD_INFO, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_INFO, "STUB", TAG_DONE ); -+ } -+ catch ( Exception &e ) -+ { -+ Exception *copy = e.clone(); -+ // (pTestResult_AddFailure)( result, pTest, copy ); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_ADD_FAILURE, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_EXCEPTION, copy, TAG_DONE ); -+ } -+ catch ( std::exception &e ) -+ { -+ // (pTestResult_AddError)( result, pTest, new Exception( e.what() ) ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_EXCEPTION, new Exception( e.what() ), TAG_DONE ); -+ } -+ catch (...) -+ { -+ Exception *e = new Exception( "caught unknown exception" ); -+ // (pTestResult_AddError)( result, pTest, e ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_EXCEPTION, e, TAG_DONE ); -+ } -+ -+ try -+ { -+ tearDown(); -+ } -+ catch (...) -+ { -+ // (pTestResult_AddError)( result, pTest, new Exception( "tearDown() failed" ) ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_EXCEPTION, new Exception( "tearDown() failed" ), TAG_DONE ); -+ } -+ } -+ catch (...) -+ { -+ // (pTestResult_AddError)( result, pTest, new Exception( "setUp() failed" ) ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_EXCEPTION, new Exception( "setUp() failed" ), TAG_DONE ); -+ } -+ -+ // (pTestResult_EndTest)( result, pTest ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_END, TAG_RESULT_PTR, result, TAG_TEST_PTR, pTest, TAG_DONE ); - } - -- - /// A default run method --TestResult * --TestCase::run() --{ -- TestResult *result = defaultResult(); -- -- run (result); -- return result; --} -+//# TestResult * -+//# TestCase::run() -+//# { -+//# TestResult *result = defaultResult(); -+//# -+//# run (result); -+//# return result; -+//# } - - - /// All the work for runTest is deferred to subclasses -@@ -77,7 +148,7 @@ - /** Constructs a test case. - * \param name the name of the TestCase. - **/ --TestCase::TestCase( std::string name ) -+TestCase::TestCase( std::string const& name ) - : m_name(name) - { - } -@@ -133,3 +204,8 @@ - - - } // namespace CppUnit -+ -+// The following sets variables for GNU EMACS -+// Local Variables: -+// tab-width:4 -+// End: ---- misc/cppunit-1.8.0/src/cppunit/TestFactoryRegistry.cpp 2002-03-28 16:47:08.000000000 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/TestFactoryRegistry.cpp 2008-02-27 17:22:38.000000000 +0100 -@@ -1,12 +1,20 @@ -+#include <stdio.h> -+#include <stdlib.h> - #include <cppunit/extensions/TestFactoryRegistry.h> - #include <cppunit/TestSuite.h> --#include <set> - -+#include <set> -+//!io #include <iostream> -+#include <sstream> - - #if CPPUNIT_USE_TYPEINFO_NAME - # include "cppunit/extensions/TypeInfoHelper.h" - #endif - -+#include <cppunit/externcallbackfunc.hxx> -+#include <cppunit/tagvalues.hxx> -+ -+#undef HELLOWORLD_DEBUGGER - - namespace CppUnit { - -@@ -26,15 +34,18 @@ - - static NamedRegistries &getInstance(); - -- TestFactoryRegistry &getRegistry( std::string name ); -+ TestFactoryRegistry &getRegistry( std::string const& name ); - - void wasDestroyed( TestFactory *factory ); - - bool needDestroy( TestFactory *factory ); - -+ void testRegistries( hTestResult ); - private: -- typedef std::map<std::string, TestFactoryRegistry *> Registries; -- Registries m_registries; -+ typedef std::map<std::string, TestFactoryRegistry *> MapRegistries; -+ // typedef std::pair<std::string, TestFactoryRegistry *> StringTestFactoryRegistry; -+ // typedef std::vector< StringTestFactoryRegistry > MapRegistries; -+ MapRegistries m_registries; - - typedef std::set<TestFactory *> Factories; - Factories m_factoriesToDestroy; -@@ -44,13 +55,27 @@ - - NamedRegistries::~NamedRegistries() - { -- Registries::iterator it = m_registries.begin(); -- while ( it != m_registries.end() ) -- { -- TestFactoryRegistry *registry = (it++)->second; -- if ( needDestroy( registry ) ) -- delete registry; -- } -+#ifdef HELLOWORLD_DEBUGGER -+ printf("~NamedRegistries.\n"); -+#endif -+ MapRegistries::iterator it = m_registries.begin(); -+ while ( it != m_registries.end() ) -+ { -+ TestFactoryRegistry *registry = (it++)->second; -+ if ( needDestroy( registry ) ) -+ delete registry; -+ } -+/* -+ for (MapRegistries::iterator it = m_registries.begin(); -+ it != m_registries.end(); -+ ++it) -+ { -+ StringTestFactoryRegistry stfr = *it; -+ TestFactoryRegistry *registry = stfr.second; -+ if ( needDestroy( registry ) ) -+ delete registry; -+ } -+*/ - } - - -@@ -63,17 +88,55 @@ - - - TestFactoryRegistry & --NamedRegistries::getRegistry( std::string name ) -+NamedRegistries::getRegistry( std::string const& name ) - { -- Registries::const_iterator foundIt = m_registries.find( name ); -- if ( foundIt == m_registries.end() ) -+#ifdef HELLOWORLD_DEBUGGER -+ printf("getRegistry '%s', ", name.c_str()); -+#endif -+ MapRegistries::const_iterator foundIt = m_registries.find( name ); -+ if ( foundIt == m_registries.end() ) -+ { -+ TestFactoryRegistry *factory = new TestFactoryRegistry( name ); -+ // m_registries.insert( std::make_pair( name, factory ) ); -+ m_registries[name] = factory; -+ m_factoriesToDestroy.insert( factory ); -+ -+#ifdef HELLOWORLD_DEBUGGER -+ printf("factory not found, create.\n"); -+#endif -+ return *factory; -+ } -+#ifdef HELLOWORLD_DEBUGGER -+ printf("factory found.\n"); -+#endif -+ return *foundIt->second; -+/* -+ // MapRegistries::const_iterator foundIt; -+ TestFactoryRegistry *pFound = NULL; -+ for (MapRegistries::const_iterator it = m_registries.begin(); -+ it != m_registries.end(); -+ ++it) -+ { -+ StringTestFactoryRegistry stfr = *it; -+ if (name == stfr.first) -+ { -+ pFound = stfr.second; -+ break; -+ } -+ } -+ -+ // MapRegistries::const_iterator foundIt = m_registries.find( name ); -+ if ( pFound != NULL ) - { - TestFactoryRegistry *factory = new TestFactoryRegistry( name ); -- m_registries.insert( std::make_pair( name, factory ) ); -+ // m_registries.insert( std::make_pair( name, factory ) ); -+ StringTestFactoryRegistry stfr = std::make_pair(name, factory); -+ m_registries.push_back(stfr); - m_factoriesToDestroy.insert( factory ); - return *factory; - } -- return *foundIt->second; -+ return *pFound; -+*/ - } - - -@@ -91,9 +154,32 @@ - return m_destroyedFactories.count( factory ) == 0; - } - -+void NamedRegistries::testRegistries( hTestResult _pResult) -+{ -+ // initialise the test handling -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, INIT_TEST, TAG_RESULT_PTR, _pResult, TAG_DONE); -+ -+ // Start signal based Check -+ for (MapRegistries::const_iterator it = m_registries.begin(); -+ it != m_registries.end(); -+ ++it) -+ { -+ std::string sName = (*it).first; -+ -+ CppUnit::Test* tp = CppUnit::TestFactoryRegistry::getRegistry(sName).makeTest(); -+ tp->run(_pResult); -+ } - -+ // release test handling -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RELEASE_TEST, TAG_RESULT_PTR, _pResult, TAG_DONE); -+ // start normal based tests, leave signal signed tests out. - --TestFactoryRegistry::TestFactoryRegistry( std::string name ) : -+ //! Allfunction in the inclusion list which has a flag, not found, has to call here. -+} -+ -+// ----------------------------------------------------------------------------- -+ -+TestFactoryRegistry::TestFactoryRegistry( std::string const& name ) : - m_name( name ) - { - } -@@ -116,26 +202,38 @@ - } - } - -- -+// static - TestFactoryRegistry & - TestFactoryRegistry::getRegistry() - { - return getRegistry( "All Tests" ); - } - -- -+// static - TestFactoryRegistry & - TestFactoryRegistry::getRegistry( const std::string &name ) - { - return NamedRegistries::getInstance().getRegistry( name ); - } - -+// static -+void TestFactoryRegistry::testRegistries( hTestResult _pResult ) -+{ -+ NamedRegistries::getInstance().testRegistries( _pResult ); -+} -+ - - void - TestFactoryRegistry::registerFactory( const std::string &name, - TestFactory *factory ) - { -- m_factories[name] = factory; -+#ifdef HELLOWORLD_DEBUGGER -+ printf("registerFactory %s\n", name.c_str()); -+#endif -+ m_factories[name] = factory; -+#ifdef HELLOWORLD_DEBUGGER -+ printf("FactorySize: %d\n ", m_factories.size()); -+#endif - } - - -@@ -144,10 +242,23 @@ - { - static int serialNumber = 1; - -- OStringStream ost; -- ost << "@Dummy@" << serialNumber++; -- -- registerFactory( ost.str(), factory ); -+ std::string aStr("@Dummy@_"); -+ -+ sal_Char cBuf[20]; -+ sal_Char *pBuf = cBuf; -+ sprintf(pBuf, "%d", serialNumber++ ); -+ -+ aStr += std::string(pBuf); -+ -+ // LLA: this does not work within Solaris, could be a problem of the osl::Module::load? -+ // std::ostringstream ost; -+ // ost << "@Dummy@" << nValue; -+ // registerFactory( ost.str(), factory ); -+ -+#ifdef HELLOWORLD_DEBUGGER -+ printf("aStr: %s\n", aStr.c_str()); -+#endif -+ registerFactory( aStr, factory ); - } - - -@@ -163,6 +274,9 @@ - void - TestFactoryRegistry::addTestToSuite( TestSuite *suite ) - { -+#ifdef HELLOWORLD_DEBUGGER -+ printf("addTestToSuite %s\n", suite->getName().c_str()); -+#endif - for ( Factories::iterator it = m_factories.begin(); - it != m_factories.end(); - ++it ) ---- misc/cppunit-1.8.0/src/cppunit/TestFailure.cpp 2002-02-28 11:57:20.000000000 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/TestFailure.cpp 2008-02-27 17:23:02.000000000 +0100 -@@ -5,12 +5,12 @@ - namespace CppUnit { - - /// Constructs a TestFailure with the given test and exception. --TestFailure::TestFailure( Test *failedTest, -- Exception *thrownException, -- bool isError ) : -- m_failedTest( failedTest ), -- m_thrownException( thrownException ), -- m_isError( isError ) -+TestFailure::TestFailure( Test *failed, -+ Exception *_thrownException, -+ ErrorType::num eError ) : -+ m_failedTest( failed ), -+ m_thrownException( _thrownException ), -+ m_eError( eError ) - { - } - -@@ -45,10 +45,19 @@ - - - /// Indicates if the failure is a failed assertion or an error. --bool -+bool - TestFailure::isError() const - { -- return m_isError; -+ if (m_eError == ErrorType::ET_ERROR || -+ m_eError == ErrorType::ET_SIGNAL) -+ return true; -+ return false; -+} -+ -+ErrorType::num -+TestFailure::getErrorType() const -+{ -+ return m_eError; - } - - -@@ -71,7 +80,7 @@ - TestFailure * - TestFailure::clone() const - { -- return new TestFailure( m_failedTest, m_thrownException->clone(), m_isError ); -+ return new TestFailure( m_failedTest, m_thrownException->clone(), m_eError ); - } - - } // namespace CppUnit ---- misc/cppunit-1.8.0/src/cppunit/TestSuite.cpp 2002-03-24 20:39:55.000000000 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/TestSuite.cpp 2008-02-27 17:24:10.000000000 +0100 -@@ -1,11 +1,15 @@ -+#include <stdlib.h> - #include "cppunit/TestSuite.h" --#include "cppunit/TestResult.h" -+// #include "cppunit/TestResult.h" -+#include <cppunit/tagvalues.hxx> -+#include <cppunit/autoregister/callbackfunc_fktptr.h> -+#include <cppunit/externcallbackfunc.hxx> - - namespace CppUnit { - - /// Default constructor --TestSuite::TestSuite( std::string name ) -- : m_name( name ) -+TestSuite::TestSuite( std::string const& name ) -+ : m_name( name ) - { - } - -@@ -13,7 +17,7 @@ - /// Destructor - TestSuite::~TestSuite() - { -- deleteContents(); -+ deleteContents(); - } - - -@@ -21,28 +25,37 @@ - void - TestSuite::deleteContents() - { -- for ( std::vector<Test *>::iterator it = m_tests.begin(); -- it != m_tests.end(); -- ++it) -- delete *it; -- m_tests.clear(); -+ for ( std::vector<Test *>::iterator it = m_tests.begin(); -+ it != m_tests.end(); -+ ++it) -+ delete *it; -+ m_tests.clear(); - } - - - /// Runs the tests and collects their result in a TestResult. -+ - void --TestSuite::run( TestResult *result ) -+TestSuite::run( hTestResult result ) - { -- for ( std::vector<Test *>::iterator it = m_tests.begin(); -- it != m_tests.end(); -- ++it ) -- { -- if ( result->shouldStop() ) -- break; -- -- Test *test = *it; -- test->run( result ); -- } -+ // (pTestResult_EnterNode)(result, getName().c_str()); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_ENTER_NODE, TAG_RESULT_PTR, result, TAG_NODENAME, getName().c_str(), TAG_DONE); -+ for ( std::vector<Test *>::iterator it = m_tests.begin(); -+ it != m_tests.end(); -+ ++it ) -+ { -+ //# if ( result->shouldStop() ) -+ //# break; -+ // if ( pTestResult_ShouldStop(result) ) -+ if ( (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_SHOULD_STOP, TAG_RESULT_PTR, result, TAG_DONE) ) -+ { -+ break; -+ } -+ Test *test = *it; -+ test->run( result ); -+ } -+ // (pTestResult_LeaveNode)(result, getName().c_str()); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_LEAVE_NODE, TAG_RESULT_PTR, result, TAG_NODENAME, getName().c_str(), TAG_DONE); - } - - -@@ -50,14 +63,14 @@ - int - TestSuite::countTestCases() const - { -- int count = 0; -- -- for ( std::vector<Test *>::const_iterator it = m_tests.begin(); -- it != m_tests.end(); -- ++it ) -- count += (*it)->countTestCases(); -- -- return count; -+ int count = 0; -+ -+ for ( std::vector<Test *>::const_iterator it = m_tests.begin(); -+ it != m_tests.end(); -+ ++it ) -+ count += (*it)->countTestCases(); -+ -+ return count; - } - - -@@ -65,7 +78,7 @@ - void - TestSuite::addTest( Test *test ) - { -- m_tests.push_back( test ); -+ m_tests.push_back( test ); - } - - -@@ -73,7 +86,7 @@ - std::string - TestSuite::toString() const - { -- return "suite " + getName(); -+ return "suite " + getName(); - } - - -@@ -81,16 +94,20 @@ - std::string - TestSuite::getName() const - { -- return m_name; -+ return m_name; - } - - - const std::vector<Test *> & - TestSuite::getTests() const - { -- return m_tests; -+ return m_tests; - } - - - } // namespace CppUnit - -+// The following sets variables for GNU EMACS -+// Local Variables: -+// tab-width:4 -+// End: ---- misc/cppunit-1.8.0/src/cppunit/cmdlinebits.cxx 2008-12-10 20:46:08.820775372 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/cmdlinebits.cxx 2008-12-10 20:42:44.000000000 +0100 -@@ -1 +1,144 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#ifdef WNT -+# define UNDER_WINDOWS_DEBUGGING -+# include "testshl/winstuff.hxx" -+#endif /* WNT */ -+ -+#include <stdio.h> -+#include <cppunit/cmdlinebits.hxx> -+#include "cppunit/checkboom.hxx" -+ -+#include <cppunit/autoregister/callbackstructure.h> -+#include <osl/diagnose.h> -+#include <rtl/tres.h> -+#include <cppunit/stringhelper.hxx> -+ -+extern CallbackStructure aGlobalStructure; -+ -+sal_Bool isBit( CmdLineBits _nBits, CmdLineBits _nFlag ); -+ -+// sal_Bool isBit( CmdLineBits _nBits, CmdLineBits _nFlag ) -+// { -+// return( ( _nBits & _nFlag ) == _nFlag ); -+// } -+ -+void CheckBoom(bool bCondition, std::string const& msg) -+{ -+ (void) msg; // avoid warning -+ if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_BOOM ) ) -+ { -+ /* force an assertion on false state */ -+ if ( !bCondition ) { -+#ifdef UNDER_WINDOWS_DEBUGGING -+ WinDebugBreak(); -+#else -+ OSL_ENSURE( false, msg.c_str() ); -+#endif -+ } -+ } -+} -+ -+void CheckBoom(bool bCondition, rtl::OUString const& msg) -+{ -+ if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_BOOM ) ) -+ { -+ /* force an assertion on false state */ -+ rtl::OString sMessage; -+ sMessage <<= msg; -+ if ( !bCondition ) { -+#ifdef UNDER_WINDOWS_DEBUGGING -+ WinDebugBreak(); -+#else -+ OSL_ENSURE( false, sMessage.getStr() ); -+#endif -+ } -+ } -+} -+ -+const char* getForwardString() -+{ -+ return aGlobalStructure.psForward; -+} -+ -+// ----------------------------------------------------------------------------- -+// ----------------------------- own printf method ----------------------------- -+// ----------------------------------------------------------------------------- -+ -+// bool isVerbose() -+// { -+// if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_VERBOSE ) ) -+// { -+// return true; -+// } -+// return false; -+// } -+// -+// bool isQuiet() -+// { -+// if ( isBit( aGlobalStructure.nBits, rtl_tres_Flag_QUIET ) ) -+// { -+// return true; -+// } -+// return false; -+// } -+// -+// void impl_t_print(const char* _pFormatStr, va_list &args) -+// { -+// if (! isQuiet()) -+// { -+// printf("# "); -+// vprintf(_pFormatStr, args); -+// } -+// } -+// -+// void t_print(const char* _pFormatStr, ...) -+// { -+// va_list args; -+// va_start( args, _pFormatStr ); -+// impl_t_print(_pFormatStr, args); -+// va_end( args ); -+// } -+// -+// void t_print(T_Print_Params _eType, const char* _pFormatStr, ...) -+// { -+// if (_eType == T_VERBOSE && isVerbose()) -+// { -+// // if T_VERBOSE and we should be verbose, print info -+// va_list args; -+// va_start( args, _pFormatStr ); -+// impl_t_print(_pFormatStr, args); -+// va_end( args ); -+// } -+// } -Nur in misc/build/cppunit-1.8.0/src/cppunit: cmdlinebits.cxx.dummy. ---- misc/cppunit-1.8.0/src/cppunit/joblist.cxx 2008-12-10 20:46:08.893444692 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/joblist.cxx 2008-12-09 09:03:54.000000000 +0100 -@@ -1 +1,224 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <fstream> -+#include <rtl/string.hxx> -+#include "cppunit/joblist.hxx" -+ -+#define C_SEPARATOR_LIST " \t,;:#" -+JobList::JobList() -+ :ppsJobList(NULL) -+{} -+ -+// ----------------------------------------------------------------------------- -+bool JobList::isInCurrentEnvironment(std::string const& _sString) -+{ -+ int nSpace = 0; -+ std::string sSearchString = _sString; -+ bool bEnd = false; -+ // run through the hole given string, -+ std::string sEnv; -+ -+ do { -+ nSpace = sSearchString.find_first_of(C_SEPARATOR_LIST); -+ if (nSpace < 0) -+ { -+ sEnv = sSearchString; -+ bEnd = true; -+ } -+ else -+ { -+ sEnv = sSearchString.substr(0, nSpace); -+ sSearchString = sSearchString.substr(nSpace + 1); -+ } -+ if (sEnv.length() > 0) -+ { -+ // cout << sEnv << endl; -+#ifdef LINUX -+ int nLinux = sEnv.find("unxlng"); -+ if (nLinux >= 0) -+ { -+ // found unxlng -+ return true; -+ } -+#endif -+#ifdef SOLARIS -+ int nSolaris = sEnv.find("unxsol"); -+ if (nSolaris >= 0) -+ { -+ // found unxsol -+ return true; -+ } -+#endif -+#ifdef WNT -+ int nWindows = sEnv.find("wnt"); -+ if (nWindows >= 0) -+ { -+ // found wnt -+ return true; -+ } -+#endif -+ } -+ } while ( !bEnd ); -+ return false; -+} -+ -+std::string JobList::trim(std::string const& _sStringToTrim) -+{ -+ rtl::OString sStr(_sStringToTrim.c_str()); -+ sStr = sStr.trim(); -+ return std::string(sStr.getStr()); -+} -+ -+// ----------------------------------------------------------------------------- -+bool JobList::readfile(std::string const& _sFilename, JobType _nJobType) -+{ -+ // StringList aJobList; -+ m_aJobList.clear(); -+ -+ std::ifstream in(_sFilename.c_str(), std::ios::in); -+ -+ if (!in) -+ { -+ // fprintf(stderr, "warning: Can't open job file: %s\n", _sFilename.c_str()); -+ return false; -+ } -+ else -+ { -+ if (_nJobType == JOB_EXCLUDE_LIST) -+ { -+ fprintf(stderr, "warning: There exist a job exclusion list file: %s\n", _sFilename.c_str()); -+ } -+ -+ // std::cout << "Check for signal" << std::endl; -+ std::string sLine; -+ while (std::getline(in, sLine)) -+ { -+ if (sLine.size() > 0) -+ { -+ char ch = sLine[0]; -+ if (ch != '#' && -+ isspace(ch) == 0) -+ { -+ sLine = trim(sLine); -+ -+ // m_aJobList.push_back( sLine ); -+ int nSpace = sLine.find_first_of(C_SEPARATOR_LIST); -+ if (nSpace < 0) -+ { -+ m_aJobList[sLine] = JOB_UNKNOWN; -+ } -+ else -+ { -+ // found a separator -+ std::string sTest = sLine.substr(0, nSpace); -+ std::string sRest = sLine.substr(nSpace + 1); -+ if (isInCurrentEnvironment(sRest)) -+ { -+ m_aJobList[sTest] = JOB_UNKNOWN; -+ } -+ } -+ } -+ } -+ } -+ -+ // inclusion list -+/* -+ int nSize = m_aJobList.size(); -+ -+ ppsJobList = (char**) malloc((nSize + 1) * sizeof(char*)); -+ -+ int nIdx = 0; -+ StringList::const_iterator aItEnd = m_aJobList.end(); -+ for(StringList::const_iterator it = m_aJobList.begin(); -+ it != aItEnd; ++it) -+ { -+ std::string sValue = *it; -+ char* psTestFkt = (char*) malloc(sValue.size() + 1); -+ strcpy(psTestFkt, sValue.c_str()); -+ ppsJobList[nIdx] = psTestFkt; -+ ++nIdx; -+ } -+ -+ ppsJobList[nIdx] = NULL; -+*/ -+ } -+ return true; -+} -+ -+// ----------------------------------------------------------------------------- -+int JobList::getJobListEntry(std::string const& _sIndexName) -+{ -+ if (m_aJobList.find(_sIndexName) != m_aJobList.end()) -+ { -+ return m_aJobList[_sIndexName]; -+ } -+ return JOB_NOT_FOUND; -+} -+ -+// ----------------------------------------------------------------------------- -+void JobList::setJobListEntry(std::string const& _sIndexName, int _nValue) -+{ -+ // if (m_aJobList.find(_sIndexName) == m_aJobList.end()) -+ // { -+ m_aJobList[_sIndexName] = _nValue; -+ // } -+ // else -+ // { -+ // fprintf(stderr, "error: test function '%s' already exist.\n", _sIndexName); -+ // } -+} -+ -+// ----------------------------------------------------------------------------- -+JobList::~JobList() -+{ -+ int nIdx = 0; -+ if (ppsJobList) -+ { -+ while(ppsJobList[nIdx] != NULL) -+ { -+ free(ppsJobList[nIdx]); -+ ++nIdx; -+ } -+ free(ppsJobList); -+ } -+} -+// ----------------------------------------------------------------------------- -+/* -+ bool JobList::checkFilter(JobList m_aJobFilter, std::string const& _sNodeName, std::string const& _sName) -+ { -+ std::string sFilter = m_aJobFilter.m_aJobList.begin(); -+ } -+*/ -Nur in misc/build/cppunit-1.8.0/src/cppunit: joblist.cxx.dummy. ---- misc/cppunit-1.8.0/src/cppunit/makefile.mk 2008-12-10 20:46:08.970632544 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/makefile.mk 2008-12-10 19:44:52.000000000 +0100 -@@ -1 +1,113 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile$ -+# -+# $Revision$ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+PRJ=..$/..$/..$/..$/..$/.. -+INCEXT=..$/..$/include -+ -+PRJNAME=cppunit -+TARGET=cppunit -+LIBTARGET=NO -+ENABLE_EXCEPTIONS=TRUE -+# ENABLE_RTTI=TRUE -+ -+# --- Settings ----------------------------------------------------- -+ -+.INCLUDE : settings.mk -+ -+# --- Files -------------------------------------------------------- -+ -+# CXXFILES = \ -+# querytemplate.cxx \ -+# stringhelper.cxx -+ -+# ENVCFLAGSCXX+=-DCPPUNIT_BUILD_DLL -+ -+CPPUNIT_TESTSHL_SLOFILES = \ -+ $(SLO)$/SourceLine.obj \ -+ $(SLO)$/Exception.obj \ -+ $(SLO)$/NotEqualException.obj \ -+ $(SLO)$/TestFailure.obj \ -+ $(SLO)$/joblist.obj \ -+ $(SLO)$/t_print.obj \ -+ $(SLO)$/signaltest.obj -+ -+CPPUNIT_STATIC_SOLFILES = \ -+ $(SLO)$/Asserter.obj \ -+ $(SLO)$/TestCase.obj \ -+ $(SLO)$/TestSuite.obj \ -+ $(SLO)$/TestAssert.obj \ -+ $(SLO)$/TestFactoryRegistry.obj \ -+ $(SLO)$/cmdlinebits.obj \ -+ $(SLO)$/tresregister.obj \ -+ $(SLO)$/tresstatewrapper.obj \ -+ $(SLO)$/registertestfunction.obj -+ -+ -+SLOFILES = \ -+ $(CPPUNIT_TESTSHL_SLOFILES) \ -+ $(CPPUNIT_STATIC_SOLFILES) -+#------------------------------------------------------------------------------- -+# This is statically cppunit library -+LIB1TARGET= $(LB)$/$(TARGET).lib -+LIB1OBJFILES= \ -+ $(SLOFILES) -+ -+.IF "$(GUI)"=="WNT" -+.IF "$(COM)"=="GCC" -+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -+.ENDIF -+LIB1FILES=$(LB)$/c5t_winstuff.lib -+.ENDIF -+ -+.IF "$(GUI)" == "UNX" -+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -+.ENDIF -+ -+#------------------------------------------------------------------------------- -+TARGET2=c5t_no_regallfkt -+LIB2TARGET= $(LB)$/$(TARGET2).lib -+LIB2OBJFILES= \ -+ $(CPPUNIT_TESTSHL_SLOFILES) -+ -+.IF "$(GUI)"=="WNT" -+.IF "$(COM)"=="GCC" -+LIB2ARCHIV=$(LB)$/lib$(TARGET2)$(DLLPOSTFIX).a -+.ENDIF -+.ENDIF -+ -+.IF "$(GUI)" == "UNX" -+LIB2ARCHIV=$(LB)$/lib$(TARGET2)$(DLLPOSTFIX).a -+.ENDIF -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk -+ -Nur in misc/build/cppunit-1.8.0/src/cppunit: makefile.mk.dummy. ---- misc/cppunit-1.8.0/src/cppunit/registertestfunction.cxx 2008-12-10 20:46:09.058854031 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/registertestfunction.cxx 2008-12-09 09:04:23.000000000 +0100 -@@ -1 +1,60 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdlib.h> -+#include <cppunit/simpleheader.hxx> -+#include <cppunit/additionalfunc.hxx> -+ -+extern "C" void SAL_CALL testAllRegisteredFunctions(hTestResult _pResult) -+{ -+ CppUnit::TestFactoryRegistry::testRegistries(_pResult); -+ // CppUnit::Test* tp = CppUnit::TestFactoryRegistry::getRegistry("rtl_OUString").makeTest(); -+ // tp->run(pResult); -+} -+ -+// ----------------------------------------------------------------------------- -+// ---------------------------- RegisterTestFunctions ---------------------------- -+// ----------------------------------------------------------------------------- -+ -+extern "C" void SAL_CALL RegisterTestFunctions(FktRegFuncPtr _pFunc) -+{ -+ if (_pFunc) -+ { -+ (_pFunc)(&testAllRegisteredFunctions, ""); -+ } -+ else -+ { -+ // error, FktRegFuncPtr not given -+ } -+ RegisterAdditionalFunctions(_pFunc); -+} -Nur in misc/build/cppunit-1.8.0/src/cppunit: registertestfunction.cxx.dummy. ---- misc/cppunit-1.8.0/src/cppunit/signaltest.cxx 2008-12-10 20:46:09.119798751 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/signaltest.cxx 2008-12-09 09:04:24.000000000 +0100 -@@ -1 +1,92 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <typeinfo> -+ -+#include "cppunit/signaltest.h" -+ -+namespace CppUnit -+{ -+ -+/** Constructs a test case for a suite. -+ * This TestCase is intended for use by the TestCaller and should not -+ * be used by a test case for which run() is called. -+ **/ -+SignalTest::SignalTest(std::string const& _sName) -+ : m_sName( _sName ) -+{ -+} -+ -+ -+/// Destructs a test case -+SignalTest::~SignalTest() -+{ -+} -+ -+ -+/// Returns a count of all the tests executed -+int -+SignalTest::countTestCases() const -+{ -+ return 1; -+} -+ -+/// We never need to start this -+void SignalTest::run(hTestResult) {} -+ -+ -+/// Returns the name of the test case -+std::string -+SignalTest::getName() const -+{ -+ return m_sName; -+} -+ -+ -+/// Returns the name of the test case instance -+std::string -+SignalTest::toString() const -+{ -+ std::string className; -+ -+#if CPPUNIT_USE_TYPEINFO_NAME -+ const std::type_info& thisClass = typeid( *this ); -+ className = thisClass.name(); -+#else -+ className = "SignalTest"; -+#endif -+ -+ return className + "." + getName(); -+} -+ -+} // namespace CppUnit -Nur in misc/build/cppunit-1.8.0/src/cppunit: signaltest.cxx.dummy. ---- misc/cppunit-1.8.0/src/cppunit/t_print.cxx 2008-12-10 20:46:09.210907830 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/t_print.cxx 2008-12-09 09:04:23.000000000 +0100 -@@ -1 +1,98 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdio.h> -+#include <cppunit/cmdlinebits.hxx> -+#include <rtl/tres.h> -+#include <osl/mutex.hxx> -+ -+extern CmdLineBits st_nBits; -+ -+sal_Bool isBit( CmdLineBits _nBits, CmdLineBits _nFlag ) -+{ -+ return( ( _nBits & _nFlag ) == _nFlag ); -+} -+ -+// ----------------------------------------------------------------------------- -+// ----------------------------- own printf method ----------------------------- -+// ----------------------------------------------------------------------------- -+ -+bool isVerbose() -+{ -+ if ( isBit( st_nBits, rtl_tres_Flag_VERBOSE ) ) -+ { -+ return true; -+ } -+ return false; -+} -+ -+bool isQuiet() -+{ -+ if ( isBit( st_nBits, rtl_tres_Flag_QUIET ) ) -+ { -+ return true; -+ } -+ return false; -+} -+ -+// ::osl::Mutex m_aTPrintMutex; -+ -+void impl_t_print(const char* _pFormatStr, va_list &args) -+{ -+ if (! isQuiet()) -+ { -+ // ::osl::MutexGuard g(m_aTPrintMutex); -+ printf("# "); -+ vprintf(_pFormatStr, args); -+ } -+} -+ -+void t_print(const char* _pFormatStr, ...) -+{ -+ va_list args; -+ va_start( args, _pFormatStr ); -+ impl_t_print(_pFormatStr, args); -+ va_end( args ); -+} -+ -+void t_print(T_Print_Params _eType, const char* _pFormatStr, ...) -+{ -+ if (_eType == T_VERBOSE && isVerbose()) -+ { -+ // if T_VERBOSE and we should be verbose, print info -+ va_list args; -+ va_start( args, _pFormatStr ); -+ impl_t_print(_pFormatStr, args); -+ va_end( args ); -+ } -+} -Nur in misc/build/cppunit-1.8.0/src/cppunit: t_print.cxx.dummy. ---- misc/cppunit-1.8.0/src/cppunit/tresregister.cxx 2008-12-10 20:46:09.288665520 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/tresregister.cxx 2008-12-09 09:04:23.000000000 +0100 -@@ -1 +1,69 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdio.h> -+#include <sal/types.h> -+#include <cppunit/autoregister/registerfunc.h> -+#include <cppunit/autoregister/callbackstructure.h> -+#include <cppunit/cmdlinebits.hxx> -+ -+//! is this global CallbackStructure need? -+CallbackStructure aGlobalStructure; -+CmdLineBits st_nBits; -+ -+FktPtr_CallbackDispatch pCallbackFunc = NULL; -+ -+// This function is called from the TestShl tool. -+extern "C" void SAL_CALL registerAllTestFunction(CallbackStructure* _pCallback) -+{ -+ aGlobalStructure = *_pCallback; -+ -+ st_nBits = aGlobalStructure.nBits; -+ -+ pCallbackFunc = _pCallback->aCallbackDispatch; -+ FktRegFuncPtr pFunc = _pCallback->aRegisterFunction; -+ if (pFunc) -+ { -+ RegisterTestFunctions(pFunc); -+ } -+ else -+ { -+ // error, should be echoed -+ fprintf(stderr, "error: Callback Structure doesn't contain a test function ptr.\n"); -+ } -+ -+ // all is done, copy the magic value -+ // this is only a simple internal invariant check, -+ // if the called registerAllTestFunctions Function do, what we want. -+ _pCallback->nMagic2 = _pCallback->nMagic; -+} -Nur in misc/build/cppunit-1.8.0/src/cppunit: tresregister.cxx.dummy. ---- misc/cppunit-1.8.0/src/cppunit/tresstatewrapper.cxx 2008-12-10 20:46:09.345773546 +0100 -+++ misc/build/cppunit-1.8.0/src/cppunit/tresstatewrapper.cxx 2008-12-10 20:42:43.000000000 +0100 -@@ -1 +1,168 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+// this functions build the wrapper, to handle old function calls to rtl_tres_state -+// IMPORTANT: Due to the fact that rtl_tres_state is in the sal.lib -+// you have to rename rtl_tres_state to c_rtl_tres_state -+// -+// return c_rtl_tres_state -+// ( -+// hRtlTestResult, -+// pData->length == 0 && -+// ! *pData->buffer, -+// "New OString containing no characters", -+// "ctor_001" -+// ) -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <string.h> -+#include "cppunit/Test.h" -+#include "cppunit/autoregister/htestresult.h" -+#include "cppunit/autoregister/callbackfunc_fktptr.h" -+#include "cppunit/TestAssert.h" -+ -+#define LOAD_TRESSTATEWRAPPER_LOCAL -+#include "testshl/tresstatewrapper.hxx" -+#undef LOAD_TRESSTATEWRAPPER_LOCAL -+ -+#include "cppunit/tagvalues.hxx" -+#include "cppunit/externcallbackfunc.hxx" -+ -+// ----------------------------------------------------------------------------- -+// Wrapper class for the CppUnit::Test, because the new TestResult -+// expect a CppUnit::Test interface -+ -+class WrappedTest : public CppUnit::Test -+{ -+ std::string m_sName; -+public: -+ WrappedTest(std::string const& _sName) -+ :m_sName(_sName){} -+ -+ virtual ~WrappedTest () {} -+ virtual void run (hTestResult /*pResult*/){} -+ virtual int countTestCases () const {return 1;} -+ virtual std::string getName () const {return m_sName;} -+ virtual std::string toString () const {return "WrappedTest";} -+}; -+ -+// ----------------------------------------------------------------------------- -+rtl_tres_state_start::rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName) -+ :m_pName(_pName), -+ m_aResult(_aResult) -+{ -+ // (pTestResult_EnterNode)(m_aResult, m_pName); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ENTER_NODE, TAG_RESULT_PTR, m_aResult, TAG_NODENAME, m_pName, TAG_DONE); -+} -+rtl_tres_state_start::~rtl_tres_state_start() -+{ -+ // (pTestResult_LeaveNode)(m_aResult, m_pName); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_LEAVE_NODE, TAG_RESULT_PTR, m_aResult, TAG_NODENAME, m_pName, TAG_DONE); -+} -+ -+// --------------------------------- C-Wrapper --------------------------------- -+typedef std::vector<rtl_tres_state_start*> rtl_tres_states; -+rtl_tres_states m_StateStack; -+ -+extern "C" void c_rtl_tres_state_start(hTestResult _aResult, const sal_Char* _pName) -+{ -+ rtl_tres_state_start* pState = new rtl_tres_state_start(_aResult, _pName); -+ m_StateStack.push_back(pState); -+} -+ -+extern "C" void c_rtl_tres_state_end(hTestResult, const sal_Char*) -+{ -+ rtl_tres_state_start* pState = m_StateStack.back(); -+ -+ delete pState; -+ m_StateStack.pop_back(); -+} -+// ----------------------------------------------------------------------------- -+// ----------------------------------------------------------------------------- -+// ----------------------------------------------------------------------------- -+ -+// ----------------------------------------------------------------------------- -+// ------------------------- Wrapper for rtl_tres_state ------------------------- -+// ----------------------------------------------------------------------------- -+ -+sal_Bool SAL_CALL c_rtl_tres_state( -+ hTestResult pResult, -+ sal_Bool bSuccess, -+ char const * pTestMsg, -+ char const * pFuncName) -+{ -+ CppUnit::Test* pTest = new WrappedTest(pFuncName); -+ -+ sal_Int32 nValue = (pCallbackFunc)(0 /* NULL */, TAG_TYPE, EXECUTION_CHECK, TAG_RESULT_PTR, pResult, TAG_NODENAME, pTest->getName().c_str(), TAG_DONE); -+ if (nValue == DO_NOT_EXECUTE) -+ { -+ return false; -+ } -+ -+ // This code is copied from CppUnit::TestCase and less adapted, to work with the -+ // old test code. -+ // (pTestResult_StartTest)(pResult, pTest); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_START, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_DONE); -+ -+ try -+ { -+ CPPUNIT_ASSERT_MESSAGE( pTestMsg, bSuccess ? true : false ); -+ // (pTestResult_AddInfo)(pResult, pTest, "#PASSED#"); -+ (pCallbackFunc)(0 /* NULL */, TAG_TYPE, RESULT_ADD_INFO, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_INFO, "PASSED", TAG_DONE); -+ } -+ catch ( CppUnit::Exception &e ) -+ { -+ CppUnit::Exception *copy = e.clone(); -+ // (pTestResult_AddFailure)( pResult, pTest, copy ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_FAILURE, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_EXCEPTION, copy, TAG_DONE ); -+ } -+ catch ( std::exception &e ) -+ { -+ //(pTestResult_AddError)( pResult, pTest, new CppUnit::Exception( e.what() ) ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_EXCEPTION, new CppUnit::Exception( e.what() ), TAG_DONE ); -+ } -+ catch (...) -+ { -+ CppUnit::Exception *e = new CppUnit::Exception( "caught unknown exception" ); -+ // (pTestResult_AddError)( pResult, pTest, e ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_ADD_ERROR, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_EXCEPTION, e, TAG_DONE ); -+ } -+ -+ -+ // (pTestResult_EndTest)( pResult, pTest ); -+ (pCallbackFunc)( 0 /* NULL */, TAG_TYPE, RESULT_END, TAG_RESULT_PTR, pResult, TAG_TEST_PTR, pTest, TAG_DONE ); -+ -+ return bSuccess; -+} -+ -Nur in misc/build/cppunit-1.8.0/src/cppunit: tresstatewrapper.cxx.dummy. ---- misc/cppunit-1.8.0/src/makefile.mk 2008-12-10 20:46:08.706925653 +0100 -+++ misc/build/cppunit-1.8.0/src/makefile.mk 2008-12-09 08:57:10.000000000 +0100 -@@ -1 +1,35 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile$ -+# -+# $Revision$ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+target: -+ cd cppunit && $(MAKE) $(MFLAGS) $(CALLMACROS) -+ cd result && $(MAKE) $(MFLAGS) $(CALLMACROS) -+ cd win32 && $(MAKE) $(MFLAGS) $(CALLMACROS) -Nur in misc/build/cppunit-1.8.0/src: makefile.mk.dummy. ---- misc/cppunit-1.8.0/src/result/SynchronizedObject.cpp 2008-12-10 20:46:05.438373643 +0100 -+++ misc/build/cppunit-1.8.0/src/result/SynchronizedObject.cpp 2008-02-27 17:26:28.000000000 +0100 -@@ -1 +1,35 @@ --dummy -+#include <cppunit/result/SynchronizedObject.h> -+ -+ -+namespace CppUnit -+{ -+ -+ -+ -+ -+SynchronizedObject::SynchronizedObject( SynchronizationObject *syncObject ) -+ : m_syncObject( syncObject == 0 ? new SynchronizationObject() : -+ syncObject ) -+{ -+} -+ -+ -+SynchronizedObject::~SynchronizedObject() -+{ -+ delete m_syncObject; -+} -+ -+ -+/** Accept a new synchronization object for protection of this instance -+ * TestResult assumes ownership of the object -+ */ -+void -+SynchronizedObject::setSynchronizationObject( SynchronizationObject *syncObject ) -+{ -+ delete m_syncObject; -+ m_syncObject = syncObject; -+} -+ -+ -+} // namespace CppUnit -+ -Nur in misc/build/cppunit-1.8.0/src/result: SynchronizedObject.cpp.dummy. ---- misc/cppunit-1.8.0/src/result/TestResult.cpp 2008-12-10 20:46:05.577200921 +0100 -+++ misc/build/cppunit-1.8.0/src/result/TestResult.cpp 2008-12-10 20:42:45.000000000 +0100 -@@ -1 +1,261 @@ --dummy -+#include <cppunit/TestFailure.h> -+#include <cppunit/result/TestListener.h> -+#include "testshl/getopt.hxx" -+#include <cppunit/result/TestResult.h> -+#include <algorithm> -+#include "cppunit/result/outputter.hxx" -+#include <cppunit/Test.h> -+#include <cppunit/cmdlinebits.hxx> -+ -+namespace CppUnit { -+ -+/// Construct a TestResult -+TestResult::TestResult( GetOpt &_pOptions, SynchronizationObject *syncObject ) -+ : SynchronizedObject( syncObject ), -+ m_aOptionHelper(_pOptions), -+ m_nExitValue(0) -+{ -+ reset(); -+} -+ -+ -+/// Destroys a test result -+TestResult::~TestResult() -+{ -+} -+ -+ -+/** Resets the result for a new run. -+ * -+ * Clear the previous run result. -+ */ -+void -+TestResult::reset() -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_stop = false; -+} -+ -+ -+/** Adds an error to the list of errors. -+ * The passed in exception -+ * caused the error -+ */ -+void -+TestResult::addError( Test *test, -+ Exception *e, ErrorType::num _eType ) -+{ -+ TestFailure aTestFailure( test, e, _eType ); -+ addFailure( aTestFailure ); -+} -+ -+ -+/** Adds a failure to the list of failures. The passed in exception -+ * caused the failure. -+ */ -+void -+TestResult::addFailure( Test *test, Exception *e ) -+{ -+ TestFailure aTestFailure( test, e, ErrorType::ET_FAILURE ); -+ addFailure( aTestFailure ); -+} -+ -+ -+/** Called to add a failure to the list of failures. -+ */ -+void -+TestResult::addFailure( const TestFailure &failure ) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ -+ // LLA: -+ // this set the global returnvalue, due to the fact, there occurs a failure, we have to return a non zero value -+ // at the moment this seams to be a good place. -+ setExitValue(1); -+ -+ for ( TestListeners::iterator it = m_listeners.begin(); -+ it != m_listeners.end(); -+ ++it ) -+ { -+ TestListener *pListener = *it; -+ pListener->addFailure( failure ); -+ } -+} -+ -+ -+/// Informs the result that a test will be started. -+void -+TestResult::startTest( Test *test ) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ if (m_aOptionHelper.isVerbose()) -+ { -+ std::string aStr; -+ if (test) -+ { -+ aStr = getNodeName(); -+ aStr += "."; -+ aStr += test->getName(); -+ } -+ // fprintf(stderr, "Start test: %s\n", aStr.c_str()); -+ t_print( T_VERBOSE, "Start test: %s\n", aStr.c_str()); -+ } -+ -+ for ( TestListeners::iterator it = m_listeners.begin(); -+ it != m_listeners.end(); -+ ++it ) -+ { -+ TestListener *pListener = *it; -+ pListener->startTest( test ); -+ } -+} -+ -+ -+/// Informs the result that a test was completed. -+void -+TestResult::endTest( Test *test ) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ for ( TestListeners::iterator it = m_listeners.begin(); -+ it != m_listeners.end(); -+ ++it ) -+ { -+ TestListener *pListener = *it; -+ pListener->endTest( test ); -+ } -+} -+ -+ -+/// Returns whether testing should be stopped -+bool -+TestResult::shouldStop() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_stop; -+} -+ -+ -+/// Stop testing -+void -+TestResult::stop() -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_stop = true; -+} -+ -+ -+void -+TestResult::addListener( TestListener *listener ) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_listeners.push_back( listener ); -+} -+ -+ -+void -+TestResult::removeListener ( TestListener *listener ) -+{ -+ ExclusiveZone zone( m_syncObject ); -+#if defined(_MSC_VER) && (_MSC_VER >=1400) -+ m_listeners.erase( remove( m_listeners.begin(), -+#else -+ m_listeners.erase( std::remove( m_listeners.begin(), -+#endif -+ m_listeners.end(), -+ listener ), -+ m_listeners.end()); -+} -+ -+void -+TestResult::addInfo(Test *test, const char* _aStr) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ for ( TestListeners::iterator it = m_listeners.begin(); -+ it != m_listeners.end(); -+ ++it ) -+ { -+ TestListener *pListener = *it; -+ pListener->addInfo( test, _aStr ); -+ } -+} -+ -+// old: void -+// old: TestResult::enterNode(const char* _aStr) -+// old: { -+// old: ExclusiveZone zone( m_syncObject ); -+// old: for ( TestListeners::iterator it = m_listeners.begin(); -+// old: it != m_listeners.end(); -+// old: ++it ) -+// old: { -+// old: TestListener *pListener = *it; -+// old: pListener->enterNode( _aStr ); -+// old: } -+// old: } -+// old: -+// old: void -+// old: TestResult::leaveNode(const char* _aStr) -+// old: { -+// old: ExclusiveZone zone( m_syncObject ); -+// old: -+// old: for ( TestListeners::iterator it = m_listeners.begin(); -+// old: it != m_listeners.end(); -+// old: ++it ) -+// old: { -+// old: TestListener *pListener = *it; -+// old: pListener->leaveNode( _aStr ); -+// old: } -+// old: } -+ -+void TestResult::enterNode(const char* _sNode) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_aCurrentNodeNames.push_back(std::string(_sNode)); -+} -+ -+void TestResult::leaveNode(const char* /*_sNode*/) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ std::string sBack = m_aCurrentNodeNames.back(); -+ m_aCurrentNodeNames.pop_back(); -+ -+ // due to a -Wall warning, comment out. -+ // if (sBack != std::string(_sNode)) -+ // { -+ // volatile int dummy = 0; -+ // // problem?! -+ // } -+} -+ -+std::string TestResult::getNodeName() -+{ -+ std::string sName; -+ for (std::vector<std::string>::const_iterator it = m_aCurrentNodeNames.begin(); -+ it != m_aCurrentNodeNames.end(); -+ ++it) -+ { -+ if (sName.size() != 0) -+ { -+ sName += "."; -+ } -+ sName += *it; -+ } -+ return sName; -+} -+ -+// ----------------------------------------------------------------------------- -+bool TestResult::isAllowedToExecute(std::string const& _sName) -+{ -+ return m_aOptionHelper.isAllowedToExecute(getNodeName(), _sName); -+} -+// ----------------------------------------------------------------------------- -+bool TestResult::isOptionWhereAmI() -+{ -+ return m_aOptionHelper.isOptionWhereAmI(); -+} -+ -+// ----------------------------------------------------------------------------- -+void TestResult::print(Outputter&) -+{ -+} -+ -+} // namespace CppUnit -Nur in misc/build/cppunit-1.8.0/src/result: TestResult.cpp.dummy. ---- misc/cppunit-1.8.0/src/result/TestResultCollector.cpp 2008-12-10 20:46:05.532229436 +0100 -+++ misc/build/cppunit-1.8.0/src/result/TestResultCollector.cpp 2008-02-27 17:25:50.000000000 +0100 -@@ -1 +1,147 @@ --dummy -+#include <cppunit/TestFailure.h> -+#include <cppunit/result/TestResultCollector.h> -+ -+ -+namespace CppUnit -+{ -+ -+ -+TestResultCollector::TestResultCollector( TestResult* _pResult, SynchronizationObject *syncObject ) -+ : TestSucessListener( syncObject ), -+ m_pResult(_pResult), -+ m_testErrors(0) -+{ -+ reset(); -+} -+ -+ -+TestResultCollector::~TestResultCollector() -+{ -+ TestFailures::iterator itFailure = m_failures.begin(); -+ while ( itFailure != m_failures.end() ) -+ { -+ TestFailureEnvelope *pEnvelope = *itFailure++; -+ TestFailure *pFailure = pEnvelope->getTestFailure(); -+ delete pFailure; -+ } -+} -+ -+ -+void -+TestResultCollector::reset() -+{ -+ TestSucessListener::reset(); -+ -+ ExclusiveZone zone( m_syncObject ); -+ m_testErrors = 0; -+ m_tests.clear(); -+ m_failures.clear(); -+} -+ -+ -+void -+TestResultCollector::startTest( Test *test ) -+{ -+ ExclusiveZone zone (m_syncObject); -+ -+ m_tests.push_back( new TestEnvelope(test, m_pResult->getNodeName()) ); -+} -+ -+void -+TestResultCollector::endTest( Test * ) -+{ -+ // ExclusiveZone zone (m_syncObject); -+ // Nothing! -+} -+ -+ -+void -+TestResultCollector::addFailure( const TestFailure &failure ) -+{ -+ TestSucessListener::addFailure( failure ); -+ -+ ExclusiveZone zone( m_syncObject ); -+ if ( failure.isError() ) -+ ++m_testErrors; -+ m_failures.push_back( new TestFailureEnvelope(failure.clone(), m_pResult->getNodeName()) ); -+} -+ -+ -+/// Gets the number of run tests. -+int -+TestResultCollector::runTests() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_tests.size(); -+} -+ -+ -+/// Gets the number of detected errors (uncaught exception). -+int -+TestResultCollector::testErrors() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_testErrors; -+} -+ -+ -+/// Gets the number of detected failures (failed assertion). -+int -+TestResultCollector::testFailures() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_failures.size() - m_testErrors; -+} -+ -+ -+/// Gets the total number of detected failures. -+int -+TestResultCollector::testFailuresTotal() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_failures.size(); -+} -+ -+ -+/// Returns a the list failures (random access collection). -+const TestResultCollector::TestFailures & -+TestResultCollector::failures() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_failures; -+} -+ -+ -+const TestResultCollector::Tests & -+TestResultCollector::tests() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_tests; -+} -+ -+void TestResultCollector::addInfo(Test *_pTest, const char* _sInfo) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_aInfos.push_back(new TestInfo(_pTest, _sInfo)); -+} -+ -+std::string TestResultCollector::getInfo(Test *_pTest) -+{ -+ for (TestInfos::const_iterator it = m_aInfos.begin(); -+ it != m_aInfos.end(); -+ ++it) -+ { -+ TestInfo *pInfo = *it; -+ Test *pTest = pInfo->getTest(); -+ if (pTest == _pTest) -+ { -+ std::string sInfo = pInfo->getString(); -+ return sInfo; -+ } -+ } -+ return std::string(); -+} -+ -+ -+} // namespace CppUnit -+ -Nur in misc/build/cppunit-1.8.0/src/result: TestResultCollector.cpp.dummy. ---- misc/cppunit-1.8.0/src/result/TestSucessListener.cpp 2008-12-10 20:46:05.660884351 +0100 -+++ misc/build/cppunit-1.8.0/src/result/TestSucessListener.cpp 2008-02-27 17:26:16.000000000 +0100 -@@ -1 +1,46 @@ --dummy -+#include <cppunit/result/TestSucessListener.h> -+ -+ -+ -+namespace CppUnit -+{ -+ -+ -+TestSucessListener::TestSucessListener( SynchronizationObject *syncObject ) -+ : SynchronizedObject( syncObject ) -+ , m_sucess( true ) -+{ -+} -+ -+ -+TestSucessListener::~TestSucessListener() -+{ -+} -+ -+ -+void -+TestSucessListener::reset() -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_sucess = true; -+} -+ -+ -+void -+TestSucessListener::addFailure( const TestFailure & ) -+{ -+ ExclusiveZone zone( m_syncObject ); -+ m_sucess = false; -+} -+ -+ -+bool -+TestSucessListener::wasSuccessful() const -+{ -+ ExclusiveZone zone( m_syncObject ); -+ return m_sucess; -+} -+ -+ -+} // namespace CppUnit -+ -Nur in misc/build/cppunit-1.8.0/src/result: TestSucessListener.cpp.dummy. ---- misc/cppunit-1.8.0/src/result/TextTestResult.cpp 2008-12-10 20:46:05.742386241 +0100 -+++ misc/build/cppunit-1.8.0/src/result/TextTestResult.cpp 2008-02-27 17:24:56.000000000 +0100 -@@ -1 +1,191 @@ --dummy -+#include <cppunit/Exception.h> -+#include <cppunit/NotEqualException.h> -+#include <cppunit/Test.h> -+#include <cppunit/TestFailure.h> -+#include <cppunit/result/TextTestResult.h> -+// #include <TextTestResult.h> -+//!io #include <iostream> -+ -+namespace CppUnit { -+ -+ -+TextTestResult::TextTestResult(GetOpt& _aOptions) -+ :TestResult(_aOptions), -+ m_aResulter(this) -+{ -+ addListener( &m_aResulter ); -+} -+ -+ -+void -+TextTestResult::addFailure( const TestFailure &failure ) -+{ -+ TestResult::addFailure( failure ); -+ // std::cerr << ( failure.isError() ? "E" : "F" ); -+ if (failure.isError()) -+ fprintf(stderr, "E"); -+ else -+ fprintf(stderr, "F"); -+} -+ -+ -+void -+TextTestResult::startTest( Test *test ) -+{ -+ TestResult::startTest (test); -+ // std::cerr << "."; -+ fprintf(stderr, "."); -+} -+ -+void TextTestResult::endTest( Test *test ) -+{ -+ TestResult::endTest (test); -+} -+ -+ -+void -+TextTestResult::printFailures( std::ostream &stream ) -+{ -+ TestResultCollector::TestFailures::const_iterator itFailure = m_aResulter.failures().begin(); -+ int failureNumber = 1; -+ while ( itFailure != m_aResulter.failures().end() ) -+ { -+ stream << std::endl; -+ TestFailure *pFailure= (*itFailure++)->getTestFailure(); -+ printFailure( pFailure, failureNumber++, stream ); -+ } -+} -+ -+ -+void -+TextTestResult::printFailure( TestFailure *failure, -+ int failureNumber, -+ std::ostream &stream ) -+{ -+ printFailureListMark( failureNumber, stream ); -+ stream << ' '; -+ printFailureTestName( failure, stream ); -+ stream << ' '; -+ printFailureType( failure, stream ); -+ stream << ' '; -+ printFailureLocation( failure->sourceLine(), stream ); -+ stream << std::endl; -+ printFailureDetail( failure->thrownException(), stream ); -+ stream << std::endl; -+} -+ -+ -+void -+TextTestResult::printFailureListMark( int failureNumber, -+ std::ostream &stream ) -+{ -+ stream << failureNumber << ")"; -+} -+ -+ -+void -+TextTestResult::printFailureTestName( TestFailure *failure, -+ std::ostream &stream ) -+{ -+ Test* pTest = failure->failedTest(); -+ stream << "test: " << pTest->getName(); -+} -+ -+ -+void -+TextTestResult::printFailureType( TestFailure *failure, -+ std::ostream &stream ) -+{ -+ stream << "(" -+ << (failure->isError() ? "E" : "F") -+ << ")"; -+} -+ -+ -+void -+TextTestResult::printFailureLocation( SourceLine sourceLine, -+ std::ostream &stream ) -+{ -+ if ( !sourceLine.isValid() ) -+ return; -+ -+ stream << "line: " << sourceLine.lineNumber() -+ << ' ' << sourceLine.fileName(); -+} -+ -+ -+void -+TextTestResult::printFailureDetail( Exception *thrownException, -+ std::ostream &stream ) -+{ -+ if ( thrownException->isInstanceOf( NotEqualException::type() ) ) -+ { -+ NotEqualException *e = (NotEqualException*)thrownException; -+ stream << "expected: " << e->expectedValue() << std::endl -+ << "but was: " << e->actualValue(); -+ if ( !e->additionalMessage().empty() ) -+ { -+ stream << std::endl; -+ stream << "additional message:" << std::endl -+ << e->additionalMessage(); -+ } -+ } -+ else -+ { -+ stream << " \"" << thrownException->what() << "\""; -+ } -+} -+ -+ -+void -+TextTestResult::print( std::ostream& stream ) -+{ -+ printHeader( stream ); -+ stream << std::endl; -+ printFailures( stream ); -+} -+ -+ -+void -+TextTestResult::printHeader( std::ostream &stream ) -+{ -+ if (m_aResulter.wasSuccessful ()) -+ stream << std::endl << "OK (" << m_aResulter.runTests () << " tests)" -+ << std::endl; -+ else -+ { -+ stream << std::endl; -+ printFailureWarning( stream ); -+ printStatistics( stream ); -+ } -+} -+ -+ -+void -+TextTestResult::printFailureWarning( std::ostream &stream ) -+{ -+ stream << "!!!FAILURES!!!" << std::endl; -+} -+ -+ -+void -+TextTestResult::printStatistics( std::ostream &stream ) -+{ -+ stream << "Test Results:" << std::endl; -+ -+ stream << "Run: " << m_aResulter.runTests() -+ << " Failures: " << m_aResulter.testFailures() -+ << " Errors: " << m_aResulter.testErrors() -+ << std::endl; -+} -+ -+ -+std::ostream & -+operator <<( std::ostream &stream, -+ TextTestResult &result ) -+{ -+ result.print (stream); return stream; -+} -+ -+ -+} // namespace CppUnit -Nur in misc/build/cppunit-1.8.0/src/result: TextTestResult.cpp.dummy. ---- misc/cppunit-1.8.0/src/result/emacsTestResult.cxx 2008-12-10 20:46:09.419267625 +0100 -+++ misc/build/cppunit-1.8.0/src/result/emacsTestResult.cxx 2008-12-09 09:06:11.000000000 +0100 -@@ -1 +1,193 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdlib.h> -+ -+#include <map> -+#include <cppunit/Exception.h> -+#include <cppunit/NotEqualException.h> -+#include <cppunit/Test.h> -+#include <cppunit/TestFailure.h> -+#include <cppunit/result/emacsTestResult.hxx> -+// #include <TextTestResult.h> -+//!io #include <iostream> -+#include <string> -+ -+#include <rtl/string.hxx> -+#include "cppunit/result/outputter.hxx" -+ -+namespace CppUnit { -+ -+ emacsTestResult::emacsTestResult(GetOpt & _aOptions) -+ :TestResult(_aOptions), -+ m_aOptions(_aOptions), -+ m_aResulter(this) -+ { -+ addListener( &m_aResulter ); -+ } -+ -+ //# struct ltstr -+ //# { -+ //# bool operator()(const CppUnit::Test* p1, const CppUnit::Test* p2) const -+ //# { -+ //# return p1 < p2; -+ //# } -+ //# }; -+ //# typedef std::map<CppUnit::Test*, bool, ltstr> TestPtrList; -+ -+ void -+ emacsTestResult::print( Outputter& stream ) -+ { -+ printHeader( stream ); -+ // stream << std::endl; -+ // printFailures( stream ); -+ -+ // TestPtrList aFailedTests; -+ -+ for (TestResultCollector::TestFailures::const_iterator it2 = m_aResulter.failures().begin(); -+ it2 != m_aResulter.failures().end(); -+ ++it2) -+ { -+ TestFailureEnvelope *pEnvelop = *it2; -+ TestFailure *pFailure = pEnvelop->getTestFailure(); -+ std::string sNodeName = pEnvelop->getString(); -+ -+ // aFailedTests[ pFailure->failedTest() ] = true; -+ -+ printFailureLine(stream, pFailure, sNodeName); -+ } -+ -+ // only errors are from interest here -+ //# for (TestResultCollector::Tests::const_iterator it = m_aResulter.tests().begin(); -+ //# it != m_aResulter.tests().end(); -+ //# ++it) -+ //# { -+ //# TestEnvelope *pEnvelop = *it; -+ //# Test* pTest = pEnvelop->getTest(); -+ //# std::string sNodeName = pEnvelop->getString(); -+ //# -+ //# if (aFailedTests.find(pTest) == aFailedTests.end()) -+ //# { -+ //# std::string sInfo = m_aResulter.getInfo(pTest); -+ //# printTestLine(stream, pTest, sNodeName, sInfo); -+ //# } -+ //# } -+ stream << "Test #PASSED#" << Outputter::endl(); -+ } -+ -+ -+ void -+ emacsTestResult::printHeader( Outputter &stream ) -+ { -+ std::string sDate(m_aOptionHelper.createDateTag()); -+ stream << sDate << Outputter::endl(); -+ } -+ -+ void -+ emacsTestResult::printFailureLine( Outputter &stream, TestFailure *_pFailure, std::string const& _sNodeName) -+ { -+ std::string aName; -+ aName += _sNodeName; -+ aName += "."; -+ aName += _pFailure->failedTestName(); -+ -+ SourceLine aLine = _pFailure->sourceLine(); -+ sal_Int32 nLine = -1; -+ std::string sFilename; -+ if (aLine.isValid()) -+ { -+ nLine = aLine.lineNumber(); -+ sFilename = aLine.fileName(); -+ } -+ -+ Exception *pExp = _pFailure->thrownException(); -+ std::string sWhat; -+ if (pExp) -+ { -+ sWhat = pExp->what(); -+ } -+ -+ stream << sFilename; -+ stream << ":"; -+ stream << nLine; -+ stream << ":"; -+ -+ stream << aName; -+ stream << ";#FAILED#"; -+ // ErrorType::num eErr = _pFailure->getErrorType(); -+ //# if (isErr) -+ //# stream << "FAILED#;"; -+ //# else -+ //# stream << "ERROR#;"; -+ -+ stream << sWhat; -+ stream << Outputter::endl(); -+ } -+ -+ //# void -+ //# emacsTestResult::printTestLine( Outputter &stream, Test* _pTest, std::string const& _sNodeName, std::string const& _sInfo) -+ //# { -+ //# std::string aName; -+ //# aName += _sNodeName; -+ //# aName += "."; -+ //# aName += _pTest->getName(); -+ //# -+ //# stream << aName; -+ //# stream << ";"; -+ //# stream << _sInfo << "#"; -+ //# stream << "OK#"; -+ //# stream << std::endl; -+ //# } -+ -+ -+//# void -+//# emacsTestResult::printStatistics( Outputter &stream ) -+//# { -+//# stream << "Test Results:" << std::endl; -+//# -+//# stream << "Run: " << runTests() -+//# << " Failures: " << testFailures() -+//# << " Errors: " << testErrors() -+//# << std::endl; -+//# } -+ -+ -+ Outputter & -+ operator <<( Outputter &stream, -+ emacsTestResult &result ) -+ { -+ result.print (stream); return stream; -+ } -+ -+ -+} // namespace CppUnit -Nur in misc/build/cppunit-1.8.0/src/result: emacsTestResult.cxx.dummy. ---- misc/cppunit-1.8.0/src/result/log.cxx 2008-12-10 20:46:09.499346711 +0100 -+++ misc/build/cppunit-1.8.0/src/result/log.cxx 2008-12-10 20:42:45.000000000 +0100 -@@ -1 +1,125 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include "testshl/log.hxx" -+ -+// #include <hash_map> -+// #include <list> -+// #include <set> -+ -+using namespace std; -+ -+::osl::FileBase::RC Log::open( sal_Bool append ) { -+ -+ ::osl::FileBase::RC ret; -+ -+ if ( ! append ) { -+ ret = ::osl::File::remove( m_logurl ); -+ } -+ -+ if( m_logfile->open( OpenFlag_Write ) == ::osl::FileBase::E_NOENT ) { -+ ret = m_logfile->open( OpenFlag_Write | OpenFlag_Create ); -+ } -+ else { -+ ret = m_logfile->setPos( Pos_End, 0 ); -+ } -+ return ret; -+} -+ -+::osl::FileBase::RC Log::write( const sal_Char* buf, sal_Bool v ) { -+ sal_uInt64 uBytes=0; -+ sal_uInt32 len = 0; -+ const sal_Char* ptr = buf; -+ -+ if( ptr ) { -+ while( *ptr++ ) len++; -+ } -+ -+ if ( v ) { -+ // cout << buf << flush; -+ printf("%s", buf); -+ } -+ return m_logfile->write( buf, len , uBytes ); -+} -+ -+::osl::FileBase::RC Log::write( const rtl::OString& buf, sal_Bool v ) { -+ sal_uInt64 uBytes=0; -+ if ( v ) { -+ // cout << buf.getStr() << flush; -+ printf("%s", buf.getStr()); -+ } -+ return m_logfile->write( buf.getStr(), buf.getLength(), uBytes ); -+} -+/* -+// LLA: due to a problem with sal/OUStingBuffer getLength() which isn't const, this -+// is so not compilable. -+::osl::FileBase::RC Log::write( rtl::OStringBuffer const& buf, sal_Bool v ) { -+ sal_uInt64 uBytes=0; -+ if ( v ) { -+ cout << buf.getStr() << flush; -+ } -+ return m_logfile->write( buf.getStr(), buf.getLength(), uBytes ); -+} -+*/ -+::osl::FileBase::RC Log::write( const rtl::OUString& buf, -+ rtl_TextEncoding tenc, sal_Bool v ) { -+ sal_uInt64 uBytes=0; -+ if ( ! tenc ) { -+ tenc = RTL_TEXTENCODING_ASCII_US; -+ } -+ rtl::OStringBuffer osbuf( -+ rtl::OUStringToOString( buf, tenc ).getStr() ); -+ -+ if ( v ) { -+ // cout << osbuf.getStr() << flush; -+ printf("%s", osbuf.getStr()); -+ } -+ return m_logfile->write( osbuf.getStr(), osbuf.getLength(), uBytes ); -+} -+ -+Log &operator <<( Log &_aLog, const sal_Char * _sValue ) -+{ -+ _aLog.write(_sValue); return _aLog; -+} -+Log &operator <<( Log &_aLog, rtl::OString const& _sValue ) -+{ -+ _aLog.write(_sValue); return _aLog; -+} -+Log &operator <<( Log &_aLog, rtl::OUString const& _sValue ) -+{ -+ _aLog.write(_sValue); return _aLog; -+} -+//! Log &operator <<( Log &_aLog, rtl::OStringBuffer const& _sValue ) -+//! { -+//! _aLog.write(_sValue); return _aLog; -+//! } -Nur in misc/build/cppunit-1.8.0/src/result: log.cxx.dummy. ---- misc/cppunit-1.8.0/src/result/makefile.mk 2008-12-10 20:46:09.542019008 +0100 -+++ misc/build/cppunit-1.8.0/src/result/makefile.mk 2008-12-10 20:23:07.000000000 +0100 -@@ -1 +1,88 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile$ -+# -+# $Revision$ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+PRJ=..$/..$/..$/..$/..$/.. -+INCEXT=..$/..$/include -+# INCEXT=$(SOLARSRC)$/cppunit/$/$(INPATH)/$/misc$/build$/cppunit-1.8.0$/include -+# PRJ=..$/.. -+# PRJINC=..$/.. -+ -+ -+PRJNAME=cppunit -+TARGET=c5t_testresult -+LIBTARGET=NO -+ENABLE_EXCEPTIONS=TRUE -+# ENABLE_RTTI=TRUE -+ -+# --- Settings ----------------------------------------------------- -+ -+.INCLUDE : settings.mk -+ -+# --- Files -------------------------------------------------------- -+ -+# CXXFILES = \ -+# querytemplate.cxx \ -+# stringhelper.cxx -+ -+# ENVCFLAGSCXX+=-DCPPUNIT_BUILD_DLL -+SLOFILES = \ -+ $(SLO)$/SynchronizedObject.obj \ -+ $(SLO)$/TestResult.obj \ -+ $(SLO)$/TestResultCollector.obj \ -+ $(SLO)$/TestSucessListener.obj \ -+ $(SLO)$/emacsTestResult.obj \ -+ $(SLO)$/log.obj \ -+ $(SLO)$/optionhelper.obj \ -+ $(SLO)$/outputter.obj \ -+ $(SLO)$/signal.obj \ -+ $(SLO)$/testshlTestResult.obj \ -+ $(SLO)$/treswrapper.obj -+ -+# currently unused -+# $(SLO)$/TextTestResult.obj -+ -+LIB1TARGET= $(LB)$/$(TARGET).lib -+LIB1OBJFILES= $(SLOFILES) -+ -+.IF "$(GUI)"=="WNT" -+.IF "$(COM)"=="GCC" -+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -+.ENDIF -+.ENDIF -+ -+.IF "$(GUI)" == "UNX" -+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -+.ENDIF -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk -+ -Nur in misc/build/cppunit-1.8.0/src/result: makefile.mk.dummy. ---- misc/cppunit-1.8.0/src/result/optionhelper.cxx 2008-12-10 20:46:09.615952197 +0100 -+++ misc/build/cppunit-1.8.0/src/result/optionhelper.cxx 2008-12-09 09:06:14.000000000 +0100 -@@ -1 +1,317 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include "cppunit/result/optionhelper.hxx" -+// #include <sstream> -+// #include <string> -+#include <osl/time.h> -+#include "cppunit/cmdlinebits.hxx" -+ -+// ----------------------------------------------------------------------------- -+ -+namespace -+{ -+ void split( const rtl::OString& opt, -+ const rtl::OString& _sSeparator, -+ OStringList& optLine ) -+ { -+ optLine.clear(); -+ // const sal_Int32 cSetLen = cSet.getLength(); -+ sal_Int32 index = 0; -+ sal_Int32 oldIndex = 0; -+ -+ // sal_Int32 i; -+ // sal_Int32 j = 0; -+ while ( opt.getLength() > 0) -+ { -+ // for ( i = 0; i < cSetLen; i++ ) -+ // { -+ index = opt.indexOf( _sSeparator, oldIndex); -+ if( index != -1 ) -+ { -+ optLine.push_back( opt.copy( oldIndex, index - oldIndex ) ); -+ oldIndex = index + _sSeparator.getLength(); -+ } -+ // } -+ else // if (index == -1) -+ { -+ optLine.push_back( opt.copy( oldIndex ) ); -+ break; -+ } -+ } -+ } ///< split -+ -+ bool match(OStringList const& _aFilter, OStringList const& _aName) -+ { -+ OStringList::const_iterator aFilterIter = _aFilter.begin(); -+ OStringList::const_iterator aValueIter = _aName.begin(); -+ -+ bool bMatch = false; -+ -+ while (aFilterIter != _aFilter.end() && aValueIter != _aName.end()) -+ { -+ rtl::OString sFilter = *aFilterIter; -+ rtl::OString sName = *aValueIter; -+ -+ if (sFilter == sName) -+ { -+ bMatch = true; -+ ++aFilterIter; -+ ++aValueIter; -+ } -+ else if (sFilter == "*") -+ { -+ bMatch = true; -+ break; -+ } -+ else -+ { -+ // Filter does not match -+ bMatch = false; -+ break; -+ } -+ } -+ return bMatch; -+ } -+} -+ -+/* static */ -+std::string OptionHelper::integerToAscii(sal_Int32 nValue) -+{ -+ sal_Char cBuf[30]; -+ sal_Char *pBuf = cBuf; -+ sprintf(pBuf, "%d", static_cast<int>(nValue)); -+//# std::ostringstream sBuf; -+//# sBuf << nValue; -+// rtl::OString sStr; -+// sStr = rtl::OString::valueOf(nValue); -+ return std::string(pBuf); -+} -+ -+/* static */ -+// if a given String is less then 2 char, add a "0" in front. -+std::string OptionHelper::twoDigits(std::string const& _sValue) -+{ -+ std::string sBack; -+ if (_sValue.length() == 0) -+ { -+ sBack = "00"; -+ } -+ else if (_sValue.length() == 1) -+ { -+ sBack = "0"; -+ sBack += _sValue; -+ } -+ else -+ { -+ sBack = _sValue; -+ } -+ return sBack; -+} -+ -+ -+std::string OptionHelper::createDateTag(std::string const& _sProjectId, std::string const& _sBuildId) -+{ -+ TimeValue tmv_system; -+ TimeValue tmv_local; -+ oslDateTime dt; -+ osl_getSystemTime( &tmv_system ); -+ osl_getLocalTimeFromSystemTime(&tmv_system, &tmv_local); -+ osl_getDateTimeFromTimeValue( &tmv_local, &dt ); -+ -+ sal_Int32 nYear = dt.Year; -+ sal_Int32 nMonth = dt.Month; -+ sal_Int32 nDay = dt.Day; -+ -+ std::string sDate; -+ sDate = "# Current Time: "; -+ sDate += std::string(twoDigits(integerToAscii(dt.Hours))); -+ sDate += ":"; -+ sDate += std::string(twoDigits(integerToAscii(dt.Minutes))); -+ sDate += ":"; -+ sDate += std::string(twoDigits(integerToAscii(dt.Seconds))); -+ sDate += "\n"; -+ -+ sDate += "["; -+ -+ // sDate += rtl::OString::valueOf(nYear); -+ sDate.append(integerToAscii(nYear)); -+ sDate += "."; -+ if (nMonth < 10) -+ sDate += "0"; -+ // sDate += rtl::OString::valueOf(nMonth); -+ sDate.append(integerToAscii(nMonth)); -+ sDate += "."; -+ if (nDay < 10) -+ sDate += "0"; -+ // sDate += rtl::OString::valueOf(nDay); -+ sDate += std::string(integerToAscii(nDay)); -+ sDate += "/"; -+ sDate += _sProjectId; -+ sDate += "/"; -+ sDate += _sBuildId; -+ sDate += "]"; -+ -+ return sDate; -+} -+ -+//# rtl::OString createDateTag() -+//# { -+//# TimeValue tmv; -+//# oslDateTime dt; -+//# osl_getSystemTime( &tmv ); -+//# osl_getDateTimeFromTimeValue( &tmv, &dt ); -+//# -+//# sal_Int32 nYear = dt.Year; -+//# sal_Int32 nMonth = dt.Month; -+//# sal_Int32 nDay = dt.Day; -+//# -+//# rtl::OString sDate("["); -+//# sDate += rtl::OString::valueOf(nYear); -+//# sDate += "."; -+//# if (nMonth < 10) -+//# sDate += "0"; -+//# sDate += rtl::OString::valueOf(nMonth); -+//# sDate += "."; -+//# if (nDay < 10) -+//# sDate += "0"; -+//# sDate += rtl::OString::valueOf(nDay); -+//# sDate += "//]"; -+//# -+//# return sDate; -+//# } -+ -+std::string OptionHelper::createDateTag() -+{ -+ return createDateTag(m_sProjectId, m_sBuildId); -+} -+ -+bool OptionHelper::showErrors() -+{ -+ bool bRetValue = true; // default, show all -+ if (m_aOption.hasOpt("-noerrors")) -+ { -+ bRetValue = false; -+ } -+ return bRetValue; -+} -+ -+bool OptionHelper::showTests() -+{ -+ bool bRetValue = true; // default, show all -+ if (m_aOption.hasOpt("-onlyerrors")) -+ { -+ bRetValue = false; -+ } -+ return bRetValue; -+} -+ -+// Check which parameter is given for handle the jobs. -+// If no parameter is given, all jobs (tests) will run through -+void OptionHelper::handleJobs() -+{ -+ // load job file, the file contains the functions which we only want to test. -+ if (m_aOption.hasOpt("-jobexclude")) -+ { -+ rtl::OString sJobFile = m_aOption.getOpt("-jobexclude"); -+ m_aJobExcludeList.readfile(sJobFile.getStr(), JOB_EXCLUDE_LIST); -+ } -+ -+ if (m_aOption.hasOpt("-jobonly")) -+ { -+ rtl::OString sJobFile = m_aOption.getOpt("-jobonly"); -+ m_aJobOnlyList.readfile(sJobFile.getStr(), JOB_ONLY_LIST); -+ } -+ -+ // -+ if (m_aOption.hasOpt("-jobfilter")) -+ { -+ rtl::OString sJobFilter = m_aOption.getOpt("-jobfilter"); -+ split(sJobFilter, ".", m_aJobFilter); -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+// Here will be decide, if a job/test will execute or not. -+// therefore exist some lists, in which stay all jobs (positive list) or a list (negative list) which jobs should not execute -+// or if only specific jobs should execute by a given filter -+ -+bool OptionHelper::isAllowedToExecute(std::string const& _sNodeName, std::string const& _sName) -+{ -+ std::string sJobName = _sNodeName + "." + _sName; -+ // t_print(T_VERBOSE, "Jobname %s\n", sJobName.c_str()); -+ if (isOnlyShowJobs()) // true, if parameter -onlyshowjob -+ { -+ m_aJobOnlyList.setJobListEntry(sJobName, JOB_ACCESS); -+ return false; -+ } -+ -+ if (m_aJobOnlyList.size()) // >0 if parameter -jobonly -+ { -+ if (m_aJobOnlyList.getJobListEntry(sJobName) != JOB_NOT_FOUND) -+ { -+ // job entry found, mark as accessed -+ m_aJobOnlyList.setJobListEntry(sJobName, JOB_ACCESS); -+ return true; -+ } -+ return false; -+ } -+ else if (m_aJobFilter.size() > 0) // >0 if parameter -jobfilter -+ { -+ OStringList aSplitName; -+ split(sJobName.c_str(), ".", aSplitName); -+ if (! match(m_aJobFilter, aSplitName)) -+ { -+ t_print(T_VERBOSE, "job: '%s' filtered by [-jobfilter]\n", sJobName.c_str()); -+ return false; -+ } -+ } -+ else if (m_aJobExcludeList.size() > 0) // >0 if parameter -jobexclude -+ { -+ if (m_aJobExcludeList.getJobListEntry(sJobName) != JOB_NOT_FOUND) -+ { -+ // job entry found, this job should not executed, so return false -+ t_print(T_VERBOSE, "job: '%s' filtered by [-jobexclude]\n", sJobName.c_str()); -+ return false; -+ } -+ // m_aJobOnlyList.setJobListEntry(sJobName, JOB_ACCESS); -+ return true; -+ } -+ else -+ { -+ //! not handled yet -+ } -+ -+ return true; -+} -+ -Nur in misc/build/cppunit-1.8.0/src/result: optionhelper.cxx.dummy. ---- misc/cppunit-1.8.0/src/result/outputter.cxx 2008-12-10 20:46:09.657356434 +0100 -+++ misc/build/cppunit-1.8.0/src/result/outputter.cxx 2008-12-09 09:06:18.000000000 +0100 -@@ -1 +1,106 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+// -+#include <string> -+#include <sal/types.h> -+#include "cppunit/result/outputter.hxx" -+ -+// ----------------------------------------------------------------------------- -+ -+Outputter::~Outputter() -+{ -+ // delete m_pLog; -+} -+ -+void Outputter::writeToAll(const sal_Char* _sCharStr) -+{ -+ // std::cout << _sCharStr; -+ if (m_pStream) -+ { -+ *m_pStream << _sCharStr; -+ } -+ if (m_pLog.get()) -+ { -+ m_pLog->write(_sCharStr); -+ } -+} -+ -+void Outputter::write(const sal_Char* _sCharStr) -+{ -+ writeToAll(_sCharStr); -+} -+ -+void Outputter::write(std::string const& _sStr) -+{ -+ writeToAll(_sStr.c_str()); -+} -+ -+void Outputter::write(sal_Int32 _nValue) -+{ -+ sal_Char cBuf[20]; -+ sal_Char* pBuf = cBuf; -+ sprintf(pBuf, "%d", SAL_STATIC_CAST(int, _nValue)); -+ writeToAll(pBuf); -+} -+ -+// ----------------------------------------------------------------------------- -+ -+Outputter& operator <<( Outputter &_aStreamWrapper, const sal_Char* _sValue) -+{ -+ _aStreamWrapper.write(_sValue); -+ return _aStreamWrapper; -+} -+ -+Outputter& operator <<( Outputter &_aStreamWrapper, std::string const& _sValue) -+{ -+ _aStreamWrapper.write(_sValue); -+ return _aStreamWrapper; -+} -+ -+Outputter& operator <<( Outputter &_aStreamWrapper, sal_Int32 _nValue) -+{ -+ _aStreamWrapper.write(_nValue); -+ return _aStreamWrapper; -+} -+ -+//# Outputter& operator <<( Outputter &_aStreamWrapper, double ) -+//# { -+//# return _aStreamWrapper; -+//# } -+ -+Outputter& operator <<( Outputter &_aStreamWrapper, Outputter::endl const&) -+{ -+ _aStreamWrapper.write("\n"); -+ return _aStreamWrapper; -+} -Nur in misc/build/cppunit-1.8.0/src/result: outputter.cxx.dummy. ---- misc/cppunit-1.8.0/src/result/signal.cxx 2008-12-10 20:46:09.750401577 +0100 -+++ misc/build/cppunit-1.8.0/src/result/signal.cxx 2008-12-10 20:42:46.000000000 +0100 -@@ -1 +1,998 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#if (defined UNX) || (defined OS2) -+#include <signal.h> -+#include <errno.h> -+#endif -+ -+#include <fstream> -+#include <vector> -+#include <hash_map> -+ -+#include <rtl/tres.h> -+#include <rtl/string.hxx> -+ -+#include "testshl/autoregisterhelper.hxx" -+#include "testshl/getopt.hxx" -+#include "signal.hxx" -+#include <cppunit/tagvalues.hxx> -+#include <unistd.h> -+#include "testshl/filehelper.hxx" -+#include <cppunit/result/TestResult.h> -+#include "cppunit/signaltest.h" -+#include "cppunit/Exception.h" -+ -+#ifdef WNT -+#include "testshl/winstuff.hxx" -+#endif -+ -+// typedef std::vector<std::string> StringList; -+// StringList sCurrentNodeName; -+CppUnit::TestResult *pTestResult = NULL; -+std::string sSignalFile; -+ -+typedef std::hash_map< std::string, int > HashMap; -+HashMap m_aSignalHash; -+bool bSignalsCached = false; -+bool bDoNotTouchSignalFile = false; -+ -+// ----------------------------------------------------------------------------- -+ -+// return 'true' if signalfile doesn't exist. -+// else 'false' -+bool existsSignalFile(std::string const& _sSignalFilename) -+{ -+ FILE* pFile = fopen(_sSignalFilename.c_str(), "r"); -+ if (!pFile) -+ { -+ return false; -+ } -+ fprintf(stderr, "'%s' exists.\n", _sSignalFilename.c_str()); -+ fclose(pFile); -+ return true; -+} -+ -+// ----------------------------------------------------------------------------- -+void createEmptySignalFile(std::string const& _sSignalFilename) -+{ -+ FILE* pFile = fopen(_sSignalFilename.c_str(), "w"); -+ if (!pFile) -+ { -+ fprintf(stderr, "error: Could not create signal helper file %s for signal info.\n", _sSignalFilename.c_str()); -+ } -+ else -+ { -+ fprintf(pFile, "# This is an auto generated helper file for signal handling.\n"); -+ fprintf(pFile, "# An entry start by '#' is a comment.\n"); -+ fprintf(pFile, "# All other are test functions which have abort, before this line is removed.\n"); -+ fprintf(pFile, "# So you have to check this functions by hand.\n"); -+ -+ fclose(pFile); -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+/** get Current PID. -+*/ -+inline ::rtl::OUString getCurrentPID( ) -+{ -+ //~ Get current PID and turn it into OUString; -+ sal_uInt32 nPID = 0; -+#ifdef WNT -+ nPID = WinGetCurrentProcessId(); -+#else -+ nPID = getpid(); -+#endif -+ return ( ::rtl::OUString::valueOf( static_cast<long>(nPID ) ) ); -+} -+// ----------------------------------------------------------------------------- -+static std::string integerToAscii(sal_uInt32 nValue) -+{ -+ sal_Char cBuf[30]; -+ sal_Char *pBuf = cBuf; -+ sprintf(pBuf, "%d", static_cast<unsigned int>(nValue)); -+ return std::string(pBuf); -+} -+void my_sleep(int sec); -+ -+// ----------------------------------------------------------------------------- -+void setSignalFilename(GetOpt & opt) -+{ -+ if (opt.hasOpt("-dntsf") || opt.hasOpt("-donottouchsignalfile")) -+ { -+ // special feature, for debugging, so the signal file will not manipulate. -+ // but create, if no one exist. -+ bDoNotTouchSignalFile = true; -+ } -+ -+ if (opt.hasOpt("-sf") || opt.hasOpt("-signalfile")) -+ { -+ if (opt.hasOpt("-sf")) -+ { -+ sSignalFile = opt.getOpt("-sf"); -+ } -+ else if (opt.hasOpt("-signalfile")) -+ { -+ sSignalFile = opt.getOpt("-signalfile"); -+ } -+ } -+ else -+ { -+ std::string sPath; -+ // std::string sPath(FileHelper::getTempPath()); -+ std::string sFilename("signalfile"); -+ std::string sFilenameExt(".txt"); -+ bool bCanQuitLoop = true; -+ do -+ { -+ -+// #ifdef WNT -+// sPath += "\\"; -+// #endif -+// #ifdef UNX -+// sPath += "/"; -+// #endif -+ sPath = sFilename; -+ // BUG: i72675 -+ // add "_12345" where 12345 is the current process ID -+ -+ TimeValue aTimeValue; -+ osl_getSystemTime(&aTimeValue); -+ -+ sPath += "_"; -+ sPath += integerToAscii(aTimeValue.Seconds); -+ // rtl::OUString suPID = getCurrentPID(); -+ // rtl::OString sPID = rtl::OUStringToOString(suPID, RTL_TEXTENCODING_ASCII_US); -+ // sPath += sPID.getStr(); -+ sPath += sFilenameExt; -+ bCanQuitLoop = true; -+ if (existsSignalFile(sPath)) -+ { -+ // there is already a signal file, wait a second, choose an other one. -+ my_sleep(1); -+ bCanQuitLoop = false; -+ } -+ } -+ while (!(bCanQuitLoop)); -+ -+ sSignalFile = sPath; -+ fprintf(stderr, "Use default signal file name '%s'\n", sSignalFile.c_str()); -+ } -+ -+ if (opt.hasOpt("-dnrmsf")) -+ { -+ fprintf(stderr, "'Don't remove signal file' (-dnrmsf) is set.\n"); -+ } -+ else -+ { -+ if (bDoNotTouchSignalFile == true) -+ { -+ fprintf(stderr, "warning: 'Don't touch signal file' parameter (-dntsf) is set, will not remove existing signal file.\n"); -+ } -+ else -+ { -+ // remove signalfile -+ createEmptySignalFile(sSignalFile); -+ } -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+bool doNotTouchSignalFile() { return bDoNotTouchSignalFile; } -+ -+// ----------------------------------------------------------------------------- -+std::string buildTestFunctionName(std::string const& _sName) -+{ -+ std::string sName; -+ if (pTestResult) -+ { -+ sName = pTestResult->getNodeName(); -+ sName += "."; -+ } -+ -+/* -+ for (StringList::const_iterator it = sCurrentNodeName.begin(); -+ it != sCurrentNodeName.end(); -+ ++it) -+ { -+ sName += *it; -+ sName += "."; -+ } -+*/ -+ sName += _sName; -+ -+ return sName; -+} -+// ----------------------------------------------------------------------------- -+// old: void executionPushName(std::string const& _sName) -+// old: { -+// old: sCurrentNodeName.push_back(_sName); -+// old: } -+// old: void executionPopName() -+// old: { -+// old: sCurrentNodeName.pop_back(); -+// old: } -+// old: -+ -+// ----------------------------------------------------------------------------- -+// ------------------------------ Signal Handling ------------------------------ -+// ----------------------------------------------------------------------------- -+ -+// std::string sLastTestFunctionName; -+ -+std::string getSignalName(sal_Int32 nSignalNo); -+// ----------------------------------------------------------------------------- -+ -+std::string getSignalFilename() -+{ -+ return sSignalFile; -+} -+ -+// ----------------------------------------------------------------------------- -+// void storeNoSignal(std::string const& _sTestName) -+// { -+ // sLastTestFunctionName = buildTestFunctionName(_sTestName); -+ // std::ofstream out(getSignalFilename().c_str(), std::ios::out); -+ // out << NO_SIGNAL << std::endl; // no signal! -+// } -+ -+void markSignalAsAlreadyDone(sal_Int32 _nSignalNo) -+{ -+ // std::ofstream out(getSignalFilename().c_str(), std::ios::out | std::ios::app); -+ FILE *out = fopen(getSignalFilename().c_str(), "a"); -+ if (out != NULL) -+ { -+//# out << "# the previous test function creates signal: " -+//# << getSignalName(_nSignalNo) -+//# << " (" -+//# << _nSignalNo -+//# << ")" << std::endl; -+//# // out << sLastTestFunctionName << std::endl; // SIGNAL! -+ -+ fprintf(out, "# the previous test function creates signal: %s(%d)\n", getSignalName(_nSignalNo).c_str(), SAL_STATIC_CAST(int, _nSignalNo)); -+ // fprintf(out, "%s\n", sLastTestFunctionName ); -+ fclose(out); -+ } -+ else -+ { -+ fprintf(stderr, "error: Can't write signal info to file %s \n", getSignalFilename().c_str()); -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+ -+Signal hasSignaled(std::string const& _sTestName) -+{ -+ // BACK: true: signal -+ // false: nothing -+ -+ if (bSignalsCached == true) -+ { -+ -+ if (m_aSignalHash.find(buildTestFunctionName(_sTestName)) != m_aSignalHash.end()) -+ { -+ return HAS_SIGNAL; -+ } -+ return NO_SIGNAL; -+ } -+ -+ std::ifstream in(getSignalFilename().c_str(), std::ios::in); -+ -+ // std::cout << "Check for signal" << std::endl; -+ std::string sLine, sLastLine; -+ while (std::getline(in, sLine)) -+ { -+ // std::cout << sTest << std::endl; -+ char ch = sLine[0]; -+ if (isspace(ch) == 0 && -+ sLine.size() > 0) -+ { -+ if (ch == '#') -+ { -+ if (sLastLine.size() > 0) -+ { -+ rtl::OString aStrLine(sLine.c_str()); -+ sal_Int32 nIdx = aStrLine.indexOf("(") + 1; -+ sal_Int32 nIdx2 = aStrLine.indexOf(")"); -+ sal_Int32 nSignalNo = 0; -+ if (nIdx > 0 && nIdx2 > 0) -+ { -+ rtl::OString sSignalNo = aStrLine.copy(nIdx, nIdx2 - nIdx); -+ nSignalNo = sSignalNo.toInt32(); -+ m_aSignalHash[sLastLine] = nSignalNo; -+ } -+ sLastLine.clear(); -+ } -+ } -+ else -+ { -+ // if (sTest == buildTestFunctionName(_sTestName)) -+ m_aSignalHash[sLine] = 1; -+ sLastLine = sLine; -+ // return HAS_SIGNAL; -+ } -+ } -+ } -+ -+ bSignalsCached = true; -+ return hasSignaled(_sTestName); -+ // return NO_SIGNAL; -+} -+ -+#ifdef UNX -+ -+// ----------------------------------------------------------------------------- -+ -+void release_signal_Handling(); -+ -+//# void signalFunction(int value) -+//# { -+//# std::cout << "Signal caught: (" << value << "), please restart." << std::endl; -+//# markSignalAsAlreadyDone(); -+//# -+//# release_signal_Handling(); -+//# std::cout.flush(); -+//# abort(); -+//# } -+ -+// ----------------------------------------------------------------------------- -+extern "C" void SignalHandlerFunction(int _nSignalNo, siginfo_t *, void*) -+{ -+ // std::cout << "Signal caught: " << getSignalName(_nSignalNo) << " (" << _nSignalNo << "), please restart." << std::endl; -+ fprintf(stderr, "Signal caught %s(%d)\n", getSignalName(_nSignalNo).c_str(), _nSignalNo); -+ markSignalAsAlreadyDone(_nSignalNo); -+ -+ release_signal_Handling(); -+ // std::cout.flush(); -+ abort(); -+} -+ -+// ----------------------------------------------------------------------------- -+// This is a copy of the osl/signal.c code -+#define ACT_IGNORE 1 -+#define ACT_ABORT 2 -+#define ACT_EXIT 3 -+#define ACT_SYSTEM 4 -+#define ACT_HIDE 5 -+ -+extern "C" { -+static struct SignalAction -+{ -+ int Signal; -+ int Action; -+ void (*Handler)(int); -+} Signals[] = -+{ -+ { SIGHUP, ACT_IGNORE, NULL }, /* hangup */ -+ { SIGINT, ACT_EXIT, NULL }, /* interrupt (rubout) */ -+ { SIGQUIT, ACT_ABORT, NULL }, /* quit (ASCII FS) */ -+ { SIGILL, ACT_SYSTEM, NULL }, /* illegal instruction (not reset when caught) */ -+/* changed from ACT_ABOUT to ACT_SYSTEM to try and get collector to run*/ -+ { SIGTRAP, ACT_ABORT, NULL }, /* trace trap (not reset when caught) */ -+#if ( SIGIOT != SIGABRT ) -+ { SIGIOT, ACT_ABORT, NULL }, /* IOT instruction */ -+#endif -+// { SIGABRT, ACT_ABORT, NULL }, /* used by abort, replace SIGIOT in the future */ -+#ifdef SIGEMT -+ { SIGEMT, ACT_SYSTEM, NULL }, /* EMT instruction */ -+/* changed from ACT_ABORT to ACT_SYSTEM to remove handler*/ -+/* SIGEMT may also be used by the profiler - so it is probably not a good -+ plan to have the new handler use this signal*/ -+#endif -+ { SIGFPE, ACT_ABORT, NULL }, /* floating point exception */ -+ { SIGKILL, ACT_SYSTEM, NULL }, /* kill (cannot be caught or ignored) */ -+ { SIGBUS, ACT_ABORT, NULL }, /* bus error */ -+ { SIGSEGV, ACT_ABORT, NULL }, /* segmentation violation */ -+#ifdef SIGSYS -+ { SIGSYS, ACT_ABORT, NULL }, /* bad argument to system call */ -+#endif -+ { SIGPIPE, ACT_HIDE, NULL }, /* write on a pipe with no one to read it */ -+ { SIGALRM, ACT_EXIT, NULL }, /* alarm clock */ -+ { SIGTERM, ACT_EXIT, NULL }, /* software termination signal from kill */ -+ { SIGUSR1, ACT_SYSTEM, NULL }, /* user defined signal 1 */ -+ { SIGUSR2, ACT_SYSTEM, NULL }, /* user defined signal 2 */ -+ { SIGCHLD, ACT_SYSTEM, NULL }, /* child status change */ -+#ifdef SIGPWR -+ { SIGPWR, ACT_IGNORE, NULL }, /* power-fail restart */ -+#endif -+ { SIGWINCH, ACT_IGNORE, NULL }, /* window size change */ -+ { SIGURG, ACT_EXIT, NULL }, /* urgent socket condition */ -+#ifdef SIGPOLL -+ { SIGPOLL, ACT_EXIT, NULL }, /* pollable event occured */ -+#endif -+ { SIGSTOP, ACT_SYSTEM, NULL }, /* stop (cannot be caught or ignored) */ -+ { SIGTSTP, ACT_SYSTEM, NULL }, /* user stop requested from tty */ -+ { SIGCONT, ACT_SYSTEM, NULL }, /* stopped process has been continued */ -+ { SIGTTIN, ACT_SYSTEM, NULL }, /* background tty read attempted */ -+ { SIGTTOU, ACT_SYSTEM, NULL }, /* background tty write attempted */ -+ { SIGVTALRM, ACT_EXIT, NULL }, /* virtual timer expired */ -+ { SIGPROF, ACT_SYSTEM, NULL }, /* profiling timer expired */ -+/*Change from ACT_EXIT to ACT_SYSTEM for SIGPROF is so that profiling signals do -+ not get taken by the new handler - the new handler does not pass on context -+ information which causes 'collect' to crash. This is a way of avoiding -+ what looks like a bug in the new handler*/ -+ { SIGXCPU, ACT_ABORT, NULL }, /* exceeded cpu limit */ -+ { SIGXFSZ, ACT_ABORT, NULL } /* exceeded file size limit */ -+}; -+} -+ -+const int NoSignals = sizeof(Signals) / sizeof(struct SignalAction); -+ -+#endif /* UNX */ -+ -+// ----------------------------------------------------------------------------- -+void init_signal_Handling(CppUnit::TestResult *_pResult) -+{ -+ pTestResult = _pResult; -+#ifdef UNX -+ -+// signal(SIGSEGV, signalFunction); -+ // signal(SIGSEGV, signalFunction); -+ // signal(SIGFPE, signalFunction); -+ -+// signal(1, signalFunction); -+ // struct sigaction action, oldaction; -+ // action.sa_sigaction = signalFunction2; -+ // action.sa_flags = SA_ONESHOT /* | SA_SIGINFO */; -+ -+ struct sigaction act; -+ struct sigaction oact; -+ -+ // act.sa_handler = SignalHandlerFunction; -+ act.sa_flags = SA_RESTART; -+ // act.sa_flags = SA_ONESHOT /* | SA_SIGINFO */; -+ act.sa_sigaction = SignalHandlerFunction; -+ -+ sigfillset(&(act.sa_mask)); -+ -+ /* Initialize the rest of the signals */ -+ for (int i = 0; i < NoSignals; i++) -+ { -+ if (Signals[i].Action != ACT_SYSTEM) -+ { -+ if (Signals[i].Action == ACT_HIDE) -+ { -+ struct sigaction ign; -+ -+ ign.sa_handler = SIG_IGN; -+ ign.sa_flags = 0; -+ sigemptyset(&ign.sa_mask); -+ -+ if (sigaction(Signals[i].Signal, &ign, &oact) == 0) -+ Signals[i].Handler = oact.sa_handler; -+ else -+ Signals[i].Handler = SIG_DFL; -+ } -+ else -+ if (sigaction(Signals[i].Signal, &act, &oact) == 0) -+ Signals[i].Handler = oact.sa_handler; -+ else -+ Signals[i].Handler = SIG_DFL; -+ } -+ } -+#endif -+ -+ // ------------ signal helper file must exist ----------------- -+ FILE* pFile = fopen(getSignalFilename().c_str(), "r"); -+ if (!pFile) -+ { -+ createEmptySignalFile( getSignalFilename() ); -+ } -+ else -+ { -+ fclose(pFile); -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+void release_signal_Handling() -+{ -+ // frees all signals -+#ifdef UNX -+ int i; -+ struct sigaction act; -+ -+ act.sa_flags = 0; -+ sigemptyset(&(act.sa_mask)); -+ -+ /* Initialize the rest of the signals */ -+ for (i = NoSignals - 1; i >= 0; i--) -+ { -+ if (Signals[i].Action != ACT_SYSTEM) -+ { -+ act.sa_handler = Signals[i].Handler; -+ -+ sigaction(Signals[i].Signal, &act, NULL); -+ } -+ } -+#endif -+} -+ -+// ----------------------------------------------------------------------------- -+Signal signalCheck(CppUnit::TestResult* _pResult, std::string const& _sTestName) -+{ -+ // BACK: HAS_SIGNAL: the test has already done and signaled -+ if (hasSignaled(_sTestName) == HAS_SIGNAL) -+ { -+ // std::cout << "The Test '" << buildTestFunctionName(_sTestName) << "' is marked as signaled." << std::endl; -+ std::string sTestFunctionName = buildTestFunctionName(_sTestName); -+ fprintf(stderr, "The Test '%s' is marked as signaled.\n", sTestFunctionName.c_str()); -+ if (_pResult) -+ { -+ CppUnit::SignalTest *pTest = new CppUnit::SignalTest(_sTestName); -+ -+ std::string sErrorText = "Function is marked as signaled: "; -+ sal_Int32 nSignalNo = m_aSignalHash[sTestFunctionName]; -+ sErrorText += getSignalName(nSignalNo); -+ sErrorText += " ("; -+ sErrorText += OptionHelper::integerToAscii(nSignalNo); -+ sErrorText += ")"; -+ -+ _pResult->addError(pTest, new CppUnit::SignalException(sErrorText), ErrorType::ET_SIGNAL); -+ } -+ return HAS_SIGNAL; -+ } -+ -+ // storeNoSignal(_sTestName); -+ return NO_SIGNAL; -+} -+ -+// ----------------------------------------------------------------------------- -+bool copyFile(std::string const& _sFrom, std::string const& _sTo) -+{ -+ bool bRetValue = false; -+ const int MAXBUFSIZE = 1024; -+ char buff[MAXBUFSIZE]; -+ FILE *in = fopen(_sFrom.c_str(), "r"); -+ if (in == NULL) -+ { -+ fprintf(stderr, "error: Can't open file %s for read to copy.\n", _sFrom.c_str()); -+ bRetValue = false; -+ } -+ else -+ { -+ FILE *out = fopen(_sTo.c_str(), "w"); -+ if (out == NULL) -+ { -+ fclose(in); -+ fprintf(stderr, "error: Can't open file %s for write to copy.\n", _sTo.c_str()); -+ bRetValue = false; -+ } -+ else -+ { -+ int nRealGot = 0; -+ while(!feof(in)) -+ { -+ nRealGot = fread(buff, sizeof(char), MAXBUFSIZE, in); -+ if (nRealGot > 0) -+ { -+ fwrite(buff, sizeof(char), nRealGot, out); -+ } -+ } -+ bRetValue = true; -+ fclose(out); -+ fclose(in); -+ } -+ } -+ return bRetValue; -+} -+ -+// ----------------------------------------------------------------------------- -+void signalStartTest(std::string const& _sName) -+{ -+ if (doNotTouchSignalFile()) return; -+ -+ // fprintf(stderr, "### signalStartTest!\n"); -+ // due to the fact, that functions are vicious, we write the name first. -+ // if it isn't vivious, than we removed it. -+ std::string sNewName = getSignalFilename(); -+ sNewName += ".bak"; -+ if (copyFile(getSignalFilename(), sNewName)) -+ { -+ // std::ofstream out(getSignalFilename().c_str(), std::ios::out | std::ios::app); -+ FILE *out = fopen(getSignalFilename().c_str(), "a"); -+ if (out != NULL) -+ { -+ // out << buildTestFunctionName(_sName) << std::endl; -+ fprintf(out, "%s\n", buildTestFunctionName(_sName).c_str()); -+ fclose(out); -+ } -+ else -+ { -+ fprintf(stderr, "error: Can't open file %s for append.\n", getSignalFilename().c_str()); -+ } -+ } -+ else -+ { -+ fprintf(stderr, "error: Can't copy signal helper from file %s to file %s, %d\n", getSignalFilename().c_str(), sNewName.c_str(), errno); -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+void signalEndTest() -+{ -+ if (doNotTouchSignalFile()) return; -+ -+ // fprintf(stderr, "### signalEndTest!\n"); -+ if (0 != remove(getSignalFilename().c_str())) -+ { -+ fprintf(stderr, "error: Can't delete file %s\n", getSignalFilename().c_str()); -+ } -+ else -+ { -+ std::string sNewName = getSignalFilename(); -+ sNewName += ".bak"; -+ if (0 != rename(sNewName.c_str(), getSignalFilename().c_str())) -+ { -+ fprintf(stderr, "error: Can't rename file %s to file %s errno: %d\n", sNewName.c_str(), getSignalFilename().c_str(), errno); -+ } -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+void removeSignalFile(GetOpt & opt) -+{ -+ // fprintf(stderr, "### remove signal file: '%s'\n", sSignalFile.c_str()); -+ if (opt.hasOpt("-dnrmsf")) -+ { -+ return; -+ } -+ if (bDoNotTouchSignalFile == true) -+ { -+ return; -+ } -+ remove(getSignalFilename().c_str()); -+} -+ -+// ----------------------------------------------------------------------------- -+ -+sal_Int32 SignalHandlerA( TagHelper const& _aTagItems ) -+{ -+ sal_Int32 nRetValue = 0; -+ TagData nTagType = _aTagItems.GetTagData(TAG_TYPE, 0); -+// LLA: unused -+// hTestResult hResult = (hTestResult) _aTagItems.GetTagData(TAG_RESULT_PTR, 0 /* NULL */ ); -+// CppUnit::TestResult* pResult = (CppUnit::TestResult*)hResult; -+ -+ try -+ { -+ switch(nTagType) -+ { -+ // old: case SIGNAL_PUSH_NAME: -+ // old: { -+ // old: const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME); -+ // old: if (sName != NULL) -+ // old: signalPushName(sName); -+ // old: break; -+ // old: } -+ // old: -+ // old: case SIGNAL_POP_NAME: -+ // old: signalPopName(); -+ // old: break; -+ -+ // old: case SIGNAL_CHECK: -+ // old: { -+ // old: const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME); -+ // old: if (sName != NULL) -+ // old: { -+ // old: nRetValue = signalCheck(sName); -+ // old: } -+ // old: break; -+ // old: } -+ -+ // old: case INIT_SIGNAL_HANDLING: -+ // old: init_signal_Handling(); -+ // old: break; -+ // old: -+ // old: case RELEASE_SIGNAL_HANDLING: -+ // old: release_signal_Handling(); -+ // old: break; -+ -+ case SIGNAL_START_TEST: -+ { -+ // fprintf(stderr, "### SIGNAL_START_TEST!\n"); -+ const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME); -+ if (sName != NULL) -+ { -+ signalStartTest(sName); -+ } -+ break; -+ } -+ -+ case SIGNAL_END_TEST: -+ { -+ // fprintf(stderr, "### SIGNAL_END_TEST!\n"); -+ const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME); -+ if (sName != NULL) -+ { -+ signalEndTest(); -+ } -+ break; -+ } -+ -+ default: -+ fprintf(stderr, "error: SignalHandlerA: Can't handle the tag type %d\n", SAL_STATIC_CAST(int, nTagType)); -+ fflush(stderr); -+ // throw std::exception(/*std::string("Unknown TYPE_TAG Exception.")*/); -+ } -+ } -+ catch (std::exception &e) -+ { -+ fprintf(stderr, "error: SignalHandlerA: Exception caught: %s\n", e.what()); -+ fflush(stderr); -+ // throw e; -+ } -+ -+ return nRetValue; -+} -+// ----------------------------------------------------------------------------- -+// This a little bit more abstract code, could be easier to modify or expand. -+ -+sal_Int32 CheckExecution(CppUnit::TestResult* _pResult, std::string const& _sName) -+{ -+ // more checks in the corresponding job lists -+ if (_pResult) -+ { -+ if (! _pResult->isAllowedToExecute(_sName)) -+ { -+ return DO_NOT_EXECUTE; -+ } -+ } -+ -+ // Check if the given test should be executed. -+ if (signalCheck(_pResult, _sName) == HAS_SIGNAL) -+ { -+ return DO_NOT_EXECUTE; -+ } -+ -+ return GO_EXECUTE; -+} -+ -+// ----------------------------------------------------------------------------- -+sal_Int32 ExecutionA( TagHelper const& _aTagItems ) -+{ -+ sal_Int32 nRetValue = 0; -+ TagData nTagType = _aTagItems.GetTagData(TAG_TYPE, 0); -+ hTestResult hResult = (hTestResult) _aTagItems.GetTagData(TAG_RESULT_PTR, 0 /* NULL */ ); -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)hResult; -+ -+ try -+ { -+ switch(nTagType) -+ { -+ case EXECUTION_CHECK: -+ { -+ const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME); -+ if (sName) -+ { -+ nRetValue = CheckExecution(pResult, sName); -+ if (nRetValue == GO_EXECUTE) -+ { -+ if (pResult && pResult->isOptionWhereAmI()) -+ { -+ printf("# This is: %s\n", buildTestFunctionName(sName).c_str()); -+ } -+ } -+ } -+ -+ break; -+ } -+ -+ // old: case EXECUTION_PUSH_NAME: -+ // old: { -+ // old: const char* sName = (const char*) _aTagItems.GetTagData(TAG_NODENAME); -+ // old: if (sName != NULL) -+ // old: executionPushName(sName); -+ // old: break; -+ // old: } -+ // old: -+ // old: case EXECUTION_POP_NAME: -+ // old: executionPopName(); -+ // old: break; -+ -+ case INIT_TEST: -+ init_signal_Handling(pResult); -+ break; -+ -+ case RELEASE_TEST: -+ release_signal_Handling(); -+ break; -+ -+ default: -+ fprintf(stderr, "ExceptionA: Can't handle the tag type %d\n", SAL_STATIC_CAST(int, nTagType)); -+ break; -+ } -+ } -+ catch (std::exception &e) -+ { -+ fprintf(stderr, "ExecutionA: exception caught: %s\n", e.what()); -+ fflush(stderr); -+ // throw e; -+ } -+ return nRetValue; -+} -+ -+// ----------------------------------------------------------------------------- -+std::string getSignalName(sal_Int32 nSignalNo) -+{ -+ std::string sValue; -+#ifdef UNX -+ switch(nSignalNo) -+ { -+ case SIGHUP: -+ sValue = "SIGHUP"; -+ break; -+ -+ case SIGINT: -+ sValue = "SIGINT"; -+ break; -+ -+ case SIGQUIT: -+ sValue = "SIGQUIT"; -+ break; -+ -+ case SIGILL: -+ sValue = "SIGILL"; -+ break; -+ -+ case SIGTRAP: -+ sValue = "SIGTRAP"; -+ break; -+ -+#if ( SIGIOT != SIGABRT ) -+ case SIGIOT: -+ sValue = "SIGIOT"; -+ break; -+#endif -+// case SIGABRT: -+#ifdef SIGEMT -+ case SIGEMT: -+ sValue = "SIGEMT"; -+ break; -+#endif -+ case SIGFPE: -+ sValue = "SIGFPE"; -+ break; -+ -+ case SIGKILL: -+ sValue = "SIGKILL"; -+ break; -+ -+ case SIGBUS: -+ sValue = "SIGBUS"; -+ break; -+ -+ case SIGSEGV: -+ sValue = "SIGSEGV"; -+ break; -+ -+#ifdef SIGSYS -+ case SIGSYS: -+ sValue = "SIGSYS"; -+ break; -+#endif -+ case SIGPIPE: -+ sValue = "SIGPIPE"; -+ break; -+ -+ case SIGALRM: -+ sValue = "SIGALRM"; -+ break; -+ -+ case SIGTERM: -+ sValue = "SIGTERM"; -+ break; -+ -+ case SIGUSR1: -+ sValue = "SIGUSR1"; -+ break; -+ -+ case SIGUSR2: -+ sValue = "SIGUSR2"; -+ break; -+ -+ case SIGCHLD: -+ sValue = "SIGCHLD"; -+ break; -+ -+#ifdef SIGPWR -+ case SIGPWR: -+ sValue = "SIGPWR"; -+ break; -+#endif -+ case SIGWINCH: -+ sValue = "SIGWINCH"; -+ break; -+ -+ case SIGURG: -+ sValue = "SIGURG"; -+ break; -+ -+#ifdef SIGPOLL -+ case SIGPOLL: -+ sValue = "SIGPOLL"; -+ break; -+#endif -+ case SIGSTOP: -+ sValue = "SIGSTOP"; -+ break; -+ -+ case SIGTSTP: -+ sValue = "SIGTSTP"; -+ break; -+ -+ case SIGCONT: -+ sValue = "SIGCONT"; -+ break; -+ -+ case SIGTTIN: -+ sValue = "SIGTTIN"; -+ break; -+ -+ case SIGTTOU: -+ sValue = "SIGTTOU"; -+ break; -+ -+ case SIGVTALRM: -+ sValue = "SIGVTALRM"; -+ break; -+ -+ case SIGPROF: -+ sValue = "SIGPROF"; -+ break; -+ -+ case SIGXCPU: -+ sValue = "SIGXCPU"; -+ break; -+ -+ case SIGXFSZ: -+ sValue = "SIGXFSZ"; -+ break; -+ -+ default: -+ sValue = "Unhandled Signal."; -+ } -+#else -+ (void) nSignalNo; // unused -+#endif -+ return sValue; -+} -+ -+// The following sets variables for GNU EMACS -+// Local Variables: -+// tab-width:4 -+// End: -Nur in misc/build/cppunit-1.8.0/src/result: signal.cxx.dummy. ---- misc/cppunit-1.8.0/src/result/signal.hxx 2008-12-10 20:46:09.813916116 +0100 -+++ misc/build/cppunit-1.8.0/src/result/signal.hxx 2008-07-07 08:14:56.000000000 +0200 -@@ -1 +1,42 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+#ifndef SIGNAL_HXX -+#define SIGNAL_HXX -+ -+#include <sal/types.h> -+ -+#define HAS_SIGNAL 1 -+#define NO_SIGNAL 0 -+ -+typedef sal_Int32 Signal; -+ -+#endif -+ -Nur in misc/build/cppunit-1.8.0/src/result: signal.hxx.dummy. ---- misc/cppunit-1.8.0/src/result/testshlTestResult.cxx 2008-12-10 20:46:09.880238139 +0100 -+++ misc/build/cppunit-1.8.0/src/result/testshlTestResult.cxx 2008-12-09 09:06:11.000000000 +0100 -@@ -1 +1,428 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <stdlib.h> -+ -+#include <map> -+#include <cppunit/Exception.h> -+#include <cppunit/NotEqualException.h> -+#include <cppunit/Test.h> -+#include <cppunit/TestFailure.h> -+#include <cppunit/result/testshlTestResult.h> -+// #include <TextTestResult.h> -+//!io #include <iostream> -+#include <string> -+ -+#include <rtl/string.hxx> -+#include "cppunit/result/outputter.hxx" -+ -+namespace CppUnit { -+ -+ testshlTestResult::testshlTestResult(GetOpt & _aOptions) -+ :TestResult(_aOptions), -+ m_aOptions(_aOptions), -+ // m_aOptionHelper(_aOptions), -+ m_aResulter(this) -+ { -+ addListener( &m_aResulter ); -+ } -+ -+ testshlTestResult::~testshlTestResult() -+ { -+ } -+ -+//# void -+//# testshlTestResult::addFailure( const TestFailure &failure ) -+//# { -+//# // TestResultCollector::addFailure( failure ); -+//# // std::cerr << ( failure.isError() ? "E" : "F" ); -+//# m_aResulter.addFailure(failure); -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::startTest( Test *test ) -+//# { -+//# // TestResultCollector::startTest (test); -+//# m_aResulter.startTest(test); -+//# // std::cerr << "."; -+//# } -+//# -+//# void testshlTestResult::endTest( Test *test ) -+//# { -+//# } -+ -+// ----------------------------------------------------------------------------- -+ -+//# void -+//# testshlTestResult::printFailures( Outputter &stream ) -+//# { -+//# TestFailures::const_iterator itFailure = failures().begin(); -+//# int failureNumber = 1; -+//# while ( itFailure != failures().end() ) -+//# { -+//# stream << std::endl; -+//# printFailure( *itFailure++, failureNumber++, stream ); -+//# } -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::printFailure( TestFailure *failure, -+//# int failureNumber, -+//# std::ostream &stream ) -+//# { -+//# printFailureListMark( failureNumber, stream ); -+//# stream << ' '; -+//# printFailureTestName( failure, stream ); -+//# stream << ' '; -+//# printFailureType( failure, stream ); -+//# stream << ' '; -+//# printFailureLocation( failure->sourceLine(), stream ); -+//# stream << std::endl; -+//# printFailureDetail( failure->thrownException(), stream ); -+//# stream << std::endl; -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::printFailureListMark( int failureNumber, -+//# std::ostream &stream ) -+//# { -+//# stream << failureNumber << ")"; -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::printFailureTestName( TestFailure *failure, -+//# std::ostream &stream ) -+//# { -+//# Test* pTest = failure->failedTest(); -+//# stream << "test: " << pTest->getName(); -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::printFailureType( TestFailure *failure, -+//# std::ostream &stream ) -+//# { -+//# stream << "(" -+//# << (failure->isError() ? "E" : "F") -+//# << ")"; -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::printFailureLocation( SourceLine sourceLine, -+//# std::ostream &stream ) -+//# { -+//# if ( !sourceLine.isValid() ) -+//# return; -+//# -+//# stream << "line: " << sourceLine.lineNumber() -+//# << ' ' << sourceLine.fileName(); -+//# } -+//# -+//# -+//# void -+//# testshlTestResult::printFailureDetail( Exception *thrownException, -+//# std::ostream &stream ) -+//# { -+//# if ( thrownException->isInstanceOf( NotEqualException::type() ) ) -+//# { -+//# NotEqualException *e = (NotEqualException*)thrownException; -+//# stream << "expected: " << e->expectedValue() << std::endl -+//# << "but was: " << e->actualValue(); -+//# if ( !e->additionalMessage().empty() ) -+//# { -+//# stream << std::endl; -+//# stream << "additional message:" << std::endl -+//# << e->additionalMessage(); -+//# } -+//# } -+//# else -+//# { -+//# stream << " \"" << thrownException->what() << "\""; -+//# } -+//# } -+ -+ -+// LLA: output format: -+// Header -+// # -- BEGIN -+// Error lines -+// No error lines -+// unknown lines -+// # -- END -+// Text 'Test #PASSED#' or 'Errors only' -+ -+void -+testshlTestResult::print( Outputter& stream ) -+{ -+ printHeader( stream ); -+ // stream << std::endl; -+ // printFailures( stream ); -+ -+ bool bPassed = false; -+ if (isOnlyShowJobs()) -+ { -+ JobList jl(m_aOptionHelper.getJobOnlyList()); -+ HashMap aJobList = jl.getHashMap(); -+ printLines(stream, aJobList); -+ } -+ else -+ { -+ stream << "# -- BEGIN:" << Outputter::endl(); -+ -+ TestPtrList aFailedTests; -+ -+ // List of failures -+ printFailedTests(stream, aFailedTests); -+ -+ if (! m_aOptionHelper.getOptions().hasOpt("-onlyerrors")) -+ { -+ // List of well done tests -+ printTestLines(stream, aFailedTests); -+ -+ // List of unknown Tests -+ JobList jl(m_aOptionHelper.getJobOnlyList()); -+ HashMap aJobList = jl.getHashMap(); -+ printUnknownLines(stream, aJobList); -+ -+ bPassed = true; -+ } -+ stream << "# -- END:" << Outputter::endl(); -+ -+ if (bPassed) -+ { -+ stream << "Test #PASSED#" << Outputter::endl(); -+ } -+ -+ if (m_aOptionHelper.getOptions().hasOpt("-onlyerrors")) -+ { -+ stream << "Errors only." << Outputter::endl(); -+ } -+ } -+} -+ -+// ----------------------------------------------------------------------------- -+void -+testshlTestResult::printLines(Outputter &stream, HashMap & _aJobList) -+{ -+ int nCount = _aJobList.size(); -+ if (nCount != 0) -+ { -+ for (HashMap::const_iterator it = _aJobList.begin(); -+ it != _aJobList.end(); -+ ++it) -+ { -+ std::string aKey = (*it).first; -+ if (_aJobList[aKey] == JOB_ACCESS) -+ { -+ stream << aKey; -+ stream << Outputter::endl(); -+ } -+ } -+ } -+} -+ -+void -+testshlTestResult::printFailedTests(Outputter &stream, TestPtrList &aFailedTests) -+{ -+ for (TestResultCollector::TestFailures::const_iterator it2 = m_aResulter.failures().begin(); -+ it2 != m_aResulter.failures().end(); -+ ++it2) -+ { -+ TestFailureEnvelope *pEnvelop = *it2; -+ TestFailure *pFailure = pEnvelop->getTestFailure(); -+ std::string sNodeName = pEnvelop->getString(); -+ -+ aFailedTests[ pFailure->failedTest() ] = true; -+ -+ printFailureLine(stream, pFailure, sNodeName); -+ } -+} -+ -+void -+testshlTestResult::printTestLines(Outputter &stream, TestPtrList &aFailedTests) -+{ -+ for (TestResultCollector::Tests::const_iterator it = m_aResulter.tests().begin(); -+ it != m_aResulter.tests().end(); -+ ++it) -+ { -+ TestEnvelope *pEnvelop = *it; -+ Test* pTest = pEnvelop->getTest(); -+ std::string sNodeName = pEnvelop->getString(); -+ -+ if (aFailedTests.find(pTest) == aFailedTests.end()) -+ { -+ std::string sInfo = m_aResulter.getInfo(pTest); -+ printTestLine(stream, pTest, sNodeName, sInfo); -+ } -+ } -+} -+ -+void -+testshlTestResult::printUnknownLines(Outputter &stream, HashMap & _aJobList) -+{ -+ int nCount = _aJobList.size(); -+ if (nCount != 0) -+ { -+ for (HashMap::const_iterator it = _aJobList.begin(); -+ it != _aJobList.end(); -+ ++it) -+ { -+ std::string aKey = (*it).first; -+ if (_aJobList[aKey] == JOB_UNKNOWN) -+ { -+ printUnknownLine(stream, aKey); -+ } -+ } -+ } -+} -+ -+void -+testshlTestResult::printHeader( Outputter &stream ) -+{ -+ std::string sDate(m_aOptionHelper.createDateTag()); -+ if (isOnlyShowJobs()) -+ { -+ stream << "# This is an automatically generated job file." << Outputter::endl(); -+ stream << "# "; -+ } -+ else -+ { -+ stream << sDate << Outputter::endl(); -+ } -+} -+ -+void -+testshlTestResult::printFailureLine( Outputter &stream, TestFailure *_pFailure, std::string const& _sNodeName) -+{ -+ std::string aName; -+ aName += _sNodeName; -+ aName += "."; -+ aName += _pFailure->failedTestName(); -+ -+ SourceLine aLine = _pFailure->sourceLine(); -+ sal_Int32 nLine = -1; -+ std::string sFilename; -+ if (aLine.isValid()) -+ { -+ nLine = aLine.lineNumber(); -+ sFilename = aLine.fileName(); -+ } -+ -+ Exception *pExp = _pFailure->thrownException(); -+ std::string sWhat; -+ if (pExp) -+ { -+ sWhat = pExp->what(); -+ } -+ -+ ErrorType::num eErr = _pFailure->getErrorType(); -+ -+ stream << aName; -+ stream << ";"; -+ -+ if (eErr == ErrorType::ET_FAILURE) -+ stream << "FAILED"; -+ -+ else if (eErr == ErrorType::ET_ERROR) -+ stream << "ERROR"; -+ -+ else if (eErr == ErrorType::ET_SIGNAL) -+ stream << "SIGNAL"; -+ -+ else -+ stream << "UNKNOWN"; -+ -+ stream << "#FAILED#"; -+ -+ stream << sWhat; -+ stream << Outputter::endl(); -+} -+ -+void -+testshlTestResult::printTestLine( Outputter &stream, Test* _pTest, std::string const& _sNodeName, std::string const& _sInfo) -+{ -+ std::string aName; -+ aName += _sNodeName; -+ aName += "."; -+ aName += _pTest->getName(); -+ -+ stream << aName; -+ stream << ";"; -+ stream << _sInfo << "#"; -+ if (_sInfo == "PASSED") -+ { -+ stream << "OK#"; -+ } -+ else -+ { -+ stream << "FAILED#"; -+ } -+ stream << Outputter::endl(); -+} -+ -+void -+testshlTestResult::printUnknownLine( Outputter &stream, std::string const& _sTestName) -+{ -+ stream << _sTestName; -+ stream << ";"; -+ stream << "UNKNOWN#"; -+ stream << "FAILED#"; -+ stream << Outputter::endl(); -+} -+ -+//# void -+//# testshlTestResult::printStatistics( Outputter &stream ) -+//# { -+//# stream << "Test Results:" << std::endl; -+//# -+//# stream << "Run: " << runTests() -+//# << " Failures: " << testFailures() -+//# << " Errors: " << testErrors() -+//# << std::endl; -+//# } -+ -+ -+Outputter & -+operator <<( Outputter &stream, -+ testshlTestResult &result ) -+{ -+ result.print (stream); return stream; -+} -+ -+ -+} // namespace CppUnit -Nur in misc/build/cppunit-1.8.0/src/result: testshlTestResult.cxx.dummy. ---- misc/cppunit-1.8.0/src/result/treswrapper.cxx 2008-12-10 20:46:09.979665912 +0100 -+++ misc/build/cppunit-1.8.0/src/result/treswrapper.cxx 2008-12-09 09:06:10.000000000 +0100 -@@ -1 +1,261 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#include <cstdarg> -+#include <stdlib.h> -+#include <stdio.h> -+ -+#include <sal/types.h> -+#include <cppunit/Test.h> -+#include "cppunit/autoregister/htestresult.h" -+#include "cppunit/autoregister/callbackfunc_fktptr.h" -+#include "cppunit/result/callbackfunc.h" -+#include "cppunit/result/TestResult.h" -+ -+#include <cppunit/tagvalues.hxx> -+ -+namespace -+{ -+ void TestResult_startTest(hTestResult _pResult, hTest _pTest) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ -+ std::string sName = pTest->getName(); -+ CallbackDispatch(0 /* NULL */, TAG_TYPE, SIGNAL_START_TEST, TAG_RESULT_PTR, _pResult, TAG_NODENAME, sName.c_str(), TAG_DONE); -+ -+ pResult->startTest(pTest); -+ } -+ -+ void TestResult_endTest( hTestResult _pResult, hTest _pTest ) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ pResult->endTest(pTest); -+ -+ std::string sName = pTest->getName(); -+ CallbackDispatch(0 /* NULL */, TAG_TYPE, SIGNAL_END_TEST, TAG_RESULT_PTR, _pResult, TAG_NODENAME, sName.c_str(), TAG_DONE); -+ } -+ -+// ----------------------------------------------------------------------------- -+ -+ void TestResult_addFailure( hTestResult _pResult, hTest _pTest, hException _pException ) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ CppUnit::Exception* pException = (CppUnit::Exception*)_pException; -+ pResult->addFailure(pTest, pException); -+ } -+ -+ void TestResult_addError( hTestResult _pResult, hTest _pTest, hException _pException ) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ CppUnit::Exception* pException = (CppUnit::Exception*)_pException; -+ pResult->addError(pTest, pException); -+ } -+ -+ sal_Int32 TestResult_shouldStop(hTestResult _pResult) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ return pResult->shouldStop() == true ? 1 : 0; -+ } -+ -+// ----------------------------------------------------------------------------- -+ void TestResult_addInfo( hTestResult _pResult, hTest _pTest, const char* _sInfo ) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ // CppUnit::Exception* pException = (CppUnit::Exception*)_pException; -+ pResult->addInfo(pTest, _sInfo); -+ } -+// ----------------------------------------------------------------------------- -+ void TestResult_enterNode( hTestResult _pResult, const char* _sNode ) -+ { -+ // signalPushName(getName()); -+ // CallbackDispatch(NULL, TAG_TYPE, EXECUTION_PUSH_NAME, TAG_RESULT_PTR, _pResult, TAG_NODENAME, _sNode, TAG_DONE); -+ -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ // CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ // CppUnit::Exception* pException = (CppUnit::Exception*)_pException; -+ pResult->enterNode(_sNode); -+ } -+ void TestResult_leaveNode( hTestResult _pResult, const char* _sNode ) -+ { -+ CppUnit::TestResult* pResult = (CppUnit::TestResult*)_pResult; -+ // CppUnit::Test* pTest = (CppUnit::Test*)_pTest; -+ // CppUnit::Exception* pException = (CppUnit::Exception*)_pException; -+ pResult->leaveNode(_sNode); -+ -+ // CallbackDispatch(NULL, TAG_TYPE, EXECUTION_POP_NAME, TAG_RESULT_PTR, _pResult, TAG_DONE); -+ } -+ -+// ----------------------------------------------------------------------------- -+ sal_Int32 TestResult_StarterA(TagHelper const& _aTagItems) -+ { -+ sal_Int32 nRetValue = 0; -+ TagData nTagType = _aTagItems.GetTagData(TAG_TYPE, 0); -+ hTestResult pResult = (hTestResult) _aTagItems.GetTagData(TAG_RESULT_PTR, 0 /* NULL */); -+ CppUnit::Test* pTest = (CppUnit::Test*) _aTagItems.GetTagData(TAG_TEST_PTR, 0 /* NULL */); -+ -+ try -+ { -+ switch(nTagType) -+ { -+ case RESULT_START: -+ TestResult_startTest(pResult, pTest); -+ break; -+ -+ case RESULT_END: -+ TestResult_endTest(pResult, pTest); -+ break; -+ -+ case RESULT_ADD_FAILURE: -+ { -+ hException pException = (hException) _aTagItems.GetTagData(TAG_EXCEPTION, 0); -+ TestResult_addFailure(pResult, pTest, pException); -+ break; -+ } -+ -+ case RESULT_ADD_ERROR: -+ { -+ hException pException = (hException) _aTagItems.GetTagData(TAG_EXCEPTION, 0); -+ TestResult_addError(pResult, pTest, pException); -+ break; -+ } -+ -+ case RESULT_ADD_INFO: -+ { -+ const char* pInfo = (const char* ) _aTagItems.GetTagData(TAG_INFO, 0); -+ TestResult_addInfo(pResult, pTest, pInfo); -+ break; -+ } -+ -+ case RESULT_ENTER_NODE: -+ { -+ const char* pNode = (const char* )_aTagItems.GetTagData(TAG_NODENAME, 0); -+ TestResult_enterNode(pResult, pNode); -+ break; -+ } -+ -+ case RESULT_LEAVE_NODE: -+ { -+ const char* pNode = (const char* ) _aTagItems.GetTagData(TAG_NODENAME, 0); -+ TestResult_leaveNode(pResult, pNode); -+ break; -+ } -+ -+ case RESULT_SHOULD_STOP: -+ nRetValue = TestResult_shouldStop(pResult); -+ break; -+ -+ default: -+ fprintf(stderr, "TestResult_StarterA: Can't handle the tag type %8x\n", SAL_STATIC_CAST(int, nTagType)); -+ fflush(stderr); -+ // throw std::exception(/*std::string("Unknown TYPE_TAG Exception.")*/); -+ } -+ } -+ catch (std::exception &e) -+ { -+ fprintf(stderr, "TestResult_StarterA: Exception caught: %s\n", e.what()); -+ // throw e; -+ } -+ -+ return nRetValue; -+ } -+} // namespace anonymous -+ -+// --------------------------------- Prototypes --------------------------------- -+ -+sal_Int32 SignalHandlerA( TagHelper const& _aTagItems ); -+sal_Int32 ExecutionA( TagHelper const& _aTagItems ); -+ -+// ----------------------------------------------------------------------------- -+sal_Int32 CallbackDispatch(int x, ...) -+{ -+ (void) x; // avoid warning -+ -+ // The idea behind TagItems are from the Amiga OS. -+ // Due to the fact that the following code does not find my ok -+ // I decide to wrote a simple helper -+ // -+ // struct TagItem *tags = (struct TagItem *)&x + 1; -+ -+ TagHelper aTagItems; -+ -+ // the following code could also be in a #define, so other functions could -+ // use this, but at the moment this function a the only one. -+ -+ // FILL_TAGS(aTagItems, x); -+ std::va_list args; -+ va_start( args, x ); -+ Tag nTag; -+ do -+ { -+ nTag = va_arg(args, Tag); -+ if (nTag != TAG_DONE) -+ { -+ TagData nValue = va_arg(args, TagData); -+ // printf("Tag: %8x Value:%8x\n", nTag, nValue); -+ aTagItems.insert(nTag, nValue); -+ } -+ } while (nTag != TAG_DONE); -+ -+ va_end ( args ); -+ -+ // FILL_TAGS:END -+ -+ // printf(".\n"); -+ -+ sal_Int32 nRetValue = 0; -+ Tag nPreTag = aTagItems.GetTagData(TAG_TYPE); -+ if ( (nPreTag & TAG_RESULT) == TAG_RESULT) -+ { -+ nRetValue = TestResult_StarterA( aTagItems ); -+ } -+ else if ((nPreTag & TAG_SIGNAL) == TAG_SIGNAL) -+ { -+ nRetValue = SignalHandlerA(aTagItems); -+ } -+ else if (( nPreTag & TAG_EXECUTION) == TAG_EXECUTION) -+ { -+ nRetValue = ExecutionA(aTagItems); -+ } -+ else -+ { -+ fprintf(stderr, "CallbackDispatch: First tag is unknown %8x\n", SAL_STATIC_CAST(int, nPreTag)); -+ // unknown TAG_TYPE -+ } -+ return nRetValue; -+} -+ -Nur in misc/build/cppunit-1.8.0/src/result: treswrapper.cxx.dummy. ---- misc/cppunit-1.8.0/src/win32/makefile.mk 2008-12-10 20:46:10.024158685 +0100 -+++ misc/build/cppunit-1.8.0/src/win32/makefile.mk 2008-12-10 19:45:23.000000000 +0100 -@@ -1 +1,67 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile$ -+# -+# $Revision$ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+PRJ=..$/..$/..$/..$/..$/.. -+INCEXT=..$/..$/include -+# PRJ=..$/.. -+# PRJINC=.. -+ -+PRJNAME=cppunit -+TARGET=c5t_winstuff -+LIBTARGET=NO -+ENABLE_EXCEPTIONS=TRUE -+ -+# --- Settings ----------------------------------------------------- -+.INCLUDE : settings.mk -+ -+# ------------------------------------------------------------------ -+ -+SLOFILES = \ -+ $(SLO)$/winstuff.obj -+ -+#------------------------------------------------------------------------------- -+# This is a static lib -+LIB1TARGET= $(LB)$/$(TARGET).lib -+LIB1OBJFILES= \ -+ $(SLOFILES) -+ -+.IF "$(GUI)"=="WNT" -+.IF "$(COM)"=="GCC" -+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -+.ENDIF -+.ENDIF -+ -+.IF "$(GUI)" == "UNX" -+LIB1ARCHIV=$(LB)$/lib$(TARGET)$(DLLPOSTFIX).a -+.ENDIF -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk -Nur in misc/build/cppunit-1.8.0/src/win32: makefile.mk.dummy. ---- misc/cppunit-1.8.0/src/win32/winstuff.cxx 2008-12-10 20:46:10.106772548 +0100 -+++ misc/build/cppunit-1.8.0/src/win32/winstuff.cxx 2008-12-10 20:42:44.000000000 +0100 -@@ -1 +1,143 @@ --dummy -+/************************************************************************* -+ * -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * Copyright 2008 by Sun Microsystems, Inc. -+ * -+ * OpenOffice.org - a multi-platform office productivity suite -+ * -+ * $RCSfile$ -+ * $Revision$ -+ * -+ * This file is part of OpenOffice.org. -+ * -+ * OpenOffice.org is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License version 3 -+ * only, as published by the Free Software Foundation. -+ * -+ * OpenOffice.org 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 Lesser General Public License version 3 for more details -+ * (a copy is included in the LICENSE file that accompanied this code). -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * version 3 along with OpenOffice.org. If not, see -+ * <http://www.openoffice.org/license.html> -+ * for a copy of the LGPLv3 License. -+ * -+ ************************************************************************/ -+ -+// MARKER(update_precomp.py): autogen include statement, do not remove -+// #include "precompiled_cppunit.hxx" -+ -+#ifdef WIN32 -+#include "testshl/winstuff.hxx" -+ -+#if defined _MSC_VER -+#pragma warning(push, 1) -+#endif -+#include <windows.h> -+#if defined _MSC_VER -+#pragma warning(pop) -+#endif -+#include <MAPIWin.h> -+ -+void WinDebugBreak() -+{ -+ // forward to WinAPI. Note that the whole story is simply to -+ // disentangle OOo headers from Windows headers (which are largely -+ // incompatible, due to name clashes and macro mess-ups) -+ DebugBreak(); -+} -+ -+void WinSleep( sal_uInt32 sec ) -+{ -+ Sleep(sec * 1000); -+} -+ -+sal_uInt32 WinGetCurrentProcessId() -+{ -+ return GetCurrentProcessId(); -+} -+ -+#define TA_FAILED 0 -+#define TA_SUCCESS_CLEAN 1 -+#define TA_SUCCESS_KILL 2 -+#define TA_SUCCESS_16 3 -+ -+ // Declare Callback Enum Functions. -+bool CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam ); -+ -+/*---------------------------------------------------------------- -+ DWORD WINAPI TerminateApp( DWORD dwPID, DWORD dwTimeout ) -+ -+ Purpose: -+ Shut down a 32-Bit Process (or 16-bit process under Windows 95) -+ -+ Parameters: -+ dwPID -+ Process ID of the process to shut down. -+ -+ dwTimeout -+ Wait time in milliseconds before shutting down the process. -+ -+ Return Value: -+ TA_FAILED - If the shutdown failed. -+ TA_SUCCESS_CLEAN - If the process was shutdown using WM_CLOSE. -+ TA_SUCCESS_KILL - if the process was shut down with -+ TerminateProcess(). -+ NOTE: See header for these defines. -+ ----------------------------------------------------------------*/ -+void WinTerminateApp( sal_uInt32 dwPID, sal_uInt32 dwTimeout ) -+{ -+ HANDLE hProc; -+ DWORD dwRet; -+ -+ // If we can't open the process with PROCESS_TERMINATE rights, -+ // then we give up immediately. -+ hProc = OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE, false, -+ dwPID); -+ -+ if(hProc == NULL) -+ return; -+ -+ // TerminateAppEnum() posts WM_CLOSE to all windows whose PID -+ // matches your process's. -+ EnumWindows((WNDENUMPROC)TerminateAppEnum, (LPARAM) dwPID); -+ -+ // Wait on the handle. If it signals, great. If it times out, -+ // then you kill it. -+ if (WaitForSingleObject(hProc, dwTimeout) != WAIT_OBJECT_0) -+ dwRet= (TerminateProcess(hProc,0) ? TA_SUCCESS_KILL : TA_FAILED); -+ else -+ dwRet = TA_SUCCESS_CLEAN; -+ -+ CloseHandle(hProc); -+} -+ -+bool CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam ) -+{ -+ DWORD dwID; -+ -+ GetWindowThreadProcessId(hwnd, &dwID); -+ -+ if(dwID == (DWORD)lParam) -+ { -+ PostMessage(hwnd, WM_CLOSE, 0, 0); -+ } -+ -+ return true; -+} -+#else -+ -+// this file is only need within Windows. -+// due to the fact that empty files don't create libraries -+// we store one function in it. -+int WinStuffDummy_this_function_will_never_need() -+{ -+ return 42; // we need some code -+} -+ -+#endif /* WIN32 */ -+ -Nur in misc/build/cppunit-1.8.0/src/win32: winstuff.cxx.dummy. diff --git a/cppunit/download/cppunit-1.8.0.tar.gz b/cppunit/download/cppunit-1.8.0.tar.gz Binary files differdeleted file mode 100644 index d1d27ad..0000000 --- a/cppunit/download/cppunit-1.8.0.tar.gz +++ /dev/null diff --git a/cppunit/ldflags.patch b/cppunit/ldflags.patch new file mode 100644 index 0000000..cecd69a --- /dev/null +++ b/cppunit/ldflags.patch @@ -0,0 +1,10 @@ +--- misc/cppunit-1.12.1/src/cppunit/Makefile.am Wed Feb 20 06:36:38 2008 ++++ misc/build/cppunit-1.12.1/src/cppunit/Makefile.am Mon May 3 17:00:41 2010 +@@ -63,5 +63,6 @@ + + libcppunit_la_LDFLAGS= \ + -no-undefined -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ +- -release $(LT_RELEASE) ++ -release $(LT_RELEASE) \ ++ @LIBADD_DL@ + diff --git a/cppunit/makefile.mk b/cppunit/makefile.mk index 8f63656..f50f4aa 100644 --- a/cppunit/makefile.mk +++ b/cppunit/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.1.2.3 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,106 +21,172 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ + +PRJ = . +PRJNAME = cppunit +TARGET = cppunit + +.INCLUDE: settings.mk + +TARFILE_NAME = cppunit-1.12.1 +TARFILE_MD5=bd30e9cf5523cdfc019b94f5e1d7fd19 + # from <https://sourceforge.net/projects/cppunit/files/cppunit/1.12.1/ + # cppunit-1.12.1.tar.gz/download> + +PATCH_FILES = solarisfinite.patch warnings.patch windows.patch ldflags.patch + # solarisfinite.patch: see <https://sourceforge.net/tracker/?func=detail& + # aid=2912590&group_id=11795&atid=311795> + # warnings.patch: see <https://sourceforge.net/tracker/?func=detail& + # aid=2912630&group_id=11795&atid=311795> + +.IF "$(OS)" == "WNT" +.IF "$(COM)" == "MSC" + +# On Windows, CppUnit appears to support either the Unix-style configure/make +# approach with cygwin and gcc (and libtool fails miserably if gcc is replaced +# by MSVC cl), or a Visual Studio project (CppUnitLibraries.dsw). However, the +# latter is too old to work with vcbuild from a wntmsci12 tool chain. So, the +# easiest way appears to inject hand-crafted dmake makefiles to build the +# relevant parts. (Another approach would be to manually use the Visual Studio +# IDE to convert CppUnitLibraries.dsw to modern format, inject the resulting +# cppunit_dll.vcproj and DllPlugInTester.vcproj and build those with vcbuild.) + +CONFIGURE_ACTION = $(SED) -e s:@BACKPATH@:../$(BACK_PATH): \ + < ../$(BACK_PATH)$(PATH_IN_MODULE)/ooo-cppunit_dll.mk \ + > src/cppunit/ooo-cppunit_dll.mk && \ + $(SED) -e s:@BACKPATH@:../$(BACK_PATH): \ + < ../$(BACK_PATH)$(PATH_IN_MODULE)/ooo-DllPlugInTester.mk \ + > src/DllPlugInTester/ooo-DllPlugInTester.mk + +BUILD_ACTION = cd src/cppunit && dmake -f ooo-cppunit_dll.mk && \ + cd ../DllPlugInTester && dmake -f ooo-DllPlugInTester.mk + +OUTDIR2INC = include/cppunit + +.INCLUDE: set_ext.mk +.INCLUDE: target.mk +.INCLUDE: tg_ext.mk + +$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE): ooo-cppunit_dll.mk ooo-DllPlugInTester.mk + +.ELSE +.IF "$(COM)" == "GCC" +EXTRA_CFLAGS += -mthreads +LDFLAGS += -Wl,--enable-runtime-pseudo-reloc-v2 + +.IF "$(USE_SYSTEM_STL)" != "YES" + +OOO_STLPORT_CXXFLAGS = -I$(SOLARINCDIR)/stl +.IF "$(USE_STLP_DEBUG)" == "TRUE" +OOO_STLPORT_CXXFLAGS += -D_STLP_DEBUG +.END +OOO_STLPORT_CXXFLAGS += -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) + +OOO_STLPORT_LDFLAGS = -L$(SOLARLIBDIR) +OOO_STLPORT_LIBS = $(LIBSTLPORT) + +.END + +CONFIGURE_ACTION = ./configure +CONFIGURE_FLAGS = --prefix=$(shell cd $(PACKAGE_DIR) && \ + pwd $(PWDFLAGS))/$(TARFILE_ROOTDIR)/ooo-install \ + --disable-dependency-tracking --disable-static --disable-doxygen \ + --disable-html-docs --disable-latex-docs CC='$(CC)' CXX='$(CXX)' \ + CXXFLAGS='$(EXTRA_CFLAGS) $(OOO_STLPORT_CXXFLAGS)' \ + LDFLAGS='$(LDFLAGS) $(OOO_STLPORT_LDFLAGS)' \ + LIBS='$(OOO_STLPORT_LIBS) $(MY_LIBS)' + +BUILD_ACTION = $(GNUMAKE) +BUILD_FLAGS = install + +OUTDIR2INC = ooo-install/include/cppunit + +OUT2BIN = ooo-install/bin/DllPlugInTester.exe \ + ooo-install/bin/cygcppunit-1-12-1.dll + +.INCLUDE: set_ext.mk +.INCLUDE: target.mk +.INCLUDE: tg_ext.mk + +.ENDIF # "$(COM)" == "GCC" +.ENDIF # "$(COM)" == "MSC" + +.ELSE + +.IF "$(USE_SYSTEM_STL)" != "YES" + +OOO_STLPORT_CXXFLAGS = -I$(SOLARINCDIR)/stl +.IF "$(USE_STLP_DEBUG)" == "TRUE" +OOO_STLPORT_CXXFLAGS += -D_STLP_DEBUG +.END +.IF "$(COM)" == "GCC" +OOO_STLPORT_CXXFLAGS += -DGXX_INCLUDE_PATH=$(GXX_INCLUDE_PATH) +.END + +OOO_STLPORT_LDFLAGS = -L$(SOLARLIBDIR) +OOO_STLPORT_LIBS = $(LIBSTLPORT) + +# When "checking for C compiler default output file name" configure +# unfortunately uses "$CC $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS" to build +# a C program that links against $(LIBSTLPORT); at least on one unxlngi6 +# machine, this has been observed to fail with "/lib/libm.so.6: undefined +# reference to `_rtld_global_ro@GLIBC_PRIVATE'" unless -lm is also specified: +.IF "$(OS)" == "LINUX" && "$(COM)" == "GCC" && "$(CPU)" == "I" +OOO_STLPORT_LIBS += -lm +# #i112124# furthermore, STLPort seems to require libstdc++ +OOO_STLPORT_LIBS += -lstdc++ +.END + +# And later, when "checking whether the C compiler works" configure tries to +# execute that program; however, the program would fail to locate the STLport +# library (another work-around might be to add something like --as-needed around +# $(LIBSTLPORT)): +.IF "$(OS)" == "FREEBSD" || "$(OS)" == "LINUX" || "$(OS)" == "SOLARIS" +.IF "$(LD_LIBRARY_PATH)" == "" +LD_LIBRARY_PATH := $(SOLARLIBDIR) + # strictly speaking, this is incorrect if the LD_LIBRARY_PATH environment + # variable is set to the empty string +.ELSE +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(SOLARLIBDIR) +.END +.EXPORT: LD_LIBRARY_PATH +.END + +.END + +# At least on Solaris with Sun CC, linking the cppunit dynamic library fails as +# TestAssert.o uses fabs but -lm is missing from the command line (cppunit's +# aclocal.m4 contains an unused AC_CHECK_LIBM, maybe using that would be a +# better fix): +.IF "$(OS)" == "SOLARIS" && "$(COM)" == "C52" +MY_LIBS = -lm +.END + +CONFIGURE_ACTION = ./configure +CONFIGURE_FLAGS = --prefix=$(shell cd $(PACKAGE_DIR) && \ + pwd $(PWDFLAGS))/$(TARFILE_ROOTDIR)/ooo-install \ + --disable-dependency-tracking --disable-static --disable-doxygen \ + --disable-html-docs --disable-latex-docs CC='$(CC)' CXX='$(CXX)' \ + CXXFLAGS='$(EXTRA_CFLAGS) $(OOO_STLPORT_CXXFLAGS)' \ + LDFLAGS='$(LDFLAGS) $(OOO_STLPORT_LDFLAGS)' \ + LIBS='$(OOO_STLPORT_LIBS) $(MY_LIBS)' + +BUILD_ACTION = $(GNUMAKE) +BUILD_FLAGS = install + +OUTDIR2INC = ooo-install/include/cppunit + +OUT2BIN = ooo-install/bin/DllPlugInTester +.IF "$(OS)" == "MACOSX" +OUT2LIB = ooo-install/lib/libcppunit-1.12.1.dylib +EXTRPATH = NONE +.ELSE +OUT2LIB = ooo-install/lib/libcppunit-1.12.so.1 +.END -PRJ=. - -PRJNAME=so_cppunit -TARGET=so_cppunit - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -TARFILE_NAME=cppunit-1.8.0 - -MOVED_FILES=\ - include$/cppunit$/result$/SynchronizedObject.h \ - include$/cppunit$/result$/TestListener.h \ - include$/cppunit$/result$/TestResultCollector.h \ - include$/cppunit$/result$/TestResult.h \ - include$/cppunit$/result$/TestSucessListener.h \ - include$/cppunit$/result$/TextTestResult.h \ - include$/cppunit$/portability$/config-bcb5.h \ - include$/cppunit$/portability$/config-msvc6.h \ - src$/result$/SynchronizedObject.cpp \ - src$/result$/TestResultCollector.cpp \ - src$/result$/TestResult.cpp \ - src$/result$/TestSucessListener.cpp \ - src$/result$/TextTestResult.cpp - -ADDITIONAL_FILES=\ - $(MOVED_FILES) \ - include$/cppunit$/additionalfunc.hxx \ - include$/cppunit$/autoregister$/callbackfunc_fktptr.h \ - include$/cppunit$/autoregister$/callbackstructure.h \ - include$/cppunit$/autoregister$/htestresult.h \ - include$/cppunit$/autoregister$/registerfunc.h \ - include$/cppunit$/autoregister$/registertestfunction.h \ - include$/cppunit$/autoregister$/testfunc.h \ - include$/cppunit$/checkboom.hxx \ - include$/cppunit$/cmdlinebits.hxx \ - include$/cppunit$/externcallbackfunc.hxx \ - include$/cppunit$/joblist.hxx \ - include$/cppunit$/nocopy.hxx \ - include$/cppunit$/portability$/config-auto.h \ - include$/cppunit$/result$/callbackfunc.h \ - include$/cppunit$/result$/emacsTestResult.hxx \ - include$/cppunit$/result$/log.hxx \ - include$/cppunit$/result$/optionhelper.hxx \ - include$/cppunit$/result$/outputter.hxx \ - include$/cppunit$/result$/testshlTestResult.h \ - include$/cppunit$/signaltest.h \ - include$/cppunit$/simpleheader.hxx \ - include$/cppunit$/stringhelper.hxx \ - include$/cppunit$/taghelper.hxx \ - include$/cppunit$/tagvalues.hxx \ - include$/testshl$/autoregisterhelper.hxx \ - include$/testshl$/dynamicregister.hxx \ - include$/testshl$/filehelper.hxx \ - include$/testshl$/getopt.hxx \ - include$/testshl$/log.hxx \ - include$/testshl$/tresstatewrapper.h \ - include$/testshl$/tresstatewrapper.hxx \ - include$/testshl$/versionhelper.hxx \ - include$/testshl$/winstuff.hxx \ - include$/makefile.mk \ - makefile.mk \ - src$/makefile.mk \ - src$/cppunit$/cmdlinebits.cxx \ - src$/cppunit$/joblist.cxx \ - src$/cppunit$/makefile.mk \ - src$/cppunit$/registertestfunction.cxx \ - src$/cppunit$/signaltest.cxx \ - src$/cppunit$/t_print.cxx \ - src$/cppunit$/tresregister.cxx \ - src$/cppunit$/tresstatewrapper.cxx \ - src$/result$/emacsTestResult.cxx \ - src$/result$/log.cxx \ - src$/result$/makefile.mk \ - src$/result$/optionhelper.cxx \ - src$/result$/outputter.cxx \ - src$/result$/signal.cxx \ - src$/result$/signal.hxx \ - src$/result$/testshlTestResult.cxx \ - src$/result$/treswrapper.cxx \ - src$/win32$/makefile.mk \ - src$/win32$/winstuff.cxx - -PATCH_FILES=cppunit-1.8.0-r1.patch - -# CONFIGURE_DIR= -# CONFIGURE_ACTION= -# -# BUILD_DIR= -BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) - -# --- Targets ------------------------------------------------------ - -.INCLUDE : set_ext.mk -.INCLUDE : target.mk -.INCLUDE : tg_ext.mk +.INCLUDE: set_ext.mk +.INCLUDE: target.mk +.INCLUDE: tg_ext.mk +.END diff --git a/external/gpc/makefile.mk b/cppunit/ooo-DllPlugInTester.mk index 7eba7b7..1c8c8a0 100644 --- a/external/gpc/makefile.mk +++ b/cppunit/ooo-DllPlugInTester.mk @@ -1,14 +1,10 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. # -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -27,31 +23,28 @@ # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. # -#************************************************************************* -PRJ=.. - -PRJNAME=external -TARGET=gpc -LIBTARGET=NO -EXTERNAL_WARNINGS_NOT_ERRORS=TRUE - -# --- Settings ----------------------------------------------------- +#***********************************************************************/ -.INCLUDE : settings.mk +PRJ = @BACKPATH@../.. +PRJNAME = cppunit +TARGET = DllPlugInTester -# --- Files -------------------------------------------------------- +ENABLE_EXCEPTIONS = TRUE +nodep = TRUE -.IF "$(BUILD_SPECIAL)"=="" -.IF "$(WITH_GPC)"!="NO" -SLOFILES = $(SLO)$/gpc.obj +.INCLUDE: settings.mk -LIB1TARGET=$(SLB)$/$(TARGET).lib -LIB1ARCHIV=$(LB)$/lib$(TARGET).a -LIB1OBJFILES=$(SLOFILES) -.ENDIF -.ENDIF # "$(BUILD_SPECIAL)"=="" +CDEFS += -DCPPUNIT_DLL +CFLAGSCXX += -I../../include +UWINAPILIB = -# --- Targets ------------------------------------------------------ +OBJFILES = $(APP1OBJS) -.INCLUDE : target.mk +APP1OBJS = \ + $(OBJ)/CommandLineParser.obj \ + $(OBJ)/DllPlugInTester.obj +APP1RPATH = NONE +APP1STDLIBS = icppunit_dll.lib +APP1TARGET = DllPlugInTester_dll +.INCLUDE: target.mk diff --git a/cppunit/ooo-cppunit_dll.mk b/cppunit/ooo-cppunit_dll.mk new file mode 100644 index 0000000..048a51e --- /dev/null +++ b/cppunit/ooo-cppunit_dll.mk @@ -0,0 +1,100 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org 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 Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +PRJ = @BACKPATH@../.. +PRJNAME = cppunit +TARGET = cppunit_dll + +ENABLE_EXCEPTIONS = TRUE +EXTERNAL_WARNINGS_NOT_ERRORS = TRUE +nodep = TRUE + +.INCLUDE: settings.mk + +CDEFS += -DCPPUNIT_BUILD_DLL +CFLAGSCXX += -I../../include +UWINAPILIB = + +SLOFILES = $(SHL1OBJS) + +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = \ + $(SLO)/AdditionalMessage.obj \ + $(SLO)/Asserter.obj \ + $(SLO)/BeosDynamicLibraryManager.obj \ + $(SLO)/BriefTestProgressListener.obj \ + $(SLO)/CompilerOutputter.obj \ + $(SLO)/DefaultProtector.obj \ + $(SLO)/DllMain.obj \ + $(SLO)/DynamicLibraryManager.obj \ + $(SLO)/DynamicLibraryManagerException.obj \ + $(SLO)/Exception.obj \ + $(SLO)/Message.obj \ + $(SLO)/PlugInManager.obj \ + $(SLO)/PlugInParameters.obj \ + $(SLO)/Protector.obj \ + $(SLO)/ProtectorChain.obj \ + $(SLO)/RepeatedTest.obj \ + $(SLO)/SourceLine.obj \ + $(SLO)/StringTools.obj \ + $(SLO)/SynchronizedObject.obj \ + $(SLO)/Test.obj \ + $(SLO)/TestAssert.obj \ + $(SLO)/TestCase.obj \ + $(SLO)/TestCaseDecorator.obj \ + $(SLO)/TestComposite.obj \ + $(SLO)/TestDecorator.obj \ + $(SLO)/TestFactoryRegistry.obj \ + $(SLO)/TestFailure.obj \ + $(SLO)/TestLeaf.obj \ + $(SLO)/TestNamer.obj \ + $(SLO)/TestPath.obj \ + $(SLO)/TestPlugInDefaultImpl.obj \ + $(SLO)/TestResult.obj \ + $(SLO)/TestResultCollector.obj \ + $(SLO)/TestRunner.obj \ + $(SLO)/TestSetUp.obj \ + $(SLO)/TestSuccessListener.obj \ + $(SLO)/TestSuite.obj \ + $(SLO)/TestSuiteBuilderContext.obj \ + $(SLO)/TextOutputter.obj \ + $(SLO)/TextTestProgressListener.obj \ + $(SLO)/TextTestResult.obj \ + $(SLO)/TextTestRunner.obj \ + $(SLO)/TypeInfoHelper.obj \ + $(SLO)/UnixDynamicLibraryManager.obj \ + $(SLO)/Win32DynamicLibraryManager.obj \ + $(SLO)/XmlDocument.obj \ + $(SLO)/XmlElement.obj \ + $(SLO)/XmlOutputter.obj \ + $(SLO)/XmlOutputterHook.obj +SHL1RPATH = NONE +SHL1TARGET = cppunit_dll +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) + +.INCLUDE: target.mk diff --git a/cppunit/prj/build.lst b/cppunit/prj/build.lst index a1cce90..9bfcb57 100644 --- a/cppunit/prj/build.lst +++ b/cppunit/prj/build.lst @@ -1,3 +1,2 @@ -c5t cppunit : sal NULL -c5t cppunit usr1 - all c5t_mkout NULL -c5t cppunit nmake - all c5t_make NULL +c5t cppunit : stlport NULL +c5t cppunit nmake - all cppunit NULL diff --git a/cppunit/prj/d.lst b/cppunit/prj/d.lst index 94fa6ac..6ecac46 100644 --- a/cppunit/prj/d.lst +++ b/cppunit/prj/d.lst @@ -1,73 +1,29 @@ mkdir: %_DEST%\inc%_EXT%\cppunit -mkdir: %_DEST%\inc%_EXT%\cppunit\portability -mkdir: %_DEST%\inc%_EXT%\cppunit\autoregister +..\%__SRC%\inc\cppunit\*.h %_DEST%\inc%_EXT%\cppunit\*.h +mkdir: %_DEST%\inc%_EXT%\cppunit\config +..\%__SRC%\inc\cppunit\config\*.h %_DEST%\inc%_EXT%\cppunit\config\*.h mkdir: %_DEST%\inc%_EXT%\cppunit\extensions -mkdir: %_DEST%\inc%_EXT%\cppunit\result -mkdir: %_DEST%\inc%_EXT%\testshl +..\%__SRC%\inc\cppunit\extensions\*.h %_DEST%\inc%_EXT%\cppunit\extensions\*.h +mkdir: %_DEST%\inc%_EXT%\cppunit\plugin +..\%__SRC%\inc\cppunit\plugin\*.h %_DEST%\inc%_EXT%\cppunit\plugin\*.h +mkdir: %_DEST%\inc%_EXT%\cppunit\portability +..\%__SRC%\inc\cppunit\portability\*.h %_DEST%\inc%_EXT%\cppunit\portability\*.h +mkdir: %_DEST%\inc%_EXT%\cppunit\tools +..\%__SRC%\inc\cppunit\tools\*.h %_DEST%\inc%_EXT%\cppunit\tools\*.h +mkdir: %_DEST%\inc%_EXT%\cppunit\ui\text +..\%__SRC%\inc\cppunit\ui\text\*.h %_DEST%\inc%_EXT%\cppunit\ui\text\*.h + +..\%__SRC%\bin\cppunit_dll.dll %_DEST%\bin%_EXT%\cppunit_dll.dll +..\%__SRC%\lib\icppunit_dll.lib %_DEST%\lib%_EXT%\icppunit_dll.lib -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/Asserter.h %_DEST%\inc%_EXT%/cppunit/Asserter.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/Exception.h %_DEST%\inc%_EXT%/cppunit/Exception.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/NotEqualException.h %_DEST%\inc%_EXT%/cppunit/NotEqualException.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/Portability.h %_DEST%\inc%_EXT%/cppunit/Portability.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/SourceLine.h %_DEST%\inc%_EXT%/cppunit/SourceLine.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/Test.h %_DEST%\inc%_EXT%/cppunit/Test.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/TestAssert.h %_DEST%\inc%_EXT%/cppunit/TestAssert.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/TestCaller.h %_DEST%\inc%_EXT%/cppunit/TestCaller.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/TestCase.h %_DEST%\inc%_EXT%/cppunit/TestCase.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/TestFailure.h %_DEST%\inc%_EXT%/cppunit/TestFailure.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/TestFixture.h %_DEST%\inc%_EXT%/cppunit/TestFixture.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/TestSuite.h %_DEST%\inc%_EXT%/cppunit/TestSuite.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/additionalfunc.hxx %_DEST%\inc%_EXT%/cppunit/additionalfunc.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/autoregister/callbackfunc_fktptr.h %_DEST%\inc%_EXT%/cppunit/autoregister/callbackfunc_fktptr.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/autoregister/callbackstructure.h %_DEST%\inc%_EXT%/cppunit/autoregister/callbackstructure.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/autoregister/htestresult.h %_DEST%\inc%_EXT%/cppunit/autoregister/htestresult.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/autoregister/registerfunc.h %_DEST%\inc%_EXT%/cppunit/autoregister/registerfunc.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/autoregister/registertestfunction.h %_DEST%\inc%_EXT%/cppunit/autoregister/registertestfunction.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/autoregister/testfunc.h %_DEST%\inc%_EXT%/cppunit/autoregister/testfunc.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/checkboom.hxx %_DEST%\inc%_EXT%/cppunit/checkboom.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/cmdlinebits.hxx %_DEST%\inc%_EXT%/cppunit/cmdlinebits.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/AutoRegisterSuite.h %_DEST%\inc%_EXT%/cppunit/extensions/AutoRegisterSuite.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/HelperMacros.h %_DEST%\inc%_EXT%/cppunit/extensions/HelperMacros.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/TestFactory.h %_DEST%\inc%_EXT%/cppunit/extensions/TestFactory.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/TestFactoryRegistry.h %_DEST%\inc%_EXT%/cppunit/extensions/TestFactoryRegistry.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/TestSuiteBuilder.h %_DEST%\inc%_EXT%/cppunit/extensions/TestSuiteBuilder.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/TestSuiteFactory.h %_DEST%\inc%_EXT%/cppunit/extensions/TestSuiteFactory.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/extensions/TypeInfoHelper.h %_DEST%\inc%_EXT%/cppunit/extensions/TypeInfoHelper.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/externcallbackfunc.hxx %_DEST%\inc%_EXT%/cppunit/externcallbackfunc.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/joblist.hxx %_DEST%\inc%_EXT%/cppunit/joblist.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/nocopy.hxx %_DEST%\inc%_EXT%/cppunit/nocopy.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/portability/config-auto.h %_DEST%\inc%_EXT%/cppunit/portability/config-auto.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/portability/config-bcb5.h %_DEST%\inc%_EXT%/cppunit/portability/config-bcb5.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/portability/config-msvc6.h %_DEST%\inc%_EXT%/cppunit/portability/config-msvc6.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/SynchronizedObject.h %_DEST%\inc%_EXT%/cppunit/result/SynchronizedObject.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/TestListener.h %_DEST%\inc%_EXT%/cppunit/result/TestListener.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/TestResult.h %_DEST%\inc%_EXT%/cppunit/result/TestResult.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/TestResultCollector.h %_DEST%\inc%_EXT%/cppunit/result/TestResultCollector.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/TestSucessListener.h %_DEST%\inc%_EXT%/cppunit/result/TestSucessListener.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/TextTestResult.h %_DEST%\inc%_EXT%/cppunit/result/TextTestResult.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/callbackfunc.h %_DEST%\inc%_EXT%/cppunit/result/callbackfunc.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/emacsTestResult.hxx %_DEST%\inc%_EXT%/cppunit/result/emacsTestResult.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/log.hxx %_DEST%\inc%_EXT%/cppunit/result/log.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/optionhelper.hxx %_DEST%\inc%_EXT%/cppunit/result/optionhelper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/outputter.hxx %_DEST%\inc%_EXT%/cppunit/result/outputter.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/result/testshlTestResult.h %_DEST%\inc%_EXT%/cppunit/result/testshlTestResult.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/signaltest.h %_DEST%\inc%_EXT%/cppunit/signaltest.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/simpleheader.hxx %_DEST%\inc%_EXT%/cppunit/simpleheader.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/stringhelper.hxx %_DEST%\inc%_EXT%/cppunit/stringhelper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/taghelper.hxx %_DEST%\inc%_EXT%/cppunit/taghelper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/cppunit/tagvalues.hxx %_DEST%\inc%_EXT%/cppunit/tagvalues.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/autoregisterhelper.hxx %_DEST%\inc%_EXT%/testshl/autoregisterhelper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/dynamicregister.hxx %_DEST%\inc%_EXT%/testshl/dynamicregister.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/filehelper.hxx %_DEST%\inc%_EXT%/testshl/filehelper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/getopt.hxx %_DEST%\inc%_EXT%/testshl/getopt.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/log.hxx %_DEST%\inc%_EXT%/testshl/log.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/tresstatewrapper.h %_DEST%\inc%_EXT%/testshl/tresstatewrapper.h -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/tresstatewrapper.hxx %_DEST%\inc%_EXT%/testshl/tresstatewrapper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/versionhelper.hxx %_DEST%\inc%_EXT%/testshl/versionhelper.hxx -..\%__SRC%\misc\build\cppunit-1.8.0\include/testshl/winstuff.hxx %_DEST%\inc%_EXT%/testshl/winstuff.hxx +..\%__SRC%\bin\cygcppunit-1-12-1.dll %_DEST%\bin%_EXT%\cygcppunit-1-12-1.dll +..\%__SRC%\lib\libcppunit-1.12.1.dylib %_DEST%\lib%_EXT%\libcppunit-1.12.1.dylib +symlink: %_DEST%\lib%_EXT%\libcppunit-1.12.1.dylib %_DEST%\lib%_EXT%\libcppunit.dylib -..\%__SRC%\lib\cppunit.lib %_DEST%\lib%_EXT%\cppunit.lib -..\%__SRC%\lib\c5t_*.lib %_DEST%\lib%_EXT%\c5t_*.lib -..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\lib\libcppunit-1.12.so.1 %_DEST%\lib%_EXT%\libcppunit-1.12.so.1 +symlink: %_DEST%\lib%_EXT%\libcppunit-1.12.so.1 %_DEST%\lib%_EXT%\libcppunit.so +..\%__SRC%\bin\DllPlugInTester %_DEST%\bin%_EXT%\DllPlugInTester +..\%__SRC%\bin\DllPlugInTester.exe %_DEST%\bin%_EXT%\DllPlugInTester.exe +..\%__SRC%\bin\DllPlugInTester_dll.exe %_DEST%\bin%_EXT%\DllPlugInTester_dll.exe diff --git a/cppunit/solarisfinite.patch b/cppunit/solarisfinite.patch new file mode 100644 index 0000000..0c15cdc --- /dev/null +++ b/cppunit/solarisfinite.patch @@ -0,0 +1,14 @@ +--- misc/cppunit-1.12.1/include/cppunit/portability/FloatingPoint.h Mon Mar 5 04:16:42 2007 ++++ misc/build/cppunit-1.12.1/include/cppunit/portability/FloatingPoint.h Thu Dec 3 16:34:23 2009 +@@ -3,6 +3,11 @@ + + #include <cppunit/Portability.h> + #include <math.h> ++ ++#if defined(__sun) && !defined(CPPUNIT_HAVE_ISFINITE) && defined(CPPUNIT_HAVE_FINITE) ++#include <ieeefp.h> ++ // <math.h> is still needed for usage of fabs in TestAssert.cpp ++#endif + + CPPUNIT_NS_BEGIN + diff --git a/cppunit/warnings.patch b/cppunit/warnings.patch new file mode 100644 index 0000000..39e804a --- /dev/null +++ b/cppunit/warnings.patch @@ -0,0 +1,22 @@ +--- misc/cppunit-1.12.1/include/cppunit/plugin/TestPlugIn.h 2007-01-12 05:54:34.000000000 +0100 ++++ misc/build/cppunit-1.12.1/include/cppunit/plugin/TestPlugIn.h 2009-12-02 15:33:29.639857272 +0100 +@@ -151,9 +151,7 @@ + #include <windows.h> + #endif + #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \ +- BOOL APIENTRY DllMain( HANDLE hModule, \ +- DWORD ul_reason_for_call, \ +- LPVOID lpReserved ) \ ++ BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ) \ + { \ + return TRUE; \ + } \ +@@ -162,7 +160,7 @@ + // Unix + #elif defined(CPPUNIT_HAVE_UNIX_DLL_LOADER) || defined(CPPUNIT_HAVE_UNIX_SHL_LOADER) + #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \ +- int main( int argc, char *argv[] ) \ ++ int main( int, char *[] ) \ + { \ + return 0; \ + } \ diff --git a/cppunit/windows.patch b/cppunit/windows.patch new file mode 100644 index 0000000..da34692 --- /dev/null +++ b/cppunit/windows.patch @@ -0,0 +1,12 @@ +--- misc/cppunit-1.12.1/include/cppunit/plugin/TestPlugIn.h 2010-01-11 14:42:25.084658287 +0100 ++++ misc/build/cppunit-1.12.1/include/cppunit/plugin/TestPlugIn.h 2010-01-11 14:42:18.660706180 +0100 +@@ -149,6 +149,9 @@ + #define NOMINMAX + #define BLENDFUNCTION void // for mingw & gcc + #include <windows.h> ++#if defined(OPTIONAL) // set within windows.h ++#undef OPTIONAL ++#endif + #endif + #define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \ + BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ) \ diff --git a/epm/download/epm-3.7.tar.gz b/epm/download/epm-3.7.tar.gz Binary files differdeleted file mode 100644 index 4b379ce..0000000 --- a/epm/download/epm-3.7.tar.gz +++ /dev/null diff --git a/epm/epm-3.7.patch b/epm/epm-3.7.patch index 116aa28..02835bc 100644 --- a/epm/epm-3.7.patch +++ b/epm/epm-3.7.patch @@ -1,811 +1,657 @@ -*** misc/epm-3.7/bsd.c Tue Jan 14 18:05:01 2003 ---- misc/build/epm-3.7/bsd.c Mon Nov 20 14:54:51 2006 -*************** -*** 26,31 **** ---- 26,38 ---- - - #include "epm.h" - -+ void cr2semicolon(char *command) -+ { -+ int len, i; -+ len=strlen(command); -+ for (i=0;i<len;i++) -+ if(*(command+i)=='\n') *(command+i)=';'; -+ } - +diff -urN epm-3.7-old//bsd.c epm-3.7/bsd.c +--- misc/epm-3.7/bsd.c 2003-01-14 17:05:01.000000000 +0000 ++++ misc/build/epm-3.7/bsd.c 2010-04-19 22:52:32.000000000 +0000 +@@ -26,6 +26,13 @@ + + #include "epm.h" + ++void cr2semicolon(char *command) ++{ ++ int len, i; ++ len=strlen(command); ++ for (i=0;i<len;i++) ++ if(*(command+i)=='\n') *(command+i)=';'; ++} + + /* + * 'make_bsd()' - Make a FreeBSD software distribution package. +@@ -149,8 +156,17 @@ + + for (i = dist->num_depends, d = dist->depends; i > 0; i --, d ++) + { ++#ifdef __FreeBSD__ ++ if (d->type == DEPEND_REQUIRES) { ++ if (dist->relnumber) ++ fprintf(fp, "@pkgdep %s-%s-%d-%s", d->product, dist->version, dist->relnumber, platname); ++ else ++ fprintf(fp, "@pkgdep %s-%s-%s", d->product, dist->version, platname); ++ } ++#else + if (d->type == DEPEND_REQUIRES) + fprintf(fp, "@pkgdep %s", d->product); ++#endif + else + #ifdef __FreeBSD__ + /* +@@ -179,9 +195,11 @@ + " by the BSD packager.\n", stderr); + break; + case COMMAND_POST_INSTALL : ++ cr2semicolon(c->command); + fprintf(fp, "@exec %s\n", c->command); + break; + case COMMAND_PRE_REMOVE : ++ cr2semicolon(c->command); + fprintf(fp, "@unexec %s\n", c->command); + break; + case COMMAND_POST_REMOVE : +@@ -199,7 +217,7 @@ + */ + + fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst); +- fprintf(fp, "@exec /bin/chown %s:%s %s\n", file->user, file->group, ++ fprintf(fp, "@exec /usr/sbin/chown %s:%s %s\n", file->user, file->group, + file->dst); + fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst); + } +@@ -326,12 +344,13 @@ + if (Verbosity) + puts("Building FreeBSD pkg binary distribution..."); + +- if (run_command(NULL, "pkg_create -p / -s %s -c %s -d %s -f %s %s", ++ if (run_command(NULL, "/usr/sbin/pkg_create -p / -s %s -c %s -d %s -f %s %s", + current, commentname, descrname, plistname, name)) + return (1); + +- if (run_command(NULL, "mv %s.tgz %s", name, directory)) +- return (1); ++ if (run_command(NULL, "mv %s.tbz %s", name, directory)) ++ if (run_command(NULL, "mv %s.tgz %s", name, directory)) ++ return (1); + /* - * 'make_bsd()' - Make a FreeBSD software distribution package. -*************** -*** 149,156 **** ---- 156,172 ---- - - for (i = dist->num_depends, d = dist->depends; i > 0; i --, d ++) - { -+ #ifdef __FreeBSD__ -+ if (d->type == DEPEND_REQUIRES) { -+ if (dist->relnumber) -+ fprintf(fp, "@pkgdep %s-%s-%d-%s", d->product, dist->version, dist->relnumber, platname); -+ else -+ fprintf(fp, "@pkgdep %s-%s-%s", d->product, dist->version, platname); -+ } -+ #else - if (d->type == DEPEND_REQUIRES) - fprintf(fp, "@pkgdep %s", d->product); -+ #endif - else - #ifdef __FreeBSD__ - /* -*************** -*** 179,187 **** ---- 195,205 ---- - " by the BSD packager.\n", stderr); - break; - case COMMAND_POST_INSTALL : -+ cr2semicolon(c->command); - fprintf(fp, "@exec %s\n", c->command); - break; - case COMMAND_PRE_REMOVE : -+ cr2semicolon(c->command); - fprintf(fp, "@unexec %s\n", c->command); - break; - case COMMAND_POST_REMOVE : -*************** -*** 199,205 **** - */ - - fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst); -! fprintf(fp, "@exec /bin/chown %s:%s %s\n", file->user, file->group, - file->dst); - fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst); - } ---- 217,223 ---- - */ - - fprintf(fp, "@exec /bin/mkdir -p %s\n", file->dst); -! fprintf(fp, "@exec /usr/sbin/chown %s:%s %s\n", file->user, file->group, - file->dst); - fprintf(fp, "@exec /bin/chmod %04o %s\n", file->mode, file->dst); - } -*************** -*** 326,337 **** - if (Verbosity) - puts("Building FreeBSD pkg binary distribution..."); - -! if (run_command(NULL, "pkg_create -p / -s %s -c %s -d %s -f %s %s", - current, commentname, descrname, plistname, name)) - return (1); - -! if (run_command(NULL, "mv %s.tgz %s", name, directory)) -! return (1); - - /* - * Remove temporary files... ---- 344,356 ---- - if (Verbosity) - puts("Building FreeBSD pkg binary distribution..."); - -! if (run_command(NULL, "/usr/sbin/pkg_create -p / -s %s -c %s -d %s -f %s %s", - current, commentname, descrname, plistname, name)) - return (1); - -! if (run_command(NULL, "mv %s.tbz %s", name, directory)) -! if (run_command(NULL, "mv %s.tgz %s", name, directory)) -! return (1); - - /* - * Remove temporary files... -*** misc/epm-3.7/configure Thu Jul 24 03:20:54 2003 ---- misc/build/epm-3.7/configure Mon Nov 20 15:01:11 2006 -*************** -*** 1238,1244 **** ---- 1238,1249 ---- - fi - fi; - -+ # Check whether --enable-fltk or --disable-fltk was given. -+ if test "${enable_fltk+set}" = set; then -+ enableval="$enable_fltk" -+ fi; - -+ - # Check whether --with-docdir or --without-docdir was given. - if test "${with_docdir+set}" = set; then - withval="$with_docdir" -*************** -*** 4904,4939 **** - fi - - -! # Extract the first word of "fltk-config", so it can be a program name with args. -! set dummy fltk-config; ac_word=$2 -! echo "$as_me:$LINENO: checking for $ac_word" >&5 -! echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -! if test "${ac_cv_path_FLTKCONFIG+set}" = set; then -! echo $ECHO_N "(cached) $ECHO_C" >&6 -! else -! case $FLTKCONFIG in -! [\\/]* | ?:[\\/]*) -! ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path. -! ;; -! *) -! as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -! for as_dir in $PATH -! do -! IFS=$as_save_IFS -! test -z "$as_dir" && as_dir=. -! for ac_exec_ext in '' $ac_executable_extensions; do -! if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -! ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext" -! echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -! break 2 - fi -! done -! done -! -! ;; -! esac - fi -- FLTKCONFIG=$ac_cv_path_FLTKCONFIG - - if test -n "$FLTKCONFIG"; then - echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5 ---- 4909,4946 ---- - fi - - -! if eval "test x$enable_fltk = xyes"; then -! # Extract the first word of "fltk-config", so it can be a program name with args. -! set dummy fltk-config; ac_word=$2 -! echo "$as_me:$LINENO: checking for $ac_word" >&5 -! echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -! if test "${ac_cv_path_FLTKCONFIG+set}" = set; then -! echo $ECHO_N "(cached) $ECHO_C" >&6 -! else -! case $FLTKCONFIG in -! [\\/]* | ?:[\\/]*) -! ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path. -! ;; -! *) -! as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -! for as_dir in $PATH -! do -! IFS=$as_save_IFS -! test -z "$as_dir" && as_dir=. -! for ac_exec_ext in '' $ac_executable_extensions; do -! if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -! ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext" -! echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -! break 2 -! fi -! done -! done -! -! ;; -! esac - fi -! FLTKCONFIG=$ac_cv_path_FLTKCONFIG - fi - - if test -n "$FLTKCONFIG"; then - echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5 -*************** -*** 4950,4957 **** ---- 4957,4966 ---- - INSTALL_GUIS="" - INSTALL_OSX="" - -+ if eval "test x$enable_fltk = xyes"; then - { echo "$as_me:$LINENO: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&5 - echo "$as_me: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&2;} -+ fi - else - CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}" - GUIS="setup uninst" -*** misc/epm-3.7/deb.c Wed Jan 15 15:29:24 2003 ---- misc/build/epm-3.7/deb.c Mon Nov 20 14:54:51 2006 -*************** -*** 26,31 **** ---- 26,53 ---- - - #include "epm.h" - -+ /* -+ * 'add_size()' - Append Installed-Size tag to DEBIAN/control file -+ */ + * Remove temporary files... +diff -urN epm-3.7-old//configure epm-3.7/configure +--- misc/epm-3.7/configure 2003-07-24 01:20:54.000000000 +0000 ++++ misc/build/epm-3.7/configure 2010-04-19 22:52:32.000000000 +0000 +@@ -1238,6 +1238,11 @@ + fi + fi; + ++# Check whether --enable-fltk or --disable-fltk was given. ++if test "${enable_fltk+set}" = set; then ++ enableval="$enable_fltk" ++fi; ++ + + # Check whether --with-docdir or --without-docdir was given. + if test "${with_docdir+set}" = set; then +@@ -4904,36 +4909,38 @@ + fi + + +-# Extract the first word of "fltk-config", so it can be a program name with args. +-set dummy fltk-config; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_path_FLTKCONFIG+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- case $FLTKCONFIG in +- [\\/]* | ?:[\\/]*) +- ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path. +- ;; +- *) +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 ++if eval "test x$enable_fltk = xyes"; then ++ # Extract the first word of "fltk-config", so it can be a program name with args. ++ set dummy fltk-config; ac_word=$2 ++ echo "$as_me:$LINENO: checking for $ac_word" >&5 ++ echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 ++ if test "${ac_cv_path_FLTKCONFIG+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++ else ++ case $FLTKCONFIG in ++ [\\/]* | ?:[\\/]*) ++ ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path. ++ ;; ++ *) ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++ for as_dir in $PATH ++ do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_path_FLTKCONFIG="$as_dir/$ac_word$ac_exec_ext" ++ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++ done ++ done + -+ int /* O - 0 = success, 1 = fail */ -+ add_size(FILE *fpControl, /* Control file stream */ -+ const char *directory) /* Directory containing all files to package */ -+ { -+ FILE *fp; -+ char command[1024]; -+ -+ snprintf(command, sizeof(command), "du -k -s %s", directory); -+ fp = popen(command, "r"); -+ if( NULL != fp ) -+ { -+ char size[1024]; -+ fscanf(fp, "%s .", size); -+ fprintf(fpControl, "Installed-Size: %s\n", size); -+ return pclose(fp); -+ } -+ return 1; -+ } - - /* - * 'make_deb()' - Make a Debian software distribution package. -*************** -*** 61,78 **** - if (Verbosity) - puts("Creating Debian distribution..."); - - if (dist->relnumber) - { - if (platname[0]) -! snprintf(name, sizeof(name), "%s-%s-%d-%s", prodname, dist->version, dist->relnumber, - platname); - else -! snprintf(name, sizeof(name), "%s-%s-%d", prodname, dist->version, dist->relnumber); - } - else if (platname[0]) -! snprintf(name, sizeof(name), "%s-%s-%s", prodname, dist->version, platname); - else -! snprintf(name, sizeof(name), "%s-%s", prodname, dist->version); - - /* - * Write the control file for DPKG... ---- 83,111 ---- - if (Verbosity) - puts("Creating Debian distribution..."); - -+ /* -+ * Use debian default naming scheme -+ */ -+ -+ if (!strcmp(platform->machine, "intel")) -+ platname = "i386"; -+ else if (!strcmp(platform->machine, "x86_64")) -+ platname = "amd64"; -+ else if (!strcmp(platform->machine, "ppc")) -+ platname = "powerpc"; ++ ;; ++ esac + fi +-done +-done +- +- ;; +-esac ++ FLTKCONFIG=$ac_cv_path_FLTKCONFIG + fi +-FLTKCONFIG=$ac_cv_path_FLTKCONFIG + + if test -n "$FLTKCONFIG"; then + echo "$as_me:$LINENO: result: $FLTKCONFIG" >&5 +@@ -4950,8 +4957,10 @@ + INSTALL_GUIS="" + INSTALL_OSX="" + ++if eval "test x$enable_fltk = xyes"; then + { echo "$as_me:$LINENO: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&5 + echo "$as_me: WARNING: Sorry, setup GUI requires FLTK 1.1.x." >&2;} ++fi + else + CXXFLAGS="`$FLTKCONFIG --cflags` ${CXXFLAGS}" + GUIS="setup uninst" +diff -urN epm-3.7-old//deb.c epm-3.7/deb.c +--- misc/epm-3.7/deb.c 2003-01-15 14:29:24.000000000 +0000 ++++ misc/build/epm-3.7/deb.c 2010-04-19 22:53:34.000000000 +0000 +@@ -26,6 +26,28 @@ + + #include "epm.h" + ++/* ++ * 'add_size()' - Append Installed-Size tag to DEBIAN/control file ++ */ + - if (dist->relnumber) - { - if (platname[0]) -! snprintf(name, sizeof(name), "%s_%s-%d_%s", prodname, dist->version, dist->relnumber, - platname); - else -! snprintf(name, sizeof(name), "%s_%s-%d", prodname, dist->version, dist->relnumber); - } - else if (platname[0]) -! snprintf(name, sizeof(name), "%s_%s_%s", prodname, dist->version, platname); - else -! snprintf(name, sizeof(name), "%s_%s", prodname, dist->version); - - /* - * Write the control file for DPKG... -*************** -*** 108,115 **** - * (which we change in get_platform to a common name) - */ - -! if (strcmp(platform->machine, "intel") == 0) - fputs("Architecture: i386\n", fp); - else - fprintf(fp, "Architecture: %s\n", platform->machine); - ---- 141,152 ---- - * (which we change in get_platform to a common name) - */ - -! if (!strcmp(platform->machine, "intel")) - fputs("Architecture: i386\n", fp); -+ else if (!strcmp(platform->machine, "x86_64")) -+ fputs("Architecture: amd64\n", fp); -+ else if (!strcmp(platform->machine, "ppc")) -+ fputs("Architecture: powerpc\n", fp); - else - fprintf(fp, "Architecture: %s\n", platform->machine); - -*************** -*** 148,156 **** - putc('\n', fp); - } - } -! - fclose(fp); -! - /* - * Write the preinst file for DPKG... - */ ---- 185,193 ---- - putc('\n', fp); - } - } -! - fclose(fp); -! - /* - * Write the preinst file for DPKG... - */ -*************** -*** 417,422 **** ---- 454,480 ---- - } - } - -+ -+ /* -+ * Calculate and append Installed-Size to DEBIAN/control -+ */ ++int /* O - 0 = success, 1 = fail */ ++add_size(FILE *fpControl, /* Control file stream */ ++ const char *directory) /* Directory containing all files to package */ ++{ ++ FILE *fp; ++ char command[1024]; + -+ if (Verbosity) -+ puts("Calculating Installed-Size..."); ++ snprintf(command, sizeof(command), "du -k -s %s", directory); ++ fp = popen(command, "r"); ++ if( NULL != fp ) ++ { ++ char size[1024]; ++ fscanf(fp, "%s .", size); ++ fprintf(fpControl, "Installed-Size: %s\n", size); ++ return pclose(fp); ++ } ++ return 1; ++} + + /* + * 'make_deb()' - Make a Debian software distribution package. +@@ -61,18 +83,37 @@ + if (Verbosity) + puts("Creating Debian distribution..."); + ++ /* ++ * Use debian default naming scheme ++ */ ++ ++ if (!strcmp(platform->machine, "intel")) ++#ifdef __FreeBSD_kernel__ ++ platname = "kfreebsd-i386"; ++#else ++ platname = "i386"; ++#endif ++ else if (!strcmp(platform->machine, "x86_64")) ++#ifdef __FreeBSD_kernel__ ++ platname = "kfreebsd-amd64"; ++#else ++ platname = "amd64"; ++#endif ++ else if (!strcmp(platform->machine, "ppc")) ++ platname = "powerpc"; ++ + if (dist->relnumber) + { + if (platname[0]) +- snprintf(name, sizeof(name), "%s-%s-%d-%s", prodname, dist->version, dist->relnumber, ++ snprintf(name, sizeof(name), "%s_%s-%d_%s", prodname, dist->version, dist->relnumber, + platname); + else +- snprintf(name, sizeof(name), "%s-%s-%d", prodname, dist->version, dist->relnumber); ++ snprintf(name, sizeof(name), "%s_%s-%d", prodname, dist->version, dist->relnumber); + } + else if (platname[0]) +- snprintf(name, sizeof(name), "%s-%s-%s", prodname, dist->version, platname); ++ snprintf(name, sizeof(name), "%s_%s_%s", prodname, dist->version, platname); + else +- snprintf(name, sizeof(name), "%s-%s", prodname, dist->version); ++ snprintf(name, sizeof(name), "%s_%s", prodname, dist->version); + + /* + * Write the control file for DPKG... +@@ -108,8 +141,20 @@ + * (which we change in get_platform to a common name) + */ + +- if (strcmp(platform->machine, "intel") == 0) ++ if (!strcmp(platform->machine, "intel")) ++#ifdef __FreeBSD_kernel__ ++ fputs("Architecture: kfreebsd-i386\n", fp); ++#else + fputs("Architecture: i386\n", fp); ++#endif ++ else if (!strcmp(platform->machine, "x86_64")) ++#ifdef __FreeBSD_kernel__ ++ fputs("Architecture: kfreebsd-amd64\n", fp); ++#else ++ fputs("Architecture: amd64\n", fp); ++#endif ++ else if (!strcmp(platform->machine, "ppc")) ++ fputs("Architecture: powerpc\n", fp); + else + fprintf(fp, "Architecture: %s\n", platform->machine); + +@@ -148,9 +193,9 @@ + putc('\n', fp); + } + } +- ++ + fclose(fp); +- ++ + /* + * Write the preinst file for DPKG... + */ +@@ -417,6 +462,27 @@ + } + } + ++ ++ /* ++ * Calculate and append Installed-Size to DEBIAN/control ++ */ + -+ snprintf(filename, sizeof(filename), "%s/%s/DEBIAN/control", directory, name); -+ if ((fp = fopen(filename, "a")) == NULL) -+ { -+ fprintf(stderr, "epm: Unable to Installed-Size to file \"%s\" - %s\n", filename, -+ strerror(errno)); -+ return (1); -+ } -+ -+ snprintf(filename, sizeof(filename), "%s/%s", directory, name); -+ add_size(fp, filename); -+ fclose(fp); ++ if (Verbosity) ++ puts("Calculating Installed-Size..."); + ++ snprintf(filename, sizeof(filename), "%s/%s/DEBIAN/control", directory, name); ++ if ((fp = fopen(filename, "a")) == NULL) ++ { ++ fprintf(stderr, "epm: Unable to Installed-Size to file \"%s\" - %s\n", filename, ++ strerror(errno)); ++ return (1); ++ } ++ ++ snprintf(filename, sizeof(filename), "%s/%s", directory, name); ++ add_size(fp, filename); ++ fclose(fp); + - /* - * Build the distribution from the spec file... - */ -*** misc/epm-3.7/dist.c Thu Aug 7 16:14:40 2003 ---- misc/build/epm-3.7/dist.c Mon Nov 20 14:54:51 2006 -*************** -*** 394,401 **** - strcpy(platform->machine, "mips"); - #elif defined(__hpux) - strcpy(platform->machine, "hppa"); -! #elif defined(_AIX) || defined(__APPLE__) - strcpy(platform->machine, "powerpc"); - #else - for (temp = platform->machine; *temp != '\0'; temp ++) - if (*temp == '-' || *temp == '_') ---- 394,406 ---- - strcpy(platform->machine, "mips"); - #elif defined(__hpux) - strcpy(platform->machine, "hppa"); -! #elif defined(_AIX) - strcpy(platform->machine, "powerpc"); -+ #elif defined(__APPLE__) -+ if (strstr(platform->machine, "86") != NULL) -+ strcpy(platform->machine, "intel"); -+ else -+ strcpy(platform->machine, "powerpc"); - #else - for (temp = platform->machine; *temp != '\0'; temp ++) - if (*temp == '-' || *temp == '_') -*************** -*** 407,413 **** - *temp = tolower(*temp); - - if (strstr(platform->machine, "86") != NULL) -! strcpy(platform->machine, "intel"); - else if (strncmp(platform->machine, "sun", 3) == 0) - strcpy(platform->machine, "sparc"); - #endif /* __sgi */ ---- 412,423 ---- - *temp = tolower(*temp); - - if (strstr(platform->machine, "86") != NULL) -! { -! if (strstr(platform->machine, "64") != NULL) -! strcpy(platform->machine, "x86_64"); -! else -! strcpy(platform->machine, "intel"); -! } - else if (strncmp(platform->machine, "sun", 3) == 0) - strcpy(platform->machine, "sparc"); - #endif /* __sgi */ -*** misc/epm-3.7/epm.c Tue Oct 28 15:48:30 2003 ---- misc/build/epm-3.7/epm.c Mon Nov 20 14:54:51 2006 -*************** -*** 547,552 **** ---- 547,553 ---- - { - puts(EPM_VERSION); - puts("Copyright 1999-2003 by Easy Software Products."); -+ puts("Patched for OpenOffice.org"); - puts(""); - puts("EPM is free software and comes with ABSOLUTELY NO WARRANTY; for details"); - puts("see the GNU General Public License in the file COPYING or at"); -*** misc/epm-3.7/file.c Wed Jul 23 23:41:08 2003 ---- misc/build/epm-3.7/file.c Mon Nov 20 14:54:51 2006 -*************** -*** 108,114 **** - fclose(dstfile); - - chmod(dst, mode); -- chown(dst, owner, group); - - return (0); - } ---- 108,113 ---- -*************** -*** 138,144 **** - { - mkdir(buffer, 0777); - chmod(buffer, mode | 0700); -- chown(buffer, owner, group); - } - } - ---- 137,142 ---- -*************** -*** 151,157 **** - { - mkdir(buffer, 0777); - chmod(buffer, mode | 0700); -- chown(buffer, owner, group); - } - - return (0); ---- 149,154 ---- -*** misc/epm-3.7/osx.c Wed Jul 23 23:41:08 2003 ---- misc/build/epm-3.7/osx.c Mon Nov 20 14:54:51 2006 -*************** -*** 373,379 **** - else - snprintf(filename, sizeof(filename), "%s/%s", current, directory); - -! run_command(NULL, "/Developer/Applications/PackageMaker.app/" - "Contents/MacOS/PackageMaker -build " - "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist", - filename, prodname, filename, filename, filename, prodname, filename, prodname); ---- 373,379 ---- - else - snprintf(filename, sizeof(filename), "%s/%s", current, directory); - -! run_command(NULL, "/Developer/Applications/Utilities/PackageMaker.app/" - "Contents/MacOS/PackageMaker -build " - "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist", - filename, prodname, filename, filename, filename, prodname, filename, prodname); -*** misc/epm-3.7/pkg.c Tue Dec 17 19:57:56 2002 ---- misc/build/epm-3.7/pkg.c Mon Nov 20 14:54:51 2006 -*************** -*** 429,503 **** - - fclose(fp); - -- /* -- * Build the distribution from the prototype file... -- */ -- -- if (Verbosity) -- puts("Building PKG binary distribution..."); -- -- if (run_command(NULL, "pkgmk -o -f %s/%s.prototype -d %s/%s", -- directory, prodname, current, directory)) -- return (1); -- -- /* -- * Tar and compress the distribution... -- */ -- -- if (Verbosity) -- puts("Creating tar.gz file for distribution..."); -- -- snprintf(filename, sizeof(filename), "%s/%s.tar.gz", directory, name); -- -- if ((tarfile = tar_open(filename, 1)) == NULL) -- return (1); -- -- snprintf(filename, sizeof(filename), "%s/%s", directory, prodname); -- -- if (tar_directory(tarfile, filename, prodname)) -- { -- tar_close(tarfile); -- return (1); -- } -- -- tar_close(tarfile); -- -- /* -- * Make a package stream file... -- */ -- -- if (Verbosity) -- puts("Copying into package stream file..."); -- -- if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s", -- current, directory, name, prodname)) -- return (1); -- -- /* -- * Remove temporary files... -- */ -- -- if (!KeepFiles) -- { -- if (Verbosity) -- puts("Removing temporary distribution files..."); -- -- snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname); -- unlink(filename); -- snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname); -- unlink(filename); -- snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname); -- unlink(filename); -- if (preinstall[0]) -- unlink(preinstall); -- if (postinstall[0]) -- unlink(postinstall); -- if (preremove[0]) -- unlink(preremove); -- if (postremove[0]) -- unlink(postremove); -- } -- - return (0); - } - ---- 429,434 ---- -*** misc/epm-3.7/qprintf.c Mon Jan 27 22:48:03 2003 ---- misc/build/epm-3.7/qprintf.c Mon Nov 20 14:54:51 2006 -*************** -*** 181,192 **** - - for (i = slen; i > 0; i --, s ++, bytes ++) - { - if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s)) - { - putc('\\', fp); - bytes ++; - } -! - putc(*s, fp); - } - ---- 181,199 ---- - - for (i = slen; i > 0; i --, s ++, bytes ++) - { -+ #if defined(__FreeBSD__) -+ if (strchr("`~!#%^&*()[{]}\\|;\'\"<>? ", *s)) -+ { -+ putc('\\', fp); -+ bytes ++; -+ } -+ #else - if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s)) - { - putc('\\', fp); - bytes ++; - } -! #endif - putc(*s, fp); - } - -*** misc/epm-3.7/rpm.c Wed Oct 1 21:27:15 2003 ---- misc/build/epm-3.7/rpm.c Mon Nov 20 14:54:51 2006 -*************** -*** 38,44 **** - dist_t *dist, /* I - Distribution information */ - struct utsname *platform) /* I - Platform information */ - { -! int i; /* Looping var */ - FILE *fp; /* Spec file */ - char name[1024]; /* Full product name */ - char specname[1024]; /* Spec filename */ ---- 38,44 ---- - dist_t *dist, /* I - Distribution information */ - struct utsname *platform) /* I - Platform information */ - { -! int i,n; /* Looping vars */ - FILE *fp; /* Spec file */ - char name[1024]; /* Full product name */ - char specname[1024]; /* Spec filename */ -*************** -*** 160,165 **** ---- 160,167 ---- - fprintf(fp, "Requires: %s", dname); - else if (d->type == DEPEND_PROVIDES) - fprintf(fp, "Provides: %s", dname); -+ else if (d->type == DEPEND_REPLACES) -+ fprintf(fp, "Obsoletes: %s", dname); - else - fprintf(fp, "Conflicts: %s", dname); - -*************** -*** 186,200 **** - for (i = 0; i < dist->num_descriptions; i ++) - fprintf(fp, "%s\n", dist->descriptions[i]); - -! fputs("%pre\n", fp); - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) - if (c->type == COMMAND_PRE_INSTALL) - fprintf(fp, "%s\n", c->command); - -! fputs("%post\n", fp); - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) - if (c->type == COMMAND_POST_INSTALL) - fprintf(fp, "%s\n", c->command); - - for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) - if (tolower(file->type) == 'i') ---- 188,220 ---- - for (i = 0; i < dist->num_descriptions; i ++) - fprintf(fp, "%s\n", dist->descriptions[i]); - -! /* -! * %pre -! */ -! n = 0; - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) -+ { - if (c->type == COMMAND_PRE_INSTALL) -+ { -+ if (1 == ++n) /* Only write %pre if there is at least one command */ -+ fputs("%pre\n", fp); - fprintf(fp, "%s\n", c->command); -+ } -+ } - -! /* -! * %post -! */ -! n = 0; - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) -+ { - if (c->type == COMMAND_POST_INSTALL) -+ { -+ if (1 == ++n) /* Only write %post if there is at least one command */ -+ fputs("%post\n", fp); - fprintf(fp, "%s\n", c->command); -+ } -+ } - - for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) - if (tolower(file->type) == 'i') -*************** -*** 202,207 **** ---- 222,229 ---- - - if (i) - { -+ if (1 == ++n) /* If not previously done so, write %post here */ -+ fputs("%post\n", fp); - fputs("if test \"x$1\" = x1; then\n", fp); - fputs(" echo Setting up init scripts...\n", fp); - -*************** -*** 259,265 **** - fputs("fi\n", fp); - } - -! fputs("%preun\n", fp); - for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) - if (tolower(file->type) == 'i') - break; ---- 281,290 ---- - fputs("fi\n", fp); - } - -! /* -! * %preun -! */ -! n = 0; - for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) - if (tolower(file->type) == 'i') - break; -*************** -*** 266,271 **** ---- 291,297 ---- - - if (i) - { -+ fputs("%preun\n", fp); ++n; /* Need to write %preun here */ - fputs("if test \"x$1\" = x0; then\n", fp); - fputs(" echo Cleaning up init scripts...\n", fp); - -*************** -*** 315,327 **** - } - - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) - if (c->type == COMMAND_PRE_REMOVE) - fprintf(fp, "%s\n", c->command); - -! fputs("%postun\n", fp); - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) - if (c->type == COMMAND_POST_REMOVE) - fprintf(fp, "%s\n", c->command); - - fputs("%files\n", fp); - for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) ---- 341,369 ---- - } - - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) -+ { - if (c->type == COMMAND_PRE_REMOVE) -+ { -+ if (1 == ++n) /* Only write %preun if not previously done so */ -+ fputs("%preun\n", fp); -+ - fprintf(fp, "%s\n", c->command); -+ } -+ } - -! /* -! * %post -! */ -! n = 0; - for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) -+ { - if (c->type == COMMAND_POST_REMOVE) -+ { -+ if (1 == ++n) /* Only write %post if there is at least one command */ -+ fputs("%postun\n", fp); - fprintf(fp, "%s\n", c->command); -+ } -+ } - - fputs("%files\n", fp); - for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) -*************** -*** 415,467 **** - } - } - -- /* -- * Build the distribution from the spec file... -- */ -- -- if (Verbosity) -- puts("Building RPM binary distribution..."); -- -- if (strcmp(platform->machine, "intel") == 0) -- { -- if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "i386 %s", -- Verbosity == 0 ? "--quiet" : "", specname)) -- return (1); -- } -- else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s", -- Verbosity == 0 ? "--quiet" : "", platform->machine, -- specname)) -- return (1); -- -- /* -- * Move the RPM to the local directory and rename the RPM using the -- * product name specified by the user... -- */ -- -- if (strcmp(platform->machine, "intel") == 0) -- run_command(NULL, "/bin/mv %s/RPMS/i386/%s-%s-%d.i386.rpm %s/%s.rpm", -- rpmdir, prodname, dist->version, dist->relnumber, -- directory, name); -- else -- run_command(NULL, "/bin/mv %s/RPMS/%s/%s-%s-%d.%s.rpm %s/%s.rpm", -- rpmdir, platform->machine, prodname, dist->version, -- dist->relnumber, platform->machine, directory, name); -- -- /* -- * Remove temporary files... -- */ -- -- if (!KeepFiles) -- { -- if (Verbosity) -- puts("Removing temporary distribution files..."); -- -- run_command(NULL, "/bin/rm -rf %s/RPMS", directory); -- run_command(NULL, "/bin/rm -rf %s/buildroot", directory); -- -- unlink(specname); -- } -- - return (0); - } - ---- 457,462 ---- ++ + /* + * Build the distribution from the spec file... + */ +diff -urN epm-3.7-old//dist.c epm-3.7/dist.c +--- misc/epm-3.7/dist.c 2003-08-07 14:14:40.000000000 +0000 ++++ misc/build/epm-3.7/dist.c 2010-04-19 22:52:32.000000000 +0000 +@@ -394,8 +394,13 @@ + strcpy(platform->machine, "mips"); + #elif defined(__hpux) + strcpy(platform->machine, "hppa"); +-#elif defined(_AIX) || defined(__APPLE__) ++#elif defined(_AIX) + strcpy(platform->machine, "powerpc"); ++#elif defined(__APPLE__) ++ if (strstr(platform->machine, "86") != NULL) ++ strcpy(platform->machine, "intel"); ++ else ++ strcpy(platform->machine, "powerpc"); + #else + for (temp = platform->machine; *temp != '\0'; temp ++) + if (*temp == '-' || *temp == '_') +@@ -407,7 +412,12 @@ + *temp = tolower(*temp); + + if (strstr(platform->machine, "86") != NULL) +- strcpy(platform->machine, "intel"); ++ { ++ if (strstr(platform->machine, "64") != NULL) ++ strcpy(platform->machine, "x86_64"); ++ else ++ strcpy(platform->machine, "intel"); ++ } + else if (strncmp(platform->machine, "sun", 3) == 0) + strcpy(platform->machine, "sparc"); + #endif /* __sgi */ +diff -urN epm-3.7-old//epm.c epm-3.7/epm.c +--- misc/epm-3.7/epm.c 2003-10-28 14:48:30.000000000 +0000 ++++ misc/build/epm-3.7/epm.c 2010-04-19 22:52:32.000000000 +0000 +@@ -547,6 +547,7 @@ + { + puts(EPM_VERSION); + puts("Copyright 1999-2003 by Easy Software Products."); ++ puts("Patched for OpenOffice.org"); + puts(""); + puts("EPM is free software and comes with ABSOLUTELY NO WARRANTY; for details"); + puts("see the GNU General Public License in the file COPYING or at"); +diff -urN epm-3.7-old//file.c epm-3.7/file.c +--- misc/epm-3.7/file.c 2003-07-23 21:41:08.000000000 +0000 ++++ misc/build/epm-3.7/file.c 2010-04-19 22:52:32.000000000 +0000 +@@ -108,7 +108,6 @@ + fclose(dstfile); + + chmod(dst, mode); +- chown(dst, owner, group); + + return (0); + } +@@ -138,7 +137,6 @@ + { + mkdir(buffer, 0777); + chmod(buffer, mode | 0700); +- chown(buffer, owner, group); + } + } + +@@ -151,7 +149,6 @@ + { + mkdir(buffer, 0777); + chmod(buffer, mode | 0700); +- chown(buffer, owner, group); + } + + return (0); +diff -urN epm-3.7-old//osx.c epm-3.7/osx.c +--- misc/epm-3.7/osx.c 2003-07-23 21:41:08.000000000 +0000 ++++ misc/build/epm-3.7/osx.c 2010-04-19 22:52:32.000000000 +0000 +@@ -373,7 +373,7 @@ + else + snprintf(filename, sizeof(filename), "%s/%s", current, directory); + +- run_command(NULL, "/Developer/Applications/PackageMaker.app/" ++ run_command(NULL, "/Developer/Applications/Utilities/PackageMaker.app/" + "Contents/MacOS/PackageMaker -build " + "-p %s/%s.pkg -f %s/Package -r %s/Resources -d %s/%s-desc.plist -i %s/%s-info.plist", + filename, prodname, filename, filename, filename, prodname, filename, prodname); +diff -urN epm-3.7-old//pkg.c epm-3.7/pkg.c +--- misc/epm-3.7/pkg.c 2002-12-17 18:57:56.000000000 +0000 ++++ misc/build/epm-3.7/pkg.c 2010-04-19 22:52:32.000000000 +0000 +@@ -429,75 +429,6 @@ + + fclose(fp); + +- /* +- * Build the distribution from the prototype file... +- */ +- +- if (Verbosity) +- puts("Building PKG binary distribution..."); +- +- if (run_command(NULL, "pkgmk -o -f %s/%s.prototype -d %s/%s", +- directory, prodname, current, directory)) +- return (1); +- +- /* +- * Tar and compress the distribution... +- */ +- +- if (Verbosity) +- puts("Creating tar.gz file for distribution..."); +- +- snprintf(filename, sizeof(filename), "%s/%s.tar.gz", directory, name); +- +- if ((tarfile = tar_open(filename, 1)) == NULL) +- return (1); +- +- snprintf(filename, sizeof(filename), "%s/%s", directory, prodname); +- +- if (tar_directory(tarfile, filename, prodname)) +- { +- tar_close(tarfile); +- return (1); +- } +- +- tar_close(tarfile); +- +- /* +- * Make a package stream file... +- */ +- +- if (Verbosity) +- puts("Copying into package stream file..."); +- +- if (run_command(directory, "pkgtrans -s %s/%s %s.pkg %s", +- current, directory, name, prodname)) +- return (1); +- +- /* +- * Remove temporary files... +- */ +- +- if (!KeepFiles) +- { +- if (Verbosity) +- puts("Removing temporary distribution files..."); +- +- snprintf(filename, sizeof(filename), "%s/%s.pkginfo", directory, prodname); +- unlink(filename); +- snprintf(filename, sizeof(filename), "%s/%s.depend", directory, prodname); +- unlink(filename); +- snprintf(filename, sizeof(filename), "%s/%s.prototype", directory, prodname); +- unlink(filename); +- if (preinstall[0]) +- unlink(preinstall); +- if (postinstall[0]) +- unlink(postinstall); +- if (preremove[0]) +- unlink(preremove); +- if (postremove[0]) +- unlink(postremove); +- } +- + return (0); + } + +diff -urN epm-3.7-old//qprintf.c epm-3.7/qprintf.c +--- misc/epm-3.7-old/qprintf.c 2003-01-27 21:48:03.000000000 +0000 ++++ misc/build/epm-3.7/qprintf.c 2010-04-19 22:52:32.000000000 +0000 +@@ -181,12 +181,19 @@ + + for (i = slen; i > 0; i --, s ++, bytes ++) + { ++#if defined(__FreeBSD__) ++ if (strchr("`~!#%^&*()[{]}\\|;\'\"<>? ", *s)) ++ { ++ putc('\\', fp); ++ bytes ++; ++ } ++#else + if (strchr("`~!#$%^&*()[{]}\\|;\'\"<>? ", *s)) + { + putc('\\', fp); + bytes ++; + } +- ++#endif + putc(*s, fp); + } + +diff -urN epm-3.7-old//rpm.c epm-3.7/rpm.c +--- misc/epm-3.7/rpm.c 2003-10-01 19:27:15.000000000 +0000 ++++ misc/build/epm-3.7/rpm.c 2010-04-19 22:52:32.000000000 +0000 +@@ -38,7 +38,7 @@ + dist_t *dist, /* I - Distribution information */ + struct utsname *platform) /* I - Platform information */ + { +- int i; /* Looping var */ ++ int i,n; /* Looping vars */ + FILE *fp; /* Spec file */ + char name[1024]; /* Full product name */ + char specname[1024]; /* Spec filename */ +@@ -160,6 +160,8 @@ + fprintf(fp, "Requires: %s", dname); + else if (d->type == DEPEND_PROVIDES) + fprintf(fp, "Provides: %s", dname); ++ else if (d->type == DEPEND_REPLACES) ++ fprintf(fp, "Obsoletes: %s", dname); + else + fprintf(fp, "Conflicts: %s", dname); + +@@ -186,15 +188,33 @@ + for (i = 0; i < dist->num_descriptions; i ++) + fprintf(fp, "%s\n", dist->descriptions[i]); + +- fputs("%pre\n", fp); ++ /* ++ * %pre ++ */ ++ n = 0; + for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) ++ { + if (c->type == COMMAND_PRE_INSTALL) ++ { ++ if (1 == ++n) /* Only write %pre if there is at least one command */ ++ fputs("%pre\n", fp); + fprintf(fp, "%s\n", c->command); ++ } ++ } + +- fputs("%post\n", fp); ++ /* ++ * %post ++ */ ++ n = 0; + for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) ++ { + if (c->type == COMMAND_POST_INSTALL) ++ { ++ if (1 == ++n) /* Only write %post if there is at least one command */ ++ fputs("%post\n", fp); + fprintf(fp, "%s\n", c->command); ++ } ++ } + + for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) + if (tolower(file->type) == 'i') +@@ -202,6 +222,8 @@ + + if (i) + { ++ if (1 == ++n) /* If not previously done so, write %post here */ ++ fputs("%post\n", fp); + fputs("if test \"x$1\" = x1; then\n", fp); + fputs(" echo Setting up init scripts...\n", fp); + +@@ -259,13 +281,17 @@ + fputs("fi\n", fp); + } + +- fputs("%preun\n", fp); ++ /* ++ * %preun ++ */ ++ n = 0; + for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) + if (tolower(file->type) == 'i') + break; + + if (i) + { ++ fputs("%preun\n", fp); ++n; /* Need to write %preun here */ + fputs("if test \"x$1\" = x0; then\n", fp); + fputs(" echo Cleaning up init scripts...\n", fp); + +@@ -315,13 +341,29 @@ + } + + for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) ++ { + if (c->type == COMMAND_PRE_REMOVE) ++ { ++ if (1 == ++n) /* Only write %preun if not previously done so */ ++ fputs("%preun\n", fp); ++ + fprintf(fp, "%s\n", c->command); ++ } ++ } + +- fputs("%postun\n", fp); ++ /* ++ * %post ++ */ ++ n = 0; + for (i = dist->num_commands, c = dist->commands; i > 0; i --, c ++) ++ { + if (c->type == COMMAND_POST_REMOVE) ++ { ++ if (1 == ++n) /* Only write %post if there is at least one command */ ++ fputs("%postun\n", fp); + fprintf(fp, "%s\n", c->command); ++ } ++ } + + fputs("%files\n", fp); + for (i = dist->num_files, file = dist->files; i > 0; i --, file ++) +@@ -415,53 +457,6 @@ + } + } + +- /* +- * Build the distribution from the spec file... +- */ +- +- if (Verbosity) +- puts("Building RPM binary distribution..."); +- +- if (strcmp(platform->machine, "intel") == 0) +- { +- if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "i386 %s", +- Verbosity == 0 ? "--quiet" : "", specname)) +- return (1); +- } +- else if (run_command(NULL, EPM_RPMBUILD " %s -bb " EPM_RPMARCH "%s %s", +- Verbosity == 0 ? "--quiet" : "", platform->machine, +- specname)) +- return (1); +- +- /* +- * Move the RPM to the local directory and rename the RPM using the +- * product name specified by the user... +- */ +- +- if (strcmp(platform->machine, "intel") == 0) +- run_command(NULL, "/bin/mv %s/RPMS/i386/%s-%s-%d.i386.rpm %s/%s.rpm", +- rpmdir, prodname, dist->version, dist->relnumber, +- directory, name); +- else +- run_command(NULL, "/bin/mv %s/RPMS/%s/%s-%s-%d.%s.rpm %s/%s.rpm", +- rpmdir, platform->machine, prodname, dist->version, +- dist->relnumber, platform->machine, directory, name); +- +- /* +- * Remove temporary files... +- */ +- +- if (!KeepFiles) +- { +- if (Verbosity) +- puts("Removing temporary distribution files..."); +- +- run_command(NULL, "/bin/rm -rf %s/RPMS", directory); +- run_command(NULL, "/bin/rm -rf %s/buildroot", directory); +- +- unlink(specname); +- } +- + return (0); + } + diff --git a/epm/makefile.mk b/epm/makefile.mk index 5f4f93d..a33f607 100644 --- a/epm/makefile.mk +++ b/epm/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,6 +37,7 @@ TARGET=epm # --- Files -------------------------------------------------------- TARFILE_NAME=epm-3.7 +TARFILE_MD5=3ade8cfe7e59ca8e65052644fed9fca4 PATCH_FILES=epm-3.7.patch .IF "$(GUI)"=="UNX" && "$(BUILD_EPM)" != "NO" diff --git a/external/StAX/README_jsr173_1.0_api.jar b/external/StAX/README_jsr173_1.0_api.jar deleted file mode 100644 index 7df7eb0..0000000 --- a/external/StAX/README_jsr173_1.0_api.jar +++ /dev/null @@ -1,3 +0,0 @@ -The JSR173 is the XML pull API used at build time for the saxon9 XSLT processor, it has become part of OpenJDK 6.
-When using an older JDK, get the API from <https://stax-utils.dev.java.net/source/browse/*checkout*/stax-utils/lib/jars/jsr173_1.0_api.jar>
-located at the StAS Java site <https://sjsxp.dev.java.net/> and put it into external/StAX.
\ No newline at end of file diff --git a/external/download/glibc-2.1.3-stub.tar.gz b/external/download/glibc-2.1.3-stub.tar.gz Binary files differdeleted file mode 100644 index 8ffc40d..0000000 --- a/external/download/glibc-2.1.3-stub.tar.gz +++ /dev/null diff --git a/external/gcc3_specific/makefile.mk b/external/gcc3_specific/makefile.mk index 889b61c..23940c3 100644 --- a/external/gcc3_specific/makefile.mk +++ b/external/gcc3_specific/makefile.mk @@ -13,11 +13,29 @@ TARGET=gcc3_specific .IF "$(COM)" == "GCC" -all : $(BIN)$/mingwm10.dll +.IF "$(MINGW_SHARED_GCCLIB)" == "YES" +MINGWGCCDLL=$(BIN)$/$(MINGW_GCCDLL) +.ENDIF + +.IF "$(MINGW_SHARED_GXXLIB)" == "YES" +MINGWGXXDLL=$(BIN)$/$(MINGW_GXXDLL) +.ENDIF + +all : $(BIN)$/mingwm10.dll $(MINGWGCCDLL) $(MINGWGXXDLL) $(BIN)$/mingwm10.dll : $(COPY) -p $(COMPATH)$/bin$/mingwm10.dll $(BIN)$/ +.IF "$(MINGW_SHARED_GCCLIB)" == "YES" +$(MINGWGCCDLL) : + $(COPY) -p $(COMPATH)$/bin$/$(MINGW_GCCDLL) $(BIN)$/ +.ENDIF + +.IF "$(MINGW_SHARED_GXXLIB)" == "YES" +$(MINGWGXXDLL) : + $(COPY) -p $(COMPATH)$/bin$/$(MINGW_GXXDLL) $(BIN)$/ +.ENDIF + .ENDIF .ELSE @@ -25,23 +43,21 @@ $(BIN)$/mingwm10.dll : .IF "$(SYSTEM_STDLIBS)" != "YES" && "$(COMID)"=="gcc3" .IF "$(OS)"!="MACOSX" -.IF "$(OS)"!="IRIX" .IF "$(OS)"!="FREEBSD" .EXPORT : CC -all .SEQUENTIAL : $(LB)$/libstdc++.so.$(SHORTSTDCPP3) $(LB)$/libgcc_s.so.1 +all .SEQUENTIAL : $(LB)$/libstdc++.so.$(SHORTSTDCPP3) $(LB)$/libgcc_s.so.$(SHORTSTDC3) $(LB)$/libstdc++.so.$(SHORTSTDCPP3) : - $(GCCINSTLIB) libstdc++.so.$(SHORTSTDCPP3) $(LB) + $(GCCINSTLIB) libstdc++.so.$(SHORTSTDCPP3) $(LB) -$(LB)$/libgcc_s.so.1 : - $(GCCINSTLIB) libgcc_s.so.1 $(LB) +$(LB)$/libgcc_s.so.$(SHORTSTDC3) : + $(GCCINSTLIB) libgcc_s.so.$(SHORTSTDC3) $(LB) .ENDIF .ENDIF -.ENDIF .ENDIF diff --git a/external/glibc-2.1.3.patch b/external/glibc-2.1.3.patch index 4faa30a..dddc22a 100644 --- a/external/glibc-2.1.3.patch +++ b/external/glibc-2.1.3.patch @@ -1,18 +1,15 @@ --- misc/glibc-2.1.3/posix/config.h Mon Mar 31 09:43:50 2008 +++ misc/build/glibc-2.1.3/posix/config.h Mon Mar 31 09:43:26 2008 -@@ -1 +1,45 @@ +@@ -1 +1,42 @@ -dummy +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * -+ * Copyright 2008 by Sun Microsystems, Inc. ++ * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * -+ * $RCSfile: glibc-2.1.3.patch,v $ -+ * $Revision: 1.5 $ -+ * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify @@ -79,20 +76,16 @@ extern int getopt (); --- misc/glibc-2.1.3/posix/makefile.mk Mon Mar 31 09:43:50 2008 +++ misc/build/glibc-2.1.3/posix/makefile.mk Mon Mar 31 09:43:38 2008 -@@ -1 +1,67 @@ +@@ -1 +1,70 @@ -dummy +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# -+# Copyright 2008 by Sun Microsystems, Inc. ++# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# -+# $RCSfile: glibc-2.1.3.patch,v $ -+# -+# $Revision: 1.5 $ -+# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify @@ -130,14 +123,16 @@ + +# --- Files -------------------------------------------------------- + ++.IF "$(HAVE_GETOPT)" != "YES" +OBJFILES= $(OBJ)$/getopt.obj \ + $(OBJ)$/getopt1.obj + +LIB1TARGET=$(SLB)$/$(TARGET).lib +LIB1ARCHIV=$(LB)$/lib$(TARGET).a +LIB1OBJFILES=$(OBJFILES) ++.ENDIF + -+.IF "$(OS)"=="NETBSD" ++.IF "$(HAVE_READDIR_R)" != "YES" && "$(OS)" != "WNT" +TARGET2=gnu_readdir_r +OBJFILES+= $(OBJ)$/readdir_r.obj +LIB2TARGET=$(SLB)$/$(TARGET2).lib @@ -145,6 +140,11 @@ +LIB2OBJFILES= $(OBJ)$/readdir_r.obj +.ENDIF + ++.IF "$(HAVE_READDIR_R)" == "YES" && "$(HAVE_GETOPT)" == "YES" ++@all: ++ @echo "Nothing to do here. ++.ENDIF ++ +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/external/glibc/makefile.mk b/external/glibc/makefile.mk index 8940a0c..04e2ff5 100644 --- a/external/glibc/makefile.mk +++ b/external/glibc/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.10 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -40,9 +36,14 @@ TARGET=getopt # --- Files -------------------------------------------------------- +.IF "$(HAVE_GETOPT)" != "YES" || "$(HAVE_READDIR_R)" != "YES" TARFILE_NAME=glibc-2.1.3-stub +TARFILE_MD5=4a660ce8466c9df01f19036435425c3a TARFILE_ROOTDIR=glibc-2.1.3 -ADDITIONAL_FILES=posix$/makefile.mk posix$/config.h posix$/readdir_r.c +ADDITIONAL_FILES=posix$/makefile.mk posix$/config.h +.IF "$(HAVE_READDIR_R)" != "YES" +ADDITIONAL_FILES += posix$/readdir_r.c +.ENDIF PATCH_FILES=$(PRJ)$/glibc-2.1.3.patch @@ -52,6 +53,15 @@ CONFIGURE_ACTION= BUILD_DIR=posix BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) +OUT2INC= \ + posix/getopt.h \ + posix/config.h + +.ELSE +@all: + @echo "Nothing to do here." +.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : set_ext.mk diff --git a/external/mingwheaders/makefile.mk b/external/mingwheaders/makefile.mk index 9214303..ccfc958 100644 --- a/external/mingwheaders/makefile.mk +++ b/external/mingwheaders/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8.10.1 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -56,116 +52,106 @@ ATL_INCLUDE_DIR=$(PSDK_HOME)$/include$/atl$/ DIRECTXSDK_INCLUDE_DIR=$(DIRECTXSDK_HOME)$/include$/ -FILES_TO_COPY_FROM_MINGW=excpt.h \ - tchar.h - -FILES_TO_COPY_FROM_W32API=amvideo.h \ - bdatypes.h \ - imm.h \ - oaidl.h \ - objfwd.h \ - objidl.h \ - uxtheme.h \ - winbase.h \ - wininet.h \ - winnt.h \ - winver.h \ - wtypes.h - -FILES_TO_COPY_FROM_SYS=stat.h - -FILES_TO_COPY_FROM_PSDK=adoctint.h \ - adodef.h \ - adoguids.h \ - adoint.h \ - bcrypt.h \ - commctrl.h \ - control.h \ - filter.h \ - gdiplusbitmap.h \ - gdiplusbrush.h \ - gdiplusenums.h \ - gdiplusfont.h \ - gdiplusheaders.h \ - gdiplusimageattributes.h \ - gdiplusimaging.h \ - gdiplusmatrix.h \ - gdipluspath.h \ - gdipluspen.h \ - gdiplusregion.h \ - gdiplusstringformat.h \ - imagehlp.h \ - inaddr.h \ - intsafe.h \ - mapinls.h \ - mapiwin.h \ - msdasc.h \ - msi.h \ - msiquery.h \ - multimon.h \ - ncrypt.h \ - ntquery.h \ - ocidl.h \ - oledb.h \ - oleidl.h \ - propidl.h \ - propkeydef.h \ - propsys.h \ - qedit.h \ - shlobj.h \ - shobjidl.h \ - shtypes.h \ - specstrings.h \ - specstrings_adt.h \ - specstrings_strict.h \ - sspi.h \ - strmif.h \ - strsafe.h \ - structuredquery.h \ - urlmon.h \ - wincrypt.h \ - wingdi.h \ - winsock2.h \ - winuser.h \ - ws2def.h \ - ws2ipdef.h \ - ws2tcpip.h \ - wspiapi.h \ - adoid.h \ - amstream.h \ - austream.h \ - ddstream.h \ - dispex.h \ - dshow.h \ - exdispid.h \ - gdiplus.h \ - mmstream.h \ - msxml.h \ - oleauto.h \ - olectl.h \ - qos.h \ - shlguid.h \ - transact.h \ - winerror.h +FILES_TO_COPY_FROM_MINGW= \ + excpt.h \ + tchar.h + +FILES_TO_COPY_FROM_W32API= \ + amvideo.h \ + basetyps.h \ + objidl.h \ + specstrings.h \ + uxtheme.h \ + winbase.h \ + windef.h \ + wininet.h \ + winver.h \ + wtypes.h + +FILES_TO_COPY_FROM_SYS= \ + stat.h + +FILES_TO_COPY_FROM_PSDK= \ + adoctint.h \ + adodef.h \ + adoguids.h \ + adoint.h \ + bcrypt.h \ + commctrl.h \ + control.h \ + dispex.h \ + filter.h \ + gdiplusbitmap.h \ + gdiplusbrush.h \ + gdiplusenums.h \ + gdiplusfont.h \ + gdiplusheaders.h \ + gdiplusimageattributes.h \ + gdiplusimaging.h \ + gdiplusmatrix.h \ + gdipluspath.h \ + gdipluspen.h \ + gdiplusregion.h \ + gdiplusstringformat.h \ + imm.h \ + imagehlp.h \ + mapiwin.h \ + msdasc.h \ + msi.h \ + msiquery.h \ + multimon.h \ + ntquery.h \ + oaidl.h \ + ocidl.h \ + oleauto.h \ + olectl.h \ + oledb.h \ + oleidl.h \ + propidl.h \ + propkeydef.h \ + propsys.h \ + propvarutil.h \ + shlobj.h \ + shobjidl.h \ + shtypes.h \ + sspi.h \ + strmif.h \ + strsafe.h \ + structuredquery.h \ + urlmon.h \ + wincrypt.h \ + winerror.h \ + wingdi.h \ + wintrust.h \ + winuser.h \ + wspiapi.h \ + exdispid.h \ + dshow.h \ + gdiplus.h \ + msxml.h \ + ncrypt.h \ + shlguid.h \ + transact.h .IF "$(DISABLE_ATL)"=="" MINGWHEADER_ATL_PATCH_TARGET=$(MISC)$/mingwheader_atl_patch MINGWHEADER_ATL_COPY_TARGET=$(MISC)$/mingwheader_atl_copy -FILES_TO_COPY_FROM_ATL=atlbase.h \ - atlcom.h \ - atlconv.h \ - atlctl.h \ - atlwin.h \ - statreg.h +FILES_TO_COPY_FROM_ATL= \ + atlbase.h \ + atlcom.h \ + atlconv.h \ + atlctl.h \ + atlwin.h \ + statreg.h .ENDIF -FILES_TO_COPY_FROM_DIRECTXSDK=dxtrans.h \ - d3dx9.h \ - d3d.h \ - d3dtypes.h \ - d3dx9math.h \ - d3dx9math.inl \ - d3dx9core.h +FILES_TO_COPY_FROM_DIRECTXSDK= \ + d3dtypes.h \ + d3dx9core.h \ + d3dx9math.h \ + d3dx9math.inl \ + dxtrans.h \ + d3dx9.h $(MISC)$/mingwheader_patch_all : $(MISC)$/mingwheader_patch $(MINGWHEADER_ATL_PATCH_TARGET) $(LB)$/libmsvcrt.a @@ -198,16 +184,20 @@ $(MINGWHEADER_ATL_COPY_TARGET): $(LB)$/libmsvcrt.a: .IF "$(USE_MINGW)" == "cygwin" - $(WRAPCMD) nm -g --defined-only $(COMPATH)$/lib/mingw/libmsvcrt.a > $(MISC)$/msvcrt.nm + $(COPY) $(COMPATH)$/lib/mingw/libmsvcrt.a $(LB)$/libmsvcrt_orig.a .ELSE - $(WRAPCMD) nm -g --defined-only $(COMPATH)$/lib/libmsvcrt.a > $(MISC)$/msvcrt.nm + $(COPY) $(COMPATH)$/lib/libmsvcrt.a $(LB)$/libmsvcrt_orig.a .ENDIF + cd $(LB) && ar -x libmsvcrt_orig.a ofmt_stub.o + ar -d $(LB)$/libmsvcrt_orig.a ofmt_stub.o + nm -g --defined-only $(LB)$/libmsvcrt_orig.a > $(MISC)$/msvcrt.nm echo EXPORTS > $(MISC)$/msvcrt.def sed -ne 's/.* T _//p' $(MISC)$/msvcrt.nm | sort >> $(MISC)$/msvcrt.def -sed -ne 's/.* I __imp__//p' $(MISC)$/msvcrt.nm | sort | diff - $(MISC)$/msvcrt.def | \ sed -ne 's/^< \(.*\)$/\1 DATA/p' > $(MISC)$/msvcrtdata.def cat $(MISC)$/msvcrtdata.def >> $(MISC)$/msvcrt.def dlltool --dllname msvcrt.dll --input-def=$(MISC)$/msvcrt.def --kill-at --output-lib=$(LB)$/libmsvcrt.a + cd $(LB) && ar -rs libmsvcrt.a ofmt_stub.o clean: -$(RM) $(MISC)$/mingw$/include$/*.h diff --git a/external/mingwheaders/mingw_headers.patch b/external/mingwheaders/mingw_headers.patch index fdb17a7..22995bf 100644 --- a/external/mingwheaders/mingw_headers.patch +++ b/external/mingwheaders/mingw_headers.patch @@ -12,24 +12,8 @@ +#endif + +#endif ---- include/winres.h.orig 2006-07-22 23:41:18.000000000 +0900 -+++ include/winres.h 2006-07-22 23:41:18.000000000 +0900 -@@ -0,0 +1,13 @@ -+#ifndef _WINRES_H -+#define _WINRES_H -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif -+ -+#define VS_VERSION_INFO 1 -+#include <winresrc.h> -+#ifdef IDC_STATIC -+#undef IDC_STATIC -+#endif -+#define IDC_STATIC (-1) -+#endif ---- include/excpt.h.orig 2005-01-14 05:19:52.000000000 +0900 -+++ include/excpt.h 2006-12-31 09:21:56.000000000 +0900 +--- include/excpt.h.orig 2009-01-11 04:32:43.000000000 +0900 ++++ include/excpt.h 2009-08-21 09:21:56.000000000 +0900 @@ -16,8 +16,11 @@ /* All the headers include this file. */ @@ -174,8 +158,8 @@ #endif #endif /* Not RC_INVOKED */ ---- include/tchar.h.orig 2006-03-26 09:21:36.000000000 +0900 -+++ include/tchar.h 2006-03-26 09:21:42.000000000 +0900 +--- include/tchar.h.orig 2009-01-11 04:32:46.000000000 +0900 ++++ include/tchar.h 2009-08-21 09:21:56.000000000 +0900 @@ -223,6 +223,9 @@ #define _ttelldir _wtelldir #define _tseekdir _wseekdir @@ -195,8 +179,8 @@ #endif /* Not _UNICODE */ /* ---- include/amvideo.h.orig 2006-11-19 08:08:30.000000000 +0900 -+++ include/amvideo.h 2007-01-16 23:11:24.656250000 +0900 +--- include/amvideo.h.orig 2008-12-06 11:31:53.000000000 +0900 ++++ include/amvideo.h 2009-08-21 09:21:56.000000000 +0900 @@ -52,10 +52,10 @@ BITMAPINFOHEADER bmiHeader; } VIDEOINFOHEADER; @@ -212,140 +196,27 @@ REFERENCE_TIME AvgTimePerFrame; BITMAPINFOHEADER bmiHeader; union { ---- include/bdatypes.h.orig 2006-11-19 08:08:30.000000000 +0900 -+++ include/bdatypes.h 2007-01-16 23:21:10.062500000 +0900 -@@ -17,9 +17,9 @@ - } MEDIA_SAMPLE_CONTENT; - /*--- DirectShow Reference - DirectShow Structures */ - typedef struct { -- DWORD dwOffset -- DWORD dwPacketLength -- DWORD dwStride -+ DWORD dwOffset; -+ DWORD dwPacketLength; -+ DWORD dwStride; - } MPEG2_TRANSPORT_STRIDE; - typedef struct { - ULONG ulPID; ---- include/imm.h.orig 2007-12-27 23:07:19.000000000 +0900 -+++ include/imm.h 2008-11-08 07:28:48.983375000 +0900 -@@ -105,6 +105,7 @@ - #define UI_CAP_ROTANY 4 - #define SCS_CAP_COMPSTR 1 - #define SCS_CAP_MAKEREAD 2 -+#define SCS_CAP_SETRECONVERTSTRING 4 - #define SELECT_CAP_CONVERSION 1 - #define SELECT_CAP_SENTENCE 2 - #define GGL_LEVEL 1 -@@ -208,6 +209,7 @@ - #define IME_REGWORD_STYLE_USER_FIRST 0x80000000 - #define IME_REGWORD_STYLE_USER_LAST 0xFFFFFFFF - #define IMR_RECONVERTSTRING 4 -+#define IMR_CONFIRMRECONVERTSTRING 5 - #define IMR_QUERYCHARPOSITION 6 - #define SOFTKEYBOARD_TYPE_T1 1 - #define SOFTKEYBOARD_TYPE_C1 2 -@@ -285,7 +287,7 @@ - DWORD dwCompStrOffset; - DWORD dwTargetStrLen; - DWORD dwTargetStrOffset; --} RECONVERTSTRING, *PRECONVERTSTRING; -+} RECONVERTSTRING, *PRECONVERTSTRING, *LPRECONVERTSTRING; - typedef struct tagREGISTERWORDA { - LPSTR lpReading; - LPSTR lpWord; ---- include/oaidl.h.orig 2006-11-19 08:08:33.000000000 +0900 -+++ include/oaidl.h 2007-01-20 09:08:24.625000000 +0900 -@@ -78,6 +78,8 @@ - typedef _COM_interface ICreateErrorInfo *LPCREATEERRORINFO; - typedef _COM_interface ISupportErrorInfo *LPSUPPORTERRORINFO; - typedef _COM_interface IRecordInfo *LPRECORDINFO; -+typedef _COM_interface IErrorLog *LPERRORLOG; -+typedef _COM_interface IPropertyBag *LPPROPERTYBAG; - - extern const IID IID_ITypeLib; - extern const IID IID_ITypeLib2; -@@ -772,6 +774,29 @@ - }; - #undef INTERFACE - -+EXTERN_C const IID IID_IErrorLog; -+#define INTERFACE IErrorLog -+DECLARE_INTERFACE_(IErrorLog,IUnknown) -+{ -+ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; -+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; -+ STDMETHOD_(ULONG,Release)(THIS) PURE; -+ STDMETHOD(AddError)(THIS_ LPCOLESTR,LPEXCEPINFO) PURE; -+}; -+#undef INTERFACE -+ -+EXTERN_C const IID IID_IPropertyBag; -+#define INTERFACE IPropertyBag -+DECLARE_INTERFACE_(IPropertyBag,IUnknown) -+{ -+ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; -+ STDMETHOD_(ULONG,AddRef)(THIS) PURE; -+ STDMETHOD_(ULONG,Release)(THIS) PURE; -+ STDMETHOD(Read)(THIS_ LPCOLESTR,LPVARIANT,LPERRORLOG) PURE; -+ STDMETHOD(Write)(THIS_ LPCOLESTR,LPVARIANT) PURE; -+}; -+#undef INTERFACE -+ - #ifdef __cplusplus - } - #endif ---- include/objidl.h.orig 2006-11-19 08:08:34.000000000 +0900 -+++ include/objidl.h 2008-11-30 11:56:53.875000000 +0900 -@@ -1,3 +1,4 @@ +--- include/basetyps.h.orig 2008-12-06 11:31:53.000000000 +0900 ++++ include/basetyps.h 2009-08-21 09:21:56.000000000 +0900 +@@ -80,6 +80,8 @@ + CONST_VTABLE struct i##Vtbl + # define DECLARE_INTERFACE_(i,b) DECLARE_INTERFACE(i) + # endif ++# define DECLARE_INTERFACE_IID(i,s) EXTERN_C const IID IID_##i; DECLARE_INTERFACE(i) ++# define DECLARE_INTERFACE_IID_(i,b,s) EXTERN_C const IID IID_##i; DECLARE_INTERFACE_(i,b) + # define BEGIN_INTERFACE + # define END_INTERFACE + +--- include/objidl.h.orig 2008-12-06 11:32:04.000000000 +0900 ++++ include/objidl.h 2009-08-21 09:21:56.000000000 +0900 +@@ -1,3 +1,6 @@ ++#include <windows.h> +#include <ole2.h> ++ #ifndef _OBJIDL_H #define _OBJIDL_H #if __GNUC__ >= 3 -@@ -127,6 +128,7 @@ - struct IAdviseSink *pAdvSink; - DWORD dwConnection; - } STATDATA; -+#if 0 - typedef struct tagSTATPROPSETSTG { - FMTID fmtid; - CLSID clsid; -@@ -135,6 +137,7 @@ - FILETIME ctime; - FILETIME atime; - } STATPROPSETSTG; -+#endif - typedef enum tagEXTCONN { - EXTCONN_STRONG=1, - EXTCONN_WEAK=2, -@@ -247,6 +250,7 @@ - typedef enum tagSERVERCALL { - SERVERCALL_ISHANDLED,SERVERCALL_REJECTED,SERVERCALL_RETRYLATER - } SERVERCALL; -+#if 0 - typedef struct tagCAUB { - ULONG cElems; - unsigned char *pElems; -@@ -406,6 +410,7 @@ - PROPSETFLAG_DEFAULT,PROPSETFLAG_NONSIMPLE,PROPSETFLAG_ANSI, - PROPSETFLAG_UNBUFFERED=4 - } PROPSETFLAG; -+#endif - typedef struct tagSTORAGELAYOUT { - DWORD LayoutType; - OLECHAR* pwcsElementName; -@@ -454,8 +459,10 @@ - DECLARE_ENUMERATOR(FORMATETC); - DECLARE_ENUMERATOR(HLITEM); - DECLARE_ENUMERATOR(STATDATA); -+#if 0 - DECLARE_ENUMERATOR(STATPROPSETSTG); - DECLARE_ENUMERATOR(STATPROPSTG); -+#endif - DECLARE_ENUMERATOR(STATSTG); - DECLARE_ENUMERATOR_(IEnumString,LPOLESTR); - DECLARE_ENUMERATOR_(IEnumMoniker,_COM_interface IMoniker*); -@@ -880,8 +887,8 @@ +@@ -880,8 +883,8 @@ STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; @@ -356,71 +227,136 @@ }; #undef INTERFACE -@@ -927,6 +934,7 @@ - }; - #undef INTERFACE +--- include/specstrings.h.orig 2008-12-06 11:32:09.000000000 +0900 ++++ include/specstrings.h 2009-08-21 09:21:56.000000000 +0900 +@@ -11,8 +11,31 @@ + /* __in and __out currently conflict with libstdc++, use with caution */ -+#if 0 - EXTERN_C const IID IID_IPropertyStorage; - #define INTERFACE IPropertyStorage - DECLARE_INTERFACE_(IPropertyStorage,IUnknown) -@@ -962,6 +970,7 @@ - STDMETHOD(Enum)(THIS_ IEnumSTATPROPSETSTG**) PURE; - }; - #undef INTERFACE -+#endif - EXTERN_C const IID IID_IClientSecurity; - #define INTERFACE IClientSecurity ---- include/objfwd.h.orig 2006-03-26 09:21:36.000000000 +0900 -+++ include/objfwd.h 2006-03-26 09:21:42.000000000 +0900 -@@ -27,7 +27,7 @@ - typedef _COM_interface IEnumFORMATETC *LPENUMFORMATETC; - typedef _COM_interface IEnumSTATDATA *LPENUMSTATDATA; - typedef _COM_interface IEnumSTATSTG *LPENUMSTATSTG; --typedef _COM_interface IEnumSTATPROPSTG LPENUMSTATPROPSTG; -+typedef _COM_interface IEnumSTATPROPSTG *LPENUMSTATPROPSTG; - typedef _COM_interface IEnumString *LPENUMSTRING; - typedef _COM_interface IEnumUnknown *LPENUMUNKNOWN; - typedef _COM_interface IStorage *LPSTORAGE; ---- include/uxtheme.h.orig 2006-11-19 08:08:36.000000000 +0900 -+++ include/uxtheme.h 2007-01-18 18:51:37.125000000 +0900 ++#define __RPC__deref_inout_opt ++#define __RPC__deref_opt_inout_ecount_full_opt(size) ++#define __RPC__deref_opt_inout_opt ++#define __RPC__deref_out ++#define __RPC__deref_out_ecount_full_opt(size) ++#define __RPC__deref_out_opt ++#define __RPC__deref_out_opt_string ++#define __RPC__in ++#define __RPC__in_ecount_full(size) ++#define __RPC__in_ecount_full_opt(size) ++#define __RPC__in_opt ++#define __RPC__inout ++#define __RPC__inout_ecount_full(size) ++#define __RPC__inout_ecount_full_opt(size) ++#define __RPC__inout_opt ++#define __RPC__out ++#define __RPC__out_ecount_full(size) ++#define __RPC__out_ecount_full_string(size) ++#define __RPC__out_ecount_part(size,init) ++#define __RPC_unique_pointer + #define __bcount(size) + #define __bcount_opt(size) ++#define __callback ++#define __checkReturn ++#define __deref + #define __deref_bcount(size) + #define __deref_bcount_opt(size) + #define __deref_ecount(size) +@@ -36,6 +59,7 @@ + #define __deref_inout_ecount_opt(size) + #define __deref_inout_ecount_part(size,length) + #define __deref_inout_ecount_part_opt(size,length) ++#define __deref_inout_ecount_z(size) + #define __deref_inout_opt + #define __deref_opt_bcount(size) + #define __deref_opt_bcount_opt(size) +@@ -89,14 +113,23 @@ + #define __deref_out_ecount_part(size,length) + #define __deref_out_ecount_part_opt(size,length) + #define __deref_out_opt ++#define __deref_out_z ++#define __deref_out_z_opt + #define __ecount(size) + #define __ecount_opt(size) ++#define __field_bcount(size) ++#define __field_ecount(size) ++#define __field_ecount_opt(size) ++#define __format_string ++#define __gdi_entry + #define __in + #define __in_bcount(size) + #define __in_bcount_opt(size) + #define __in_ecount(size) + #define __in_ecount_opt(size) + #define __in_opt ++#define __in_xcount(size) ++#define __in_z_opt + #define __inout + #define __inout_bcount(size) + #define __inout_bcount_full(size) +@@ -111,7 +144,12 @@ + #define __inout_ecount_part(size,length) + #define __inout_ecount_part_opt(size,length) + #define __inout_opt ++#define __inout_xcount(size) ++#define __notnull ++#define __nullnullterminated ++#define __nullterminated + #define __out ++#define __out_awcount(expr,size) + #define __out_bcount(size) + #define __out_bcount_full(size) + #define __out_bcount_full_opt(size) +@@ -119,12 +157,20 @@ + #define __out_bcount_part(size,length) + #define __out_bcount_part_opt(size,length) + #define __out_ecount(size) ++#define __out_ecount(size) + #define __out_ecount_full(size) + #define __out_ecount_full_opt(size) + #define __out_ecount_opt(size) + #define __out_ecount_part(size,length) + #define __out_ecount_part_opt(size,length) + #define __out_opt ++#define __out_xcount(size) ++#define __out_xcount_opt(size) ++#define __reserved ++#define __struct_bcount(size) ++#define __success(expr) ++#define __typefix(ctype) ++#define __unaligned + + + #endif /*_SPECSTRINGS_H */ +--- include/uxtheme.h.orig 2008-12-06 11:32:11.000000000 +0900 ++++ include/uxtheme.h 2010-01-22 14:50:56.327000000 +0900 @@ -10,7 +10,7 @@ extern "C" { #endif -#if (_WIN32_WINNT >= 0x0501) -+//#if (_WIN32_WINNT >= 0x0501) ++#if (_WIN32_WINNT >= 0x0500) #define DTBG_CLIPRECT 0x00000001 #define DTBG_DRAWSOLID 0x00000002 #define DTBG_OMITBORDER 0x00000004 -@@ -265,7 +265,7 @@ - HTHEME WINAPI OpenThemeData(HWND,LPCWSTR); - void WINAPI SetThemeAppProperties(DWORD); - HRESULT WINAPI SetWindowTheme(HWND,LPCWSTR,LPCWSTR); --#endif -+//#endif - - #ifdef __cplusplus - } ---- include/winbase.h.orig 2006-11-19 08:08:36.000000000 +0900 -+++ include/winbase.h 2007-07-27 21:14:27.621750000 +0900 -@@ -993,12 +993,14 @@ - WORD Reserved2; - CHAR szPathName[OFS_MAXPATHNAME]; - } OFSTRUCT,*LPOFSTRUCT,*POFSTRUCT; +@@ -35,6 +35,7 @@ + #define HTTB_RESIZINGBORDER (HTTB_RESIZINGBORDER_LEFT|HTTB_RESIZINGBORDER_TOP|HTTB_RESIZINGBORDER_RIGHT|HTTB_RESIZINGBORDER_BOTTOM) + #define HTTB_SIZINGTEMPLATE 0x0100 + #define HTTB_SYSTEMSIZINGMARGINS 0x0200 +#if 0 - typedef struct _WIN_CERTIFICATE { - DWORD dwLength; - WORD wRevision; - WORD wCertificateType; - BYTE bCertificate[1]; - } WIN_CERTIFICATE, *LPWIN_CERTIFICATE; -+#endif - #if (_WIN32_WINNT >= 0x0501) - typedef struct tagACTCTXA { - ULONG cbSize; -@@ -1342,8 +1344,8 @@ + #define TMT_DISPLAYNAME 0x0259 + #define TMT_TOOLTIP 0x025A + #define TMT_COMPANY 0x025B +@@ -186,6 +187,7 @@ + #define BT_IMAGEFILE 0x0000 + #define BT_BORDERFILL 0x0001 + #define BT_NONE 0x0002 ++#endif + + typedef enum PROPERTYORIGIN { + PO_STATE = 0, +--- include/winbase.h.orig 2008-12-06 11:32:11.000000000 +0900 ++++ include/winbase.h 2009-08-21 09:21:56.000000000 +0900 +@@ -1354,8 +1354,8 @@ WINBASEAPI HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD); WINBASEAPI BOOL WINAPI FindFirstFreeAce(PACL,PVOID*); #if (_WIN32_WINNT >= 0x0500) @@ -431,7 +367,7 @@ WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointA(LPSTR,LPSTR,DWORD); WINBASEAPI HANDLE WINAPI FindFirstVolumeMountPointW(LPWSTR,LPWSTR,DWORD); #endif -@@ -1351,7 +1353,7 @@ +@@ -1363,7 +1363,7 @@ WINBASEAPI BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA); WINBASEAPI BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW); #if (_WIN32_WINNT >= 0x0500) @@ -440,7 +376,7 @@ WINBASEAPI BOOL WINAPI FindNextVolumeW(HANDLE,LPWSTR,DWORD); WINBASEAPI BOOL WINAPI FindNextVolumeMountPointA(HANDLE,LPSTR,DWORD); WINBASEAPI BOOL WINAPI FindNextVolumeMountPointW(HANDLE,LPWSTR,DWORD); -@@ -1463,10 +1465,10 @@ +@@ -1475,10 +1475,10 @@ WINBASEAPI DWORD WINAPI GetLogicalDrives(void); WINBASEAPI DWORD WINAPI GetLogicalDriveStringsA(DWORD,LPSTR); WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW(DWORD,LPWSTR); @@ -453,7 +389,7 @@ WINBASEAPI BOOL WINAPI GetMailslotInfo(HANDLE,PDWORD,PDWORD,PDWORD,PDWORD); WINBASEAPI DWORD WINAPI GetModuleFileNameA(HINSTANCE,LPSTR,DWORD); WINBASEAPI DWORD WINAPI GetModuleFileNameW(HINSTANCE,LPWSTR,DWORD); -@@ -1504,9 +1506,9 @@ +@@ -1519,9 +1519,9 @@ #endif WINBASEAPI HANDLE WINAPI GetProcessHeap(VOID); WINBASEAPI DWORD WINAPI GetProcessHeaps(DWORD,PHANDLE); @@ -465,7 +401,7 @@ #if (_WIN32_WINNT >= 0x0500) WINBASEAPI BOOL WINAPI GetProcessIoCounters(HANDLE,PIO_COUNTERS); #endif -@@ -1784,9 +1786,9 @@ +@@ -1802,9 +1802,9 @@ WINBASEAPI BOOL WINAPI OpenProcessToken(HANDLE,DWORD,PHANDLE); WINBASEAPI HANDLE WINAPI OpenSemaphoreA(DWORD,BOOL,LPCSTR); WINBASEAPI HANDLE WINAPI OpenSemaphoreW(DWORD,BOOL,LPCWSTR); @@ -477,15 +413,15 @@ WINBASEAPI BOOL WINAPI OpenThreadToken(HANDLE,DWORD,BOOL,PHANDLE); WINBASEAPI HANDLE WINAPI OpenWaitableTimerA(DWORD,BOOL,LPCSTR); WINBASEAPI HANDLE WINAPI OpenWaitableTimerW(DWORD,BOOL,LPCWSTR); -@@ -2024,6 +2026,7 @@ - WINBASEAPI BOOL WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR); - WINBASEAPI BOOL WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR); - WINBASEAPI DWORD WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL); -+WINBASEAPI BOOL WINAPI CheckTokenMembership(HANDLE,PSID,PBOOL); - #define Yield() - #if (_WIN32_WINNT >= 0x0501) - WINBASEAPI BOOL WINAPI ZombifyActCtx(HANDLE); -@@ -2130,9 +2133,9 @@ +@@ -2029,6 +2029,7 @@ + WINBASEAPI DWORD WINAPI WaitForSingleObjectEx(HANDLE,DWORD,BOOL); + WINBASEAPI BOOL WINAPI WaitNamedPipeA(LPCSTR,DWORD); + WINBASEAPI BOOL WINAPI WaitNamedPipeW(LPCWSTR,DWORD); ++WINBASEAPI UINT WINAPI WinExec(LPCSTR,UINT); + WINBASEAPI BOOL WINAPI WinLoadTrustProvider(GUID*); + WINBASEAPI BOOL WINAPI WriteFile(HANDLE,PCVOID,DWORD,PDWORD,LPOVERLAPPED); + WINBASEAPI BOOL WINAPI WriteFileEx(HANDLE,PCVOID,DWORD,LPOVERLAPPED,LPOVERLAPPED_COMPLETION_ROUTINE); +@@ -2151,9 +2152,9 @@ #define GetFileAttributesEx GetFileAttributesExW #define GetFullPathName GetFullPathNameW #define GetLogicalDriveStrings GetLogicalDriveStringsW @@ -497,7 +433,7 @@ #define GetModuleFileName GetModuleFileNameW #define GetModuleHandle GetModuleHandleW #if (_WIN32_WINNT >= 0x0500) -@@ -2325,9 +2328,9 @@ +@@ -2346,9 +2347,9 @@ #define GetFileAttributesEx GetFileAttributesExA #define GetFullPathName GetFullPathNameA #define GetLogicalDriveStrings GetLogicalDriveStringsA @@ -509,8 +445,18 @@ #define GetNamedPipeHandleState GetNamedPipeHandleStateA #define GetModuleHandle GetModuleHandleA #if (_WIN32_WINNT >= 0x0500) ---- include/wininet.h.orig 2006-03-26 09:21:36.000000000 +0900 -+++ include/wininet.h 2006-04-04 23:18:14.000000000 +0900 +--- include/windef.h.orig 2008-12-06 11:32:12.000000000 +0900 ++++ include/windef.h 2009-08-21 09:21:56.000000000 +0900 +@@ -251,6 +251,7 @@ + typedef unsigned int UINT,*PUINT,*LPUINT; + + #include <winnt.h> ++#include <specstrings.h> + + typedef UINT_PTR WPARAM; + typedef LONG_PTR LPARAM; +--- include/wininet.h.orig 2008-12-06 11:32:13.000000000 +0900 ++++ include/wininet.h 2009-08-21 09:21:56.000000000 +0900 @@ -868,6 +868,7 @@ BOOL WINAPI InternetAutodial(DWORD,DWORD); BOOL WINAPI InternetAutodialHangup(DWORD); @@ -519,23 +465,8 @@ BOOL WINAPI InternetSetDialState(LPCTSTR,DWORD,DWORD); BOOL WINAPI InternetReadFileExA(HINTERNET,LPINTERNET_BUFFERSA,DWORD,DWORD_PTR); BOOL WINAPI InternetReadFileExW(HINTERNET,LPINTERNET_BUFFERSW,DWORD,DWORD_PTR); ---- include/winnt.h.orig 2006-11-19 08:08:37.000000000 +0900 -+++ include/winnt.h 2007-01-16 07:06:57.796875000 +0900 -@@ -67,9 +67,9 @@ - #endif - #endif - --#ifndef C_ASSERT --#define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1] --#endif -+//#ifndef C_ASSERT -+//#define C_ASSERT(expr) typedef char __C_ASSERT__[(expr)?1:-1] -+//#endif - - #ifndef VOID - #define VOID void ---- include/winver.h.orig 2006-03-26 09:21:36.000000000 +0900 -+++ include/winver.h 2006-03-26 09:21:42.000000000 +0900 +--- include/winver.h.orig 2008-12-06 11:32:14.000000000 +0900 ++++ include/winver.h 2009-08-21 09:21:56.000000000 +0900 @@ -101,10 +101,10 @@ DWORD WINAPI VerFindFileW(DWORD,LPWSTR,LPWSTR,LPWSTR,LPWSTR,PUINT,LPWSTR,PUINT); DWORD WINAPI VerInstallFileA(DWORD,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,LPSTR,PUINT); @@ -551,8 +482,8 @@ DWORD WINAPI VerLanguageNameA(DWORD,LPSTR,DWORD); DWORD WINAPI VerLanguageNameW(DWORD,LPWSTR,DWORD); BOOL WINAPI VerQueryValueA(const LPVOID,LPSTR,LPVOID*,PUINT); ---- include/wtypes.h.orig 2006-11-19 08:08:37.000000000 +0900 -+++ include/wtypes.h 2007-01-19 23:05:02.531250000 +0900 +--- include/wtypes.h.orig 2008-12-06 11:32:14.000000000 +0900 ++++ include/wtypes.h 2009-08-21 09:21:56.000000000 +0900 @@ -66,6 +66,19 @@ unsigned short asData[1]; }FLAGGED_WORD_BLOB; @@ -634,20 +565,8 @@ #ifdef __cplusplus } #endif ---- include/sys/stat.h.orig 2006-06-25 19:45:42.000000000 +0900 -+++ include/sys/stat.h 2006-12-30 18:26:27.578125000 +0900 -@@ -11,6 +11,9 @@ - - #ifndef _STAT_H_ - #define _STAT_H_ -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif - - /* All the headers include this file. */ - #include <_mingw.h> ---- include/adoctint.h.orig 2005-04-04 18:50:18.000000000 +0900 -+++ include/adoctint.h 2007-12-14 23:43:07.754125000 +0900 +--- include/adoctint.h.orig 2008-01-18 22:17:10.000000000 +0900 ++++ include/adoctint.h 2009-08-21 09:21:56.000000000 +0900 @@ -11,6 +11,9 @@ //-------------------------------------------------------------------- #ifndef _ADOCTINT_H_ @@ -712,8 +631,8 @@ virtual /* [helpcontext] */ HRESULT STDMETHODCALLTYPE Delete( /* [in] */ VARIANT Item) = 0; ---- include/adodef.h.orig 2005-04-04 18:50:18.000000000 +0900 -+++ include/adodef.h 2007-01-05 21:48:51.265625000 +0900 +--- include/adodef.h.orig 2008-01-18 22:17:10.000000000 +0900 ++++ include/adodef.h 2009-08-21 09:21:56.000000000 +0900 @@ -12,6 +12,9 @@ #ifndef _ADODEF_H_ @@ -724,8 +643,8 @@ // TYPELIB MAJOR VERSIONS #define ADO_MAJOR 6 ---- include/adoguids.h.orig 2005-04-04 18:50:18.000000000 +0900 -+++ include/adoguids.h 2007-01-05 21:50:10.265625000 +0900 +--- include/adoguids.h.orig 2008-01-18 22:17:10.000000000 +0900 ++++ include/adoguids.h 2009-08-21 09:21:56.000000000 +0900 @@ -11,6 +11,10 @@ //----------------------------------------------------------------------------- @@ -737,8 +656,8 @@ #define STRING_GUID(l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) l##-##w1##-##w2##-##b1##b2##-##b3##b4##b5##b6##b7##b8 #if defined(__midl) || defined(GEN_MIDL) ---- include/adoint.h.orig 2005-04-04 18:50:18.000000000 +0900 -+++ include/adoint.h 2007-01-02 17:36:43.593750000 +0900 +--- include/adoint.h.orig 2008-01-18 22:17:10.000000000 +0900 ++++ include/adoint.h 2009-08-21 09:21:56.000000000 +0900 @@ -11,6 +11,9 @@ //-------------------------------------------------------------------- #ifndef _ADOINT_H_ @@ -840,7 +759,7 @@ { ULONG cbOID; --- include/commctrl.h.orig 2008-01-18 22:17:14.000000000 +0900 -+++ include/commctrl.h 2009-02-16 21:34:39.065125000 +0900 ++++ include/commctrl.h 2009-08-21 09:21:56.000000000 +0900 @@ -14,6 +14,14 @@ #ifndef _INC_COMMCTRL #define _INC_COMMCTRL @@ -856,15 +775,6 @@ #if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma warning(push) #pragma warning(disable:4001) /* nonstandard extension : single line comment */ -@@ -23,7 +31,7 @@ - - #ifndef _HRESULT_DEFINED - #define _HRESULT_DEFINED --typedef __success(return >= 0) long HRESULT; -+typedef long HRESULT; - #endif // !_HRESULT_DEFINED - - #ifndef NOUSER @@ -369,8 +377,10 @@ // Shell reserved (0U-580U) - (0U-589U) @@ -925,8 +835,8 @@ #endif /* _INC_COMMCTRL */ ---- include/control.h.orig 2005-04-14 17:54:38.000000000 +0900 -+++ include/control.h 2007-01-02 22:16:33.031250000 +0900 +--- include/control.h.orig 2008-01-18 22:17:14.000000000 +0900 ++++ include/control.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -934,8 +844,8 @@ /* this ALWAYS GENERATED file contains the definitions for the interfaces */ ---- include/dispex.h.orig 2007-03-31 19:44:54.000000000 +0900 -+++ include/dispex.h 2007-03-24 17:40:20.000000000 +0900 +--- include/dispex.h.orig 2008-01-18 22:17:16.000000000 +0900 ++++ include/dispex.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -943,8 +853,8 @@ /* this ALWAYS GENERATED file contains the definitions for the interfaces */ ---- include/filter.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/filter.h 2007-01-02 11:15:03.671875000 +0900 +--- include/filter.h.orig 2008-01-18 22:17:18.000000000 +0900 ++++ include/filter.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -952,8 +862,8 @@ /* this ALWAYS GENERATED file contains the definitions for the interfaces */ ---- include/gdiplusbitmap.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusbitmap.h 2007-01-02 11:17:13.125000000 +0900 +--- include/gdiplusbitmap.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusbitmap.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -961,8 +871,8 @@ /**************************************************************************\ * * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved. ---- include/gdiplusbrush.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusbrush.h 2007-01-02 10:33:22.734375000 +0900 +--- include/gdiplusbrush.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusbrush.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -970,8 +880,8 @@ /**************************************************************************\ * * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved. ---- include/gdiplusenums.h.orig 2003-03-26 16:34:34.000000000 +0900 -+++ include/gdiplusenums.h 2004-12-30 20:42:34.000000000 +0900 +--- include/gdiplusenums.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusenums.h 2009-08-21 09:21:56.000000000 +0900 @@ -542,7 +542,7 @@ #define GDIP_EMFPLUS_RECORD_BASE 0x00004000 @@ -981,8 +891,8 @@ #define GDIP_EMFPLUS_RECORD_TO_WMF(n) ((n) & (~GDIP_WMF_RECORD_BASE)) #define GDIP_IS_WMF_RECORDTYPE(n) (((n) & GDIP_WMF_RECORD_BASE) != 0) ---- include/gdiplusfont.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusfont.h 2007-01-02 10:35:57.671875000 +0900 +--- include/gdiplusfont.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusfont.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1010,8 +920,8 @@ IN HENHMETAFILE hemf, IN UINT cbData16, OUT LPBYTE pData16, ---- include/gdiplusimageattributes.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusimageattributes.h 2007-01-02 10:21:23.031250000 +0900 +--- include/gdiplusimageattributes.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusimageattributes.h 2009-08-21 09:21:56.000000000 +0900 @@ -32,6 +32,9 @@ #ifndef _GDIPLUSIMAGEATTRIBUTES_H @@ -1022,8 +932,8 @@ class GpImageAttributes; ---- include/gdiplusimaging.h.orig 2003-03-26 16:34:34.000000000 +0900 -+++ include/gdiplusimaging.h 2007-12-04 21:16:38.000000000 +0900 +--- include/gdiplusimaging.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusimaging.h 2009-08-21 09:21:56.000000000 +0900 @@ -160,7 +160,7 @@ UINT Width; UINT Height; @@ -1033,8 +943,8 @@ VOID* Scan0; UINT_PTR Reserved; }; ---- include/gdiplusmatrix.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusmatrix.h 2007-01-02 10:32:35.203125000 +0900 +--- include/gdiplusmatrix.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusmatrix.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1042,8 +952,8 @@ /**************************************************************************\ * * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved. ---- include/gdipluspath.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdipluspath.h 2007-01-02 10:34:33.125000000 +0900 +--- include/gdipluspath.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdipluspath.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1051,8 +961,8 @@ /**************************************************************************\ * * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved. ---- include/gdipluspen.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdipluspen.h 2007-01-02 10:34:12.593750000 +0900 +--- include/gdipluspen.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdipluspen.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1060,8 +970,8 @@ /**************************************************************************\ * * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved. ---- include/gdiplusregion.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusregion.h 2007-01-02 10:35:23.453125000 +0900 +--- include/gdiplusregion.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusregion.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1069,8 +979,8 @@ /**************************************************************************\ * * Copyright (c) 1998-2001, Microsoft Corp. All Rights Reserved. ---- include/gdiplusstringformat.h.orig 2005-04-14 17:54:44.000000000 +0900 -+++ include/gdiplusstringformat.h 2007-08-29 23:10:06.497500000 +0900 +--- include/gdiplusstringformat.h.orig 2008-01-18 22:17:46.000000000 +0900 ++++ include/gdiplusstringformat.h 2009-08-21 09:21:56.000000000 +0900 @@ -217,7 +217,7 @@ )); } @@ -1080,8 +990,34 @@ { StringTrimming trimming; SetStatus(DllExports::GdipGetStringFormatTrimming( ---- include/imagehlp.h.orig 2008-03-22 06:10:42.084500000 +1000 -+++ include/imagehlp.h 2009-02-16 21:34:39.065125000 +0900 +--- include/imm.h.orig 2008-01-18 22:17:20.000000000 +0900 ++++ include/imm.h 2009-08-21 09:21:56.000000000 +0900 +@@ -7,6 +7,13 @@ + #ifndef _IMM_ + #define _IMM_ + ++#define __in ++#define __out ++#ifdef __cplusplus ++#define __inline inline ++#else ++#define __inline static __inline__ ++#endif + + #ifdef __cplusplus + extern "C" { +@@ -715,5 +722,9 @@ + } + #endif + ++#undef __in ++#undef __out ++#undef __inline ++ + #endif // _IMM_ + +--- include/imagehlp.h.orig 2008-01-18 22:17:20.000000000 +0900 ++++ include/imagehlp.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1131,279 +1067,80 @@ + #endif // _IMAGEHLP_ ---- include/intsafe.h.orig 2008-03-22 06:10:42.100125000 +1000 -+++ include/intsafe.h 2008-03-24 02:25:53.710750000 +1000 -@@ -111,7 +111,7 @@ +--- include/mapiwin.h.orig 2008-01-18 22:17:22.000000000 +0900 ++++ include/mapiwin.h 2009-08-21 09:21:56.000000000 +0900 +@@ -428,5 +428,5 @@ + #endif + #endif /* __MAPIWIN_H__ */ +- ++ +--- include/msdasc.h.orig 2008-01-18 22:17:26.000000000 +0900 ++++ include/msdasc.h 2009-08-21 09:21:56.000000000 +0900 +@@ -1,3 +1,6 @@ ++#if __GNUC__ >=3 ++#pragma GCC system_header ++#endif --typedef __success(return >= 0) long HRESULT; -+typedef long HRESULT; - #define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) - #define FAILED(hr) (((HRESULT)(hr)) < 0) -@@ -134,7 +134,7 @@ - || defined(_M_IA64) || defined(_M_AMD64) - #define UInt32x32To64(a, b) (((unsigned __int64)((unsigned int)(a))) * ((unsigned __int64)((unsigned int)(b)))) - #elif defined(_M_IX86) --#define UInt32x32To64(a, b) ((unsigned __int64)(((unsigned __int64)((unsigned int)(a))) * ((unsigned int)(b)))) -+//#define UInt32x32To64(a, b) ((unsigned __int64)(((unsigned __int64)((unsigned int)(a))) * ((unsigned int)(b)))) - #else - #error Must define a target architecture. - #endif -@@ -142,22 +142,22 @@ - // - // Min/Max type values - // --#define INT8_MIN (-127i8 - 1) -+#define INT8_MIN ((signed char)(-127) - 1) - #define SHORT_MIN (-32768) --#define INT16_MIN (-32767i16 - 1) --#define INT_MIN (-2147483647 - 1) --#define INT32_MIN (-2147483647i32 - 1) --#define LONG_MIN (-2147483647L - 1) --#define LONGLONG_MIN (-9223372036854775807i64 - 1) --#define LONG64_MIN (-9223372036854775807i64 - 1) --#define INT64_MIN (-9223372036854775807i64 - 1) -+#define INT16_MIN ((short)(-32767) - 1) -+//#define INT_MIN (-2147483647 - 1) -+#define INT32_MIN (-2147483647L - 1) -+//#define LONG_MIN (-2147483647L - 1) -+#define LONGLONG_MIN (-9223372036854775807ll - 1) -+#define LONG64_MIN (-9223372036854775807ll - 1) -+#define INT64_MIN (-9223372036854775807ll - 1) - #define INT128_MIN (-170141183460469231731687303715884105727i128 - 1) - - #ifdef _WIN64 --#define INT_PTR_MIN (-9223372036854775807i64 - 1) --#define LONG_PTR_MIN (-9223372036854775807i64 - 1) --#define PTRDIFF_T_MIN (-9223372036854775807i64 - 1) --#define SSIZE_T_MIN (-9223372036854775807i64 - 1) -+#define INT_PTR_MIN (-9223372036854775807ll - 1) -+#define LONG_PTR_MIN (-9223372036854775807ll - 1) -+#define PTRDIFF_T_MIN (-9223372036854775807ll - 1) -+#define SSIZE_T_MIN (-9223372036854775807ll - 1) - #else - #define INT_PTR_MIN (-2147483647 - 1) - #define LONG_PTR_MIN (-2147483647L - 1) -@@ -165,44 +165,44 @@ - #define SSIZE_T_MIN (-2147483647L - 1) - #endif + /* this ALWAYS GENERATED file contains the definitions for the interfaces */ +--- include/msi.h.orig 2008-01-18 22:17:28.000000000 +0900 ++++ include/msi.h 2009-08-21 09:21:56.000000000 +0900 +@@ -59,6 +59,14 @@ + #endif // _MSI_NO_CRYPTO + #endif //(_WIN32_MSI >= 150) --#define INT8_MAX 127i8 --#define UINT8_MAX 0xffui8 -+#define INT8_MAX ((signed char)(127)) -+#define UINT8_MAX ((unsigned char)(0xff)) - #define BYTE_MAX 0xff - #define SHORT_MAX 32767 --#define INT16_MAX 32767i16 -+#define INT16_MAX ((short)(32767)) - #define USHORT_MAX 0xffff --#define UINT16_MAX 0xffffui16 -+#define UINT16_MAX ((unsigned short)(0xffff)) - #define WORD_MAX 0xffff - #define INT_MAX 2147483647 --#define INT32_MAX 2147483647i32 -+#define INT32_MAX 2147483647L - #define UINT_MAX 0xffffffff --#define UINT32_MAX 0xffffffffui32 -+#define UINT32_MAX 0xffffffffu - #define LONG_MAX 2147483647L - #define ULONG_MAX 0xffffffffUL - #define DWORD_MAX 0xffffffffUL --#define LONGLONG_MAX 9223372036854775807i64 --#define LONG64_MAX 9223372036854775807i64 --#define INT64_MAX 9223372036854775807i64 --#define ULONGLONG_MAX 0xffffffffffffffffui64 --#define DWORDLONG_MAX 0xffffffffffffffffui64 --#define ULONG64_MAX 0xffffffffffffffffui64 --#define DWORD64_MAX 0xffffffffffffffffui64 --#define UINT64_MAX 0xffffffffffffffffui64 -+#define LONGLONG_MAX 9223372036854775807ll -+#define LONG64_MAX 9223372036854775807ll -+#define INT64_MAX 9223372036854775807ll -+#define ULONGLONG_MAX 0xffffffffffffffffull -+#define DWORDLONG_MAX 0xffffffffffffffffull -+#define ULONG64_MAX 0xffffffffffffffffull -+#define DWORD64_MAX 0xffffffffffffffffull -+#define UINT64_MAX 0xffffffffffffffffull - #define INT128_MAX 170141183460469231731687303715884105727i128 - #define UINT128_MAX 0xffffffffffffffffffffffffffffffffui128 - - #undef SIZE_T_MAX - - #ifdef _WIN64 --#define INT_PTR_MAX 9223372036854775807i64 --#define UINT_PTR_MAX 0xffffffffffffffffui64 --#define LONG_PTR_MAX 9223372036854775807i64 --#define ULONG_PTR_MAX 0xffffffffffffffffui64 --#define DWORD_PTR_MAX 0xffffffffffffffffui64 --#define PTRDIFF_T_MAX 9223372036854775807i64 --#define SIZE_T_MAX 0xffffffffffffffffui64 --#define SSIZE_T_MAX 9223372036854775807i64 --#define _SIZE_T_MAX 0xffffffffffffffffui64 -+#define INT_PTR_MAX 9223372036854775807ll -+#define UINT_PTR_MAX 0xffffffffffffffffull -+#define LONG_PTR_MAX 9223372036854775807ll -+#define ULONG_PTR_MAX 0xffffffffffffffffull -+#define DWORD_PTR_MAX 0xffffffffffffffffull -+#define PTRDIFF_T_MAX 9223372036854775807ll -+#define SIZE_T_MAX 0xffffffffffffffffull -+#define SSIZE_T_MAX 9223372036854775807ll -+#define _SIZE_T_MAX 0xffffffffffffffffull - #else - #define INT_PTR_MAX 2147483647 - #define UINT_PTR_MAX 0xffffffff -@@ -219,39 +219,39 @@ - // - // It is common for -1 to be used as an error value - // --#define INT8_ERROR (-1i8) --#define UINT8_ERROR 0xffui8 -+#define INT8_ERROR (((signed char)(-1))) -+#define UINT8_ERROR ((unsigned char)(0xff)) - #define BYTE_ERROR 0xff - #define SHORT_ERROR (-1) --#define INT16_ERROR (-1i16) -+#define INT16_ERROR (((short)(-1))) - #define USHORT_ERROR 0xffff --#define UINT16_ERROR 0xffffui16 -+#define UINT16_ERROR ((unsigned short)(0xffff)) - #define WORD_ERROR 0xffff - #define INT_ERROR (-1) --#define INT32_ERROR (-1i32) -+#define INT32_ERROR (-1L) - #define UINT_ERROR 0xffffffff --#define UINT32_ERROR 0xffffffffui32 -+#define UINT32_ERROR 0xffffffffuL - #define LONG_ERROR (-1L) - #define ULONG_ERROR 0xffffffffUL - #define DWORD_ERROR 0xffffffffUL --#define LONGLONG_ERROR (-1i64) --#define LONG64_ERROR (-1i64) --#define INT64_ERROR (-1i64) --#define ULONGLONG_ERROR 0xffffffffffffffffui64 --#define DWORDLONG_ERROR 0xffffffffffffffffui64 --#define ULONG64_ERROR 0xffffffffffffffffui64 --#define UINT64_ERROR 0xffffffffffffffffui64 -- --#ifdef _WIN64 --#define INT_PTR_ERROR (-1i64) --#define UINT_PTR_ERROR 0xffffffffffffffffui64 --#define LONG_PTR_ERROR (-1i64) --#define ULONG_PTR_ERROR 0xffffffffffffffffui64 --#define DWORD_PTR_ERROR 0xffffffffffffffffui64 --#define PTRDIFF_T_ERROR (-1i64) --#define SIZE_T_ERROR 0xffffffffffffffffui64 --#define SSIZE_T_ERROR (-1i64) --#define _SIZE_T_ERROR 0xffffffffffffffffui64 -+#define LONGLONG_ERROR (-1ll) -+#define LONG64_ERROR (-1ll) -+#define INT64_ERROR (-1ll) -+#define ULONGLONG_ERROR 0xffffffffffffffffull -+#define DWORDLONG_ERROR 0xffffffffffffffffull -+#define ULONG64_ERROR 0xffffffffffffffffull -+#define UINT64_ERROR 0xffffffffffffffffull ++#define __in ++#define __out ++#ifdef __cplusplus ++#define __inline inline ++#else ++#define __inline static __inline__ ++#endif + -+#ifdef _WIN64 -+#define INT_PTR_ERROR (-1ll) -+#define UINT_PTR_ERROR 0xffffffffffffffffull -+#define LONG_PTR_ERROR (-1ll) -+#define ULONG_PTR_ERROR 0xffffffffffffffffull -+#define DWORD_PTR_ERROR 0xffffffffffffffffull -+#define PTRDIFF_T_ERROR (-1ll) -+#define SIZE_T_ERROR 0xffffffffffffffffull -+#define SSIZE_T_ERROR (-1ll) -+#define _SIZE_T_ERROR 0xffffffffffffffffull - #else - #define INT_PTR_ERROR (-1) - #define UINT_PTR_ERROR 0xffffffff -@@ -7570,13 +7570,13 @@ - - // a * d must be less than 2^32 or there would be bits set in the high 64-bits - ad = (((ULONGLONG)dw_a) * (ULONGLONG)dw_d); -- if ((ad & 0xffffffff00000000) == 0) -+ if ((ad & 0xffffffff00000000ULL) == 0) - { - dw_b = (DWORD)ullMultiplicand; + // -------------------------------------------------------------------------- + // Installer generic handle definitions + // -------------------------------------------------------------------------- +@@ -2248,5 +2256,9 @@ + // LOCALIZE END - // b * c must be less than 2^32 or there would be bits set in the high 64-bits - bc = (((ULONGLONG)dw_b) * (ULONGLONG)dw_c); -- if ((bc & 0xffffffff00000000) == 0) -+ if ((bc & 0xffffffff00000000ULL) == 0) - { - // now sum them all up checking for overflow. - // shifting is safe because we already checked for overflow above -@@ -8015,10 +8015,14 @@ - // Macros that are no longer used in this header but which clients may - // depend on being defined here. - // --#define LOWORD(_dw) ((WORD)(((DWORD_PTR)(_dw)) & 0xffff)) --#define HIWORD(_dw) ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff)) -+//#define LOWORD(_dw) ((WORD)(((DWORD_PTR)(_dw)) & 0xffff)) -+//#define HIWORD(_dw) ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff)) - #define LODWORD(_qw) ((DWORD)(_qw)) - #define HIDWORD(_qw) ((DWORD)(((_qw) >> 32) & 0xffffffff)) +#undef __in +#undef __out +#undef __inline + - #endif // _INTSAFE_H_INCLUDED_ - ---- include/mapinls.h.orig 2005-04-14 17:54:46.000000000 +0900 -+++ include/mapinls.h 2006-12-30 20:46:11.125000000 +0900 -@@ -72,7 +72,7 @@ - typedef const void FAR * LPCVOID; - - #ifndef _MAC --#ifndef LPOLESTR -+#ifndef OLESTR - #if !defined (_WIN32) - - #define LPOLESTR LPSTR -@@ -88,9 +88,11 @@ - #define OLESTR(str) L##str - - #endif /* !_WIN32 */ --#endif /* LPOLESTR */ -+#endif /* OLESTR */ - #endif /* _MAC */ + #endif // _MSI_H_ -+#ifndef NORM_IGNORECASE -+ - #define NORM_IGNORECASE 0x00000001 /* ignore case */ - #define NORM_IGNORENONSPACE 0x00000002 /* ignore diacritics */ - #define NORM_IGNORESYMBOLS 0x00000004 /* ignore symbols */ -@@ -103,6 +105,8 @@ - #define NORM_IGNOREKANATYPE 0x00000040 /* ignore kanatype */ - #endif +--- include/msiquery.h.orig 2008-01-18 22:17:28.000000000 +0900 ++++ include/msiquery.h 2009-08-21 09:21:56.000000000 +0900 +@@ -21,6 +21,14 @@ + #define _MSIQUERY_H_ + #include "msi.h" // INSTALLSTATE -+#endif /* NORM_IGNORECASE */ ++#define __in ++#define __out ++#ifdef __cplusplus ++#define __inline inline ++#else ++#define __inline static __inline__ ++#endif + - #if defined(WIN16) + #define MSI_NULL_INTEGER 0x80000000 // integer value reserved for null - #define lstrcpyA lstrcpy ---- include/mapiwin.h.orig 2003-03-26 16:34:38.000000000 +0900 -+++ include/mapiwin.h 2004-12-28 21:41:14.000000000 +0900 -@@ -428,5 +428,5 @@ + // MsiOpenDatabase persist predefine values, otherwise output database path is used +@@ -1026,5 +1034,9 @@ + } #endif - #endif /* __MAPIWIN_H__ */ -- ++#undef __in ++#undef __out ++#undef __inline + + #endif // _MSIQUERY_H_ ---- include/msdasc.h.orig 2005-04-04 18:50:18.000000000 +0900 -+++ include/msdasc.h 2007-01-05 21:47:51.515625000 +0900 -@@ -1,3 +1,6 @@ -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif - - - /* this ALWAYS GENERATED file contains the definitions for the interfaces */ ---- include/multimon.h.orig 2005-04-14 17:54:52.000000000 +0900 -+++ include/multimon.h 2006-12-31 18:00:37.203125000 +0900 +--- include/multimon.h.orig 2008-01-18 22:17:30.000000000 +0900 ++++ include/multimon.h 2009-08-21 09:21:56.000000000 +0900 @@ -175,7 +175,7 @@ BOOL IsPlatformNT() @@ -1448,8 +1185,26 @@ #endif // __NTQUERY_H__ ---- include/ocidl.h.orig 2008-03-22 06:10:42.272000000 +1000 -+++ include/ocidl.h 2009-02-16 21:34:39.065125000 +0900 +--- include/oaidl.h.orig 2008-12-06 11:32:03.000000000 +0900 ++++ include/oaidl.h 2010-02-27 13:28:29.448250000 +0900 +@@ -1,3 +1,6 @@ ++#if __GNUC__ >=3 ++#pragma GCC system_header ++#endif + + + /* this ALWAYS GENERATED file contains the definitions for the interfaces */ +@@ -442,7 +445,7 @@ + FLOAT fltVal; + DOUBLE dblVal; + VARIANT_BOOL boolVal; +- _VARIANT_BOOL bool; ++// _VARIANT_BOOL bool; + SCODE scode; + CY cyVal; + DATE date; +--- include/ocidl.h.orig 2008-01-18 22:17:32.000000000 +0900 ++++ include/ocidl.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1497,8 +1252,8 @@ #endif ---- include/oleauto.h.orig 2008-03-22 06:10:43.225125000 +1000 -+++ include/oleauto.h 2009-02-16 21:34:39.065125000 +0900 +--- include/oleauto.h.orig 2008-01-18 22:17:32.000000000 +0900 ++++ include/oleauto.h 2009-08-21 09:21:56.000000000 +0900 @@ -56,6 +56,14 @@ /* pull in the MIDL generated header */ #include <oaidl.h> @@ -1514,17 +1269,7 @@ /*---------------------------------------------------------------------*/ /* BSTR API */ -@@ -948,6 +956,9 @@ - /* ICreateTypeLib */ - /*---------------------------------------------------------------------*/ - -+typedef interface ICreateTypeLib ICreateTypeLib; -+typedef interface ICreateTypeLib2 ICreateTypeLib2; -+typedef interface ICreateTypeInfo ICreateTypeInfo; - typedef ICreateTypeLib * LPCREATETYPELIB; - - typedef ICreateTypeInfo * LPCREATETYPEINFO; -@@ -1160,7 +1171,7 @@ +@@ -1160,7 +1168,7 @@ // Declare variant access functions. @@ -1533,7 +1278,7 @@ #define V_UNION(X, Y) ((X)->n1.n2.n3.Y) #define V_VT(X) ((X)->n1.n2.vt) #define V_RECORDINFO(X) ((X)->n1.n2.n3.brecVal.pRecInfo) -@@ -1242,5 +1253,9 @@ +@@ -1242,5 +1250,9 @@ #include <poppack.h> #endif // RC_INVOKED @@ -1543,8 +1288,35 @@ + #endif // __OLEAUTO_H__ ---- include/oledb.h.orig 2005-04-04 18:50:18.000000000 +0900 -+++ include/oledb.h 2007-01-02 17:16:30.656250000 +0900 +--- include/olectl.h.orig 2008-01-18 22:17:32.000000000 +0900 ++++ include/olectl.h 2009-08-21 09:21:56.000000000 +0900 +@@ -28,6 +28,14 @@ + #include <ocidl.h> + #endif // _MAC + ++#define __in ++#define __out ++#ifdef __cplusplus ++#define __inline inline ++#else ++#define __inline static __inline__ ++#endif ++ + #ifdef _OLEAUT32_ + #define WINOLECTLAPI STDAPI + #define WINOLECTLAPI_(type) STDAPI_(type) +@@ -616,5 +624,9 @@ + + #endif // defined(__MKTYPLIB__) || defined(__midl) + ++#undef __in ++#undef __out ++#undef __inline ++ + #endif // _OLECTL_H_ + +--- include/oledb.h.orig 2008-01-18 22:17:32.000000000 +0900 ++++ include/oledb.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1561,8 +1333,8 @@ #define _FILETIME_ typedef struct _FILETIME { DWORD dwLowDateTime; ---- include/oleidl.h.orig 2008-03-22 06:10:42.350125000 +1000 -+++ include/oleidl.h 2009-02-16 21:34:39.065125000 +0900 +--- include/oleidl.h.orig 2008-01-18 22:17:32.000000000 +0900 ++++ include/oleidl.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1597,8 +1369,15 @@ --- include/propidl.h.orig 2008-01-18 22:17:32.000000000 +0900 -+++ include/propidl.h 2009-02-16 21:34:39.065125000 +0900 -@@ -76,6 +76,14 @@ ++++ include/propidl.h 2010-02-27 14:11:52.213875000 +0900 +@@ -1,3 +1,6 @@ ++#if __GNUC__ >=3 ++#pragma GCC system_header ++#endif + + + /* this ALWAYS GENERATED file contains the definitions for the interfaces */ +@@ -76,6 +79,14 @@ #include "objidl.h" #include "oaidl.h" @@ -1613,37 +1392,87 @@ #ifdef __cplusplus extern "C"{ #endif -@@ -285,11 +293,6 @@ - #define tag_inner_PROPVARIANT - #endif +@@ -143,6 +154,7 @@ + CHAR *pElems; + } CAC; --#if !defined(_MSC_EXTENSIONS) -- --struct tagPROPVARIANT; -- --#else - #ifndef MIDL_PASS - struct tagPROPVARIANT { - union { -@@ -316,7 +319,7 @@ - FLOAT fltVal; - DOUBLE dblVal; - VARIANT_BOOL boolVal; -- _VARIANT_BOOL bool; -+// _VARIANT_BOOL bool; - SCODE scode; - CY cyVal; - DATE date; -@@ -384,8 +387,6 @@ - }; ++#if 0 + typedef struct tagCAUB + { + ULONG cElems; +@@ -268,7 +280,9 @@ + ULONG cElems; + CLSID *pElems; + } CACLSID; ++#endif + ++#if 0 + #ifdef MIDL_PASS + // This is the PROPVARIANT padding layout for marshaling. + typedef BYTE PROPVAR_PAD1; +@@ -385,6 +399,7 @@ #endif --#endif /* _MSC_EXTENSIONS */ -- + #endif /* _MSC_EXTENSIONS */ ++#endif + #ifdef MIDL_PASS // This is the LPPROPVARIANT definition for marshaling. - typedef struct tag_inner_PROPVARIANT *LPPROPVARIANT; -@@ -1268,6 +1269,10 @@ +@@ -509,6 +524,7 @@ + + #define PRSPEC_PROPID ( 1 ) + ++#if 0 + typedef struct tagPROPSPEC + { + ULONG ulKind; +@@ -526,12 +542,14 @@ + PROPID propid; + VARTYPE vt; + } STATPROPSTG; ++#endif + + // Macros for parsing the OS Version of the Property Set Header + #define PROPSETHDR_OSVER_KIND(dwOSVer) HIWORD( (dwOSVer) ) + #define PROPSETHDR_OSVER_MAJOR(dwOSVer) LOBYTE(LOWORD( (dwOSVer) )) + #define PROPSETHDR_OSVER_MINOR(dwOSVer) HIBYTE(LOWORD( (dwOSVer) )) + #define PROPSETHDR_OSVERSION_UNKNOWN 0xFFFFFFFF ++#if 0 + typedef struct tagSTATPROPSETSTG + { + FMTID fmtid; +@@ -542,12 +560,14 @@ + FILETIME atime; + DWORD dwOSVersion; + } STATPROPSETSTG; ++#endif + + + + extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0000_v0_0_c_ifspec; + extern RPC_IF_HANDLE __MIDL_itf_propidl_0000_0000_v0_0_s_ifspec; + ++#if 0 + #ifndef __IPropertyStorage_INTERFACE_DEFINED__ + #define __IPropertyStorage_INTERFACE_DEFINED__ + +@@ -1119,7 +1139,6 @@ + #endif /* C style interface */ + + +- + /* [call_as] */ HRESULT STDMETHODCALLTYPE IEnumSTATPROPSETSTG_RemoteNext_Proxy( + IEnumSTATPROPSETSTG * This, + /* [in] */ ULONG celt, +@@ -1136,6 +1155,7 @@ + + + #endif /* __IEnumSTATPROPSETSTG_INTERFACE_DEFINED__ */ ++#endif + + + /* interface __MIDL_itf_propidl_0000_0004 */ +@@ -1268,6 +1287,10 @@ } #endif @@ -1654,8 +1483,21 @@ #endif ---- include/propsys.h.orig 2008-03-22 06:10:42.412625000 +1000 -+++ include/propsys.h 2009-02-16 21:34:39.065125000 +0900 +--- include/propkeydef.h.orig 2008-01-18 22:17:32.000000000 +0900 ++++ include/propkeydef.h 2009-08-21 09:21:56.000000000 +0900 +@@ -2,6 +2,10 @@ + #define PID_FIRST_USABLE 2 + #endif + ++#ifndef __MIDL_CONST ++#define __MIDL_CONST const ++#endif ++ + #ifndef REFPROPERTYKEY + #ifdef __cplusplus + #define REFPROPERTYKEY const PROPERTYKEY & +--- include/propsys.h.orig 2008-01-18 22:17:34.000000000 +0900 ++++ include/propsys.h 2009-08-21 09:21:56.000000000 +0900 @@ -228,6 +228,14 @@ #endif // 0 #include <propkeydef.h> @@ -1682,32 +1524,25 @@ #endif ---- include/qedit.h.orig 2005-04-14 17:54:56.000000000 +0900 -+++ include/qedit.h 2007-01-02 22:11:05.140625000 +0900 -@@ -1,3 +1,6 @@ -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif - +--- include/propvarutil.h.orig 2008-01-18 22:17:34.000000000 +0900 ++++ include/propvarutil.h 2010-02-26 19:34:40.863625000 +0900 +@@ -14,6 +14,14 @@ + #include <shtypes.h> + #include <shlwapi.h> - /* this ALWAYS GENERATED file contains the definitions for the interfaces */ -@@ -6546,10 +6549,10 @@ - #define DEX_IDS_GRAPH_ERROR 1427 - #define DEX_IDS_GRID_ERROR 1428 - #define DEX_IDS_INTERFACE_ERROR 1429 --EXTERN_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); --EXTERN_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); --EXTERN_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); --EXTERN_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -+DEFINE_GUID(CLSID_VideoEffects1Category, 0xcc7bfb42, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -+DEFINE_GUID(CLSID_VideoEffects2Category, 0xcc7bfb43, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -+DEFINE_GUID(CLSID_AudioEffects1Category, 0xcc7bfb44, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); -+DEFINE_GUID(CLSID_AudioEffects2Category, 0xcc7bfb45, 0xf175, 0x11d1, 0xa3, 0x92, 0x0, 0xe0, 0x29, 0x1f, 0x39, 0x59); - - - extern RPC_IF_HANDLE __MIDL_itf_qedit_0001_0097_v0_0_c_ifspec; ++#define __in ++#define __out ++#ifdef __cplusplus ++#define __inline inline ++#else ++#define __inline static __inline__ ++#endif ++ + #ifndef PSSTDAPI + #if defined(_PROPSYS_) + #define PSSTDAPI STDAPI --- include/shlobj.h.orig 2008-01-18 22:17:36.000000000 +0900 -+++ include/shlobj.h 2009-02-16 21:34:39.065125000 +0900 ++++ include/shlobj.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -1730,538 +1565,16 @@ #if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma once #endif -@@ -250,9 +261,10 @@ - #define GIL_FORCENOSHIELD 0x0400 // icon must *not* be "stamped" with the LUA shield - - #undef INTERFACE -+EXTERN_C const IID IID_IExtractIconA; - #define INTERFACE IExtractIconA - --DECLARE_INTERFACE_IID_(IExtractIconA, IUnknown, "000214eb-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IExtractIconA, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -278,9 +290,10 @@ - typedef IExtractIconA * LPEXTRACTICONA; - - #undef INTERFACE -+EXTERN_C const IID IID_IExtractIconW; - #define INTERFACE IExtractIconW - --DECLARE_INTERFACE_IID_(IExtractIconW, IUnknown, "000214fa-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IExtractIconW, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -350,9 +363,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_IShellIconOverlayIdentifier; - #define INTERFACE IShellIconOverlayIdentifier - --DECLARE_INTERFACE_IID_(IShellIconOverlayIdentifier, IUnknown, "0c6c4200-c589-11d0-999a-00c04fd655e1") -+DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -399,9 +413,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_IShellIconOverlayManager; - #define INTERFACE IShellIconOverlayManager - --DECLARE_INTERFACE_IID_(IShellIconOverlayManager, IUnknown, "f10b5e34-dd3b-42a7-aa7d-2f4ec54bb09b") -+DECLARE_INTERFACE_(IShellIconOverlayManager, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -447,9 +462,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_IShellIconOverlay; - #define INTERFACE IShellIconOverlay - --DECLARE_INTERFACE_IID_(IShellIconOverlay, IUnknown, "7d688a70-c613-11d0-999b-00c04fd655e1") -+DECLARE_INTERFACE_(IShellIconOverlay, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -636,9 +652,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_IShellExecuteHookA; - #define INTERFACE IShellExecuteHookA - --DECLARE_INTERFACE_IID_(IShellExecuteHookA, IUnknown, "000214f5-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -650,9 +667,10 @@ - }; - - #undef INTERFACE -+EXTERN_C const IID IID_IShellExecuteHookW; - #define INTERFACE IShellExecuteHookW - --DECLARE_INTERFACE_IID_(IShellExecuteHookW, IUnknown, "000214fb-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -679,9 +697,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_IURLSearchHook; - #define INTERFACE IURLSearchHook - --DECLARE_INTERFACE_IID_(IURLSearchHook, IUnknown, "ac60f6a0-0fd9-11d0-99cb-00c04fd64497") -+DECLARE_INTERFACE_(IURLSearchHook, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -693,9 +712,10 @@ - }; - - #undef INTERFACE -+EXTERN_C const IID IID_ISearchContext; - #define INTERFACE ISearchContext - --DECLARE_INTERFACE_IID_(ISearchContext, IUnknown, "09F656A2-41AF-480C-88F7-16CC0D164615") -+DECLARE_INTERFACE_(ISearchContext, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -709,9 +729,10 @@ - }; - - #undef INTERFACE -+EXTERN_C const IID IID_IURLSearchHook2; - #define INTERFACE IURLSearchHook2 - --DECLARE_INTERFACE_IID_(IURLSearchHook2, IURLSearchHook, "5ee44da4-6d32-46e3-86bc-07540dedd0e0") -+DECLARE_INTERFACE_(IURLSearchHook2, IURLSearchHook) - { - // *** IURLSearchHook2 methods *** - STDMETHOD(TranslateWithSearchContext)(THIS_ __out_ecount(cchBufferSize) LPWSTR lpwszSearchURL, DWORD cchBufferSize, __in_opt ISearchContext * pSearchContext) PURE; -@@ -724,9 +745,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_INewShortcutHookA; - #define INTERFACE INewShortcutHookA - --DECLARE_INTERFACE_IID_(INewShortcutHookA, IUnknown, "000214e1-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -743,9 +765,10 @@ - }; - - #undef INTERFACE -+EXTERN_C const IID IID_INewShortcutHookW; - #define INTERFACE INewShortcutHookW - --DECLARE_INTERFACE_IID_(INewShortcutHookW, IUnknown, "000214f7-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -800,9 +823,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_ICopyHookA; - #define INTERFACE ICopyHookA - --DECLARE_INTERFACE_IID_(ICopyHookA, IUnknown, "000214EF-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(ICopyHookA, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -817,9 +841,10 @@ - typedef ICopyHookA * LPCOPYHOOKA; - - #undef INTERFACE -+EXTERN_C const IID IID_ICopyHookW; - #define INTERFACE ICopyHookW - --DECLARE_INTERFACE_IID_(ICopyHookW, IUnknown, "000214FC-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(ICopyHookW, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -853,9 +878,10 @@ - //=========================================================================== - - #undef INTERFACE -+EXTERN_C const IID IID_IFileViewerSite; - #define INTERFACE IFileViewerSite - --DECLARE_INTERFACE_IID_(IFileViewerSite, IUnknown, "000214f3-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IFileViewerSite, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -912,9 +938,10 @@ - #define FVSIF_CANVIEWIT 0x40000000 // The viewer can view it. - - #undef INTERFACE -+EXTERN_C const IID IID_IFileViewerA; - #define INTERFACE IFileViewerA - --DECLARE_INTERFACE_IID(IFileViewerA, "000214f0-0000-0000-c000-000000000046") -+DECLARE_INTERFACE(IFileViewerA) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -930,9 +957,10 @@ - typedef IFileViewerA * LPFILEVIEWERA; - - #undef INTERFACE -+EXTERN_C const IID IID_IFileViewerW; - #define INTERFACE IFileViewerW - --DECLARE_INTERFACE_IID(IFileViewerW, "000214f8-0000-0000-c000-000000000046") -+DECLARE_INTERFACE(IFileViewerW) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1484,9 +1512,10 @@ - // implement IShellFolder2::GetDetailsOf()/GetDetailsEx() instead - - #undef INTERFACE -+EXTERN_C const IID IID_IShellDetails; - #define INTERFACE IShellDetails - --DECLARE_INTERFACE_IID_(IShellDetails, IUnknown, "000214EC-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IShellDetails, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1513,9 +1542,10 @@ - // - - #undef INTERFACE -+EXTERN_C const IID IID_IObjMgr; - #define INTERFACE IObjMgr - --DECLARE_INTERFACE_IID_(IObjMgr, IUnknown, "00BB2761-6A77-11D0-A535-00C04FD7D062") -+DECLARE_INTERFACE_(IObjMgr, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1547,9 +1577,10 @@ - // - - #undef INTERFACE -+EXTERN_C const IID IID_ICurrentWorkingDirectory; - #define INTERFACE ICurrentWorkingDirectory - --DECLARE_INTERFACE_IID_(ICurrentWorkingDirectory, IUnknown, "91956D21-9276-11d1-921A-006097DF5BD4") -+DECLARE_INTERFACE_(ICurrentWorkingDirectory, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1578,9 +1609,10 @@ - // - - #undef INTERFACE -+EXTERN_C const IID IID_IACList; - #define INTERFACE IACList - --DECLARE_INTERFACE_IID_(IACList, IUnknown, "77A130B0-94FD-11D0-A544-00C04FD7d062") -+DECLARE_INTERFACE_(IACList, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1597,6 +1629,7 @@ - // List COM object that implements this interface. - - #undef INTERFACE -+EXTERN_C const IID IID_IACList2; - #define INTERFACE IACList2 - - typedef enum _tagAUTOCOMPLETELISTOPTIONS -@@ -1615,7 +1648,7 @@ - #endif - } AUTOCOMPLETELISTOPTIONS; - --DECLARE_INTERFACE_IID_(IACList2, IACList, "470141a0-5186-11d2-bbb6-0060977b464c") -+DECLARE_INTERFACE_(IACList2, IACList) - { - // *** IACList2 specific methods *** - STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE; -@@ -1692,9 +1725,10 @@ - - - #undef INTERFACE -+EXTERN_C const IID IID_IProgressDialog; - #define INTERFACE IProgressDialog - --DECLARE_INTERFACE_IID_(IProgressDialog, IUnknown, "EBBC7C04-315E-11d2-B62F-006097DF5BD4") -+DECLARE_INTERFACE_(IProgressDialog, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1751,9 +1785,10 @@ - - - #undef INTERFACE -+EXTERN_C const IID IID_IDockingWindowSite; - #define INTERFACE IDockingWindowSite - --DECLARE_INTERFACE_IID_(IDockingWindowSite, IOleWindow, "2a342fc2-7b26-11d0-8ca9-00a0c92dbfe8") -+DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -1800,9 +1835,10 @@ - - - #undef INTERFACE -+EXTERN_C const IID IID_IDockingWindowFrame; - #define INTERFACE IDockingWindowFrame - --DECLARE_INTERFACE_IID_(IDockingWindowFrame, IOleWindow, "47d2657a-7b27-11d0-8ca9-00a0c92dbfe8") -+DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -1829,9 +1865,10 @@ - */ - - #undef INTERFACE -+EXTERN_C const IID IID_IThumbnailCapture; - #define INTERFACE IThumbnailCapture - --DECLARE_INTERFACE_IID_(IThumbnailCapture, IUnknown, "4ea39266-7211-409f-b622-f63dbd16c533") -+DECLARE_INTERFACE_(IThumbnailCapture, IUnknown) - { - // *** IThumbnailCapture methods *** - STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize, -@@ -1856,9 +1893,10 @@ - #include <poppack.h> /* Return to byte packing */ - - #undef INTERFACE -+EXTERN_C const IID IID_IEnumShellImageStore; - #define INTERFACE IEnumShellImageStore - --DECLARE_INTERFACE_IID_( IEnumShellImageStore, IUnknown, "6DFD582B-92E3-11D1-98A3-00C04FB687DA" ) -+DECLARE_INTERFACE_( IEnumShellImageStore, IUnknown) - { - STDMETHOD ( QueryInterface ) ( THIS_ REFIID riid, void **ppv ) PURE; - STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE; -@@ -1878,11 +1916,12 @@ - #define SHIMSTCAPFLAG_PURGEABLE 0x0002 // does the store require dead items purging externally ? - - #undef INTERFACE -+EXTERN_C const IID IID_IShellImageStore; - #define INTERFACE IShellImageStore - - // this interface is used to manipulate the Image cache. It can potentially be used - // in a free threaded manner in conjunction with the Lock parameter to Open and close --DECLARE_INTERFACE_IID_( IShellImageStore, IUnknown, "48C8118C-B924-11D1-98D5-00C04FB687DA" ) -+DECLARE_INTERFACE_( IShellImageStore, IUnknown) - { - STDMETHOD ( QueryInterface )( THIS_ REFIID riid, void **ppv ) PURE; - STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE; -@@ -1961,9 +2000,10 @@ - #include <poppack.h> /* Return to byte packing */ - - #undef INTERFACE -+EXTERN_C const IID IID_IShellFolderBand; - #define INTERFACE IShellFolderBand - --DECLARE_INTERFACE_IID_(IShellFolderBand, IUnknown, "7FE80CC8-C247-11d0-B93A-00A0C90312E1") -+DECLARE_INTERFACE_(IShellFolderBand, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -1984,9 +2024,10 @@ - //// IDeskBarClient - - #undef INTERFACE -+EXTERN_C const IID IID_IDeskBarClient; - #define INTERFACE IDeskBarClient - --DECLARE_INTERFACE_IID_(IDeskBarClient, IOleWindow, "EB0FE175-1A3A-11D0-89B3-00A0C90A90AC") -+DECLARE_INTERFACE_(IDeskBarClient, IOleWindow) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -2238,9 +2279,10 @@ - // - - #undef INTERFACE -+EXTERN_C const IID IID_IActiveDesktop; - #define INTERFACE IActiveDesktop - --DECLARE_INTERFACE_IID_(IActiveDesktop, IUnknown, "f490eb00-1240-11d1-9888-006097deacf9") -+DECLARE_INTERFACE_(IActiveDesktop, IUnknown) - { - // IUnknown methods - STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE; -@@ -2288,9 +2330,10 @@ - #define SCHEME_CREATE 0x0080 - - #undef INTERFACE -+EXTERN_C const IID IID_IActiveDesktopP; - #define INTERFACE IActiveDesktopP - --DECLARE_INTERFACE_IID_(IActiveDesktopP, IUnknown, "52502EE0-EC80-11D0-89AB-00C04FC2972D") -+DECLARE_INTERFACE_(IActiveDesktopP, IUnknown) - { - // IUnknown methods - STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE; -@@ -2311,9 +2354,10 @@ - #define GADOF_DIRTY 0x00000001 - - #undef INTERFACE -+EXTERN_C const IID IID_IADesktopP2; - #define INTERFACE IADesktopP2 - --DECLARE_INTERFACE_IID_(IADesktopP2, IUnknown, "B22754E2-4574-11d1-9888-006097DEACF9") -+DECLARE_INTERFACE_(IADesktopP2, IUnknown) - { - // IUnknown methods - STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE; -@@ -2375,11 +2419,12 @@ - #include <poppack.h> /* Return to byte packing */ - - #undef INTERFACE -+EXTERN_C const IID IID_IColumnProvider; - #define INTERFACE IColumnProvider - - // Note: these objects must be threadsafe! GetItemData _will_ be called - // simultaneously from multiple threads. --DECLARE_INTERFACE_IID_(IColumnProvider, IUnknown, "E8025004-1C42-11d2-BE2C-00A0C9A83DA1") -+DECLARE_INTERFACE_(IColumnProvider, IUnknown) - { - // IUnknown methods - STDMETHOD (QueryInterface)(THIS_ REFIID riid, __out void **ppv) PURE; -@@ -2698,9 +2743,10 @@ - // IShellChangeNotify - // - #undef INTERFACE -+EXTERN_C const IID IID_IShellChangeNotify; - #define INTERFACE IShellChangeNotify - --DECLARE_INTERFACE_IID_(IShellChangeNotify, IUnknown, "D82BE2B1-5764-11D0-A96E-00C04FD705A2") -+DECLARE_INTERFACE_(IShellChangeNotify, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -2723,9 +2769,10 @@ - //------------------------------------------------------------------------- - - #undef INTERFACE -+EXTERN_C const IID IID_IQueryInfo; - #define INTERFACE IQueryInfo - --DECLARE_INTERFACE_IID_(IQueryInfo, IUnknown, "00021500-0000-0000-c000-000000000046") -+DECLARE_INTERFACE_(IQueryInfo, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -3117,7 +3164,7 @@ +@@ -3117,7 +3128,7 @@ SHSTDAPI_(BOOL) ILIsEqual(__in PCIDLIST_ABSOLUTE pidl1, __in PCIDLIST_ABSOLUTE pidl2); SHSTDAPI_(BOOL) ILIsParent(__in PCIDLIST_ABSOLUTE pidl1, __in PCIDLIST_ABSOLUTE pidl2, BOOL fImmediate); SHSTDAPI ILSaveToStream(__in IStream *pstm, __in PCUIDLIST_RELATIVE pidl); -DECLSPEC_DEPRECATED SHSTDAPI ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl); -+//SHSTDAPI ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl); ++SHSTDAPI ILLoadFromStream(__in IStream *pstm, __inout PIDLIST_RELATIVE *pidl); SHSTDAPI ILLoadFromStreamEx(__in IStream *pstm, __deref_out PIDLIST_RELATIVE *pidl); #if (_WIN32_IE >= 0x0400) -@@ -3188,8 +3235,9 @@ - - #if (NTDDI_VERSION >= NTDDI_WIN2K && NTDDI_VERSION < NTDDI_VISTA) - #undef INTERFACE -+EXTERN_C const IID IID_IDefViewFrame; - #define INTERFACE IDefViewFrame --DECLARE_INTERFACE_IID_(IDefViewFrame, IUnknown, "710EB7A0-45ED-11D0-924A-0020AFC7AC4D") -+DECLARE_INTERFACE_(IDefViewFrame, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, __out void **ppv) PURE; -@@ -3522,8 +3570,9 @@ - // IDocViewSite - // - #undef INTERFACE -+EXTERN_C const IID IID_IDocViewSite; - #define INTERFACE IDocViewSite --DECLARE_INTERFACE_IID_(IDocViewSite, IUnknown, "87D605E0-C511-11CF-89A9-00A0C9054129") -+DECLARE_INTERFACE_(IDocViewSite, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; -@@ -3588,9 +3637,10 @@ - SHSTDAPI_(BOOL) IsUserAnAdmin(void); - - #undef INTERFACE -+EXTERN_C const IID IID_IInitializeObject; - #define INTERFACE IInitializeObject - --DECLARE_INTERFACE_IID_(IInitializeObject, IUnknown, "4622AD16-FF23-11d0-8D34-00A0C90F2719") -+DECLARE_INTERFACE_(IInitializeObject, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -3609,9 +3659,10 @@ - }; - - #undef INTERFACE -+EXTERN_C const IID IID_IBanneredBar; - #define INTERFACE IBanneredBar - --DECLARE_INTERFACE_IID_(IBanneredBar, IUnknown, "596A9A94-013E-11d1-8D34-00A0C90F2719") -+DECLARE_INTERFACE_(IBanneredBar, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -3633,9 +3684,10 @@ - - // - #undef INTERFACE -+EXTERN_C const IID IID_IShellFolderViewCB; - #define INTERFACE IShellFolderViewCB - --DECLARE_INTERFACE_IID_(IShellFolderViewCB, IUnknown, "2047E320-F2A9-11CE-AE65-08002B2E1262") -+DECLARE_INTERFACE_(IShellFolderViewCB, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -3774,9 +3826,10 @@ - #define SFVS_SELECT_INVERT 0x2 // Inver the selection - - #undef INTERFACE -+EXTERN_C const IID IID_IShellFolderView; - #define INTERFACE IShellFolderView - --DECLARE_INTERFACE_IID_(IShellFolderView, IUnknown, "37A378C0-F82D-11CE-AE65-08002B2E1262") -+DECLARE_INTERFACE_(IShellFolderView, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -4358,8 +4411,9 @@ - // - //-------------------------------------------------------------------------- - #undef INTERFACE -+EXTERN_C const IID IID_INamedPropertyBag; - #define INTERFACE INamedPropertyBag --DECLARE_INTERFACE_IID_(INamedPropertyBag, IUnknown, "FB700430-952C-11d1-946F-000000000000") -+DECLARE_INTERFACE_(INamedPropertyBag, IUnknown) - { - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; -@@ -4578,5 +4632,9 @@ +@@ -4578,5 +4589,9 @@ #endif #endif @@ -2272,7 +1585,7 @@ #endif /* _SHLOBJ_H_ */ --- include/shobjidl.h.orig 2008-01-18 22:17:36.000000000 +0900 -+++ include/shobjidl.h 2009-02-16 21:34:39.065125000 +0900 ++++ include/shobjidl.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -2311,15 +1624,7 @@ extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0026_v0_0_c_ifspec; -@@ -7323,6 +7334,7 @@ - #define FCT_MERGE 0x0001 - #define FCT_CONFIGABLE 0x0002 - #define FCT_ADDTOEND 0x0004 -+ - #ifdef _NEVER_ - typedef LPARAM LPTBBUTTONSB; - -@@ -7331,6 +7343,13 @@ +@@ -7331,6 +7342,13 @@ typedef LPTBBUTTON LPTBBUTTONSB; #endif //_NEVER_ @@ -2333,7 +1638,7 @@ extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0032_v0_0_c_ifspec; extern RPC_IF_HANDLE __MIDL_itf_shobjidl_0000_0032_v0_0_s_ifspec; -@@ -29000,6 +29019,10 @@ +@@ -29000,6 +29018,10 @@ } #endif @@ -2344,8 +1649,8 @@ #endif ---- include/shtypes.h.orig 2006-12-30 18:12:26.093750000 +0900 -+++ include/shtypes.h 2006-12-30 18:24:10.953125000 +0900 +--- include/shtypes.h.orig 2008-01-18 22:17:36.000000000 +0900 ++++ include/shtypes.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -2362,118 +1667,8 @@ typedef /* [wire_marshal] */ ITEMIDLIST __unaligned *LPITEMIDLIST; ---- include/specstrings.h.orig 2008-01-18 22:17:38.000000000 +0900 -+++ include/specstrings.h 2009-02-16 21:34:39.065125000 +0900 -@@ -6,7 +6,106 @@ - #if _MSC_VER - #pragma once - #endif --#include <sal.h> -+//#include <sal.h> -+#define __RPC__deref_in_ecount_full_opt(x) -+#define __RPC__deref_inout_opt -+#define __RPC__deref_opt_inout_opt -+#define __RPC__deref_opt_inout_ecount_full_opt(x) -+#define __RPC__deref_out -+#define __RPC__deref_out_ecount_full_opt(x) -+#define __RPC__deref_out_opt -+#define __RPC__deref_out_opt_string -+#define __RPC__in -+#define __RPC__in_ecount_full(x) -+#define __RPC__in_ecount_full_opt(x) -+#define __RPC__in_opt -+#define __RPC__inout -+#define __RPC__inout_ecount_full(x) -+#define __RPC__inout_ecount_full_opt(x) -+#define __RPC__inout_opt -+#define __RPC__out -+#define __RPC__out_ecount_full(x) -+#define __RPC__out_ecount_full_string(x) -+#define __RPC__out_ecount_part(x,y) -+#define __RPC_unique_pointer -+#define __callback -+#define __inner_checkReturn -+#define __inner_control_entrypoint(x) -+#define __control_entrypoint(x) -+#define __data_entrypoint(x) -+#define __deref -+#define __deref_inout -+#define __deref_inout_ecount_z(x) -+#define __deref_inout_opt -+#define __deref_opt_inout_bcount_part_opt(x,y) -+#define __deref_opt_inout_opt -+#define __deref_opt_out -+#define __deref_opt_out_bcount(x) -+#define __deref_opt_out_ecount(x) -+#define __deref_opt_out_opt -+#define __deref_out -+#define __deref_out_bcount(x) -+#define __deref_out_bcount_opt(x) -+#define __deref_out_ecount(x) -+#define __deref_out_ecount_opt(x) -+#define __deref_out_ecount_part(x,y) -+#define __deref_out_opt -+#define __deref_out_z -+#define __deref_out_z_opt -+#define __format_string -+#define __in -+#define __in_bcount(x) -+#define __in_bcount_opt(x) -+#define __in_ecount(x) -+#define __in_ecount_opt(x) -+#define __in_opt -+#define __in_z -+#define __in_z_opt -+#define __inout -+#define __inout_bcount(x) -+#define __inout_bcount_full(x) -+#define __inout_bcount_opt(x) -+#define __inout_bcount_part(x,y) -+#define __inout_bcount_part_opt(x,y) -+#define __inout_ecount(x) -+#define __inout_ecount_opt(x) -+#define __inout_opt -+#define __nullnullterminated -+#define __nullterminated -+#define __out -+#define __out_bcount(x) -+#define __out_bcount_full(x) -+#define __out_bcount_opt(x) -+#define __out_bcount_part(x,y) -+#define __out_bcount_part_opt(x,y) -+#define __out_ecount(x) -+#define __out_ecount_full(x) -+#define __out_ecount_opt(x) -+#define __out_ecount_part(x,y) -+#define __out_ecount_part_opt(x,y) -+#define __out_opt -+#define __out_xcount(x) -+#define __out_xcount_opt(x) -+#define __reserved -+#define __success(x) -+#define __typefix(x) -+#define __post -+#define __deref -+#define __pre -+#define __exceptthat -+#define __notnull -+#define __maybenull -+#define __byte_writableTo(x) -+#define __valid -+#define __refparam -+#define __elem_writableTo(x) -+#ifdef __cplusplus -+#define __forceinline inline -+#define __inline inline -+#else -+#define __forceinline static __inline__ -+#define __inline static __inline__ -+#endif - - #ifndef __SAL_H_FULL_VER - #define __SAL_H_FULL_VER 140050727 ---- include/sspi.h.orig 2008-03-22 06:10:42.631375000 +1000 -+++ include/sspi.h 2009-02-16 21:34:39.065125000 +0900 +--- include/sspi.h.orig 2008-01-18 22:17:38.000000000 +0900 ++++ include/sspi.h 2009-08-21 09:21:56.000000000 +0900 @@ -20,6 +20,14 @@ #define __SSPI_H__ // end_ntifs @@ -2608,8 +1803,8 @@ + #endif // _STRSAFE_H_INCLUDED_ ---- include/structuredquery.h.orig 2008-03-22 06:10:42.756375000 +1000 -+++ include/structuredquery.h 2009-02-16 21:34:39.065125000 +0900 +--- include/structuredquery.h.orig 2008-01-18 22:17:38.000000000 +0900 ++++ include/structuredquery.h 2009-08-21 09:21:56.000000000 +0900 @@ -233,6 +233,14 @@ #include "ocidl.h" #include "propidl.h" @@ -2636,8 +1831,8 @@ #endif ---- include/urlmon.h.orig 2008-03-22 06:10:42.818875000 +1000 -+++ include/urlmon.h 2009-02-16 21:34:39.065125000 +0900 +--- include/urlmon.h.orig 2008-01-18 22:17:40.000000000 +0900 ++++ include/urlmon.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -2725,19 +1920,22 @@ #endif // __WINCRYPT_H__ ---- include/winerror.h.orig 2008-03-20 13:39:15.127375000 +0900 -+++ include/winerror.h 2008-03-20 14:33:29.097125000 +0900 -@@ -23065,7 +23065,7 @@ +--- include/winerror.h.orig 2008-01-18 22:17:42.000000000 +0900 ++++ include/winerror.h 2009-08-21 09:21:56.000000000 +0900 +@@ -23,6 +23,11 @@ - #if !defined(_HRESULT_DEFINED) && !defined(__midl) - #define _HRESULT_DEFINED --typedef __success(return >= 0) long HRESULT; -+typedef long HRESULT; - #endif + #include <specstrings.h> - #ifndef __midl ---- include/wingdi.h.orig 2008-03-22 06:10:42.897000000 +1000 -+++ include/wingdi.h 2009-02-16 21:34:39.065125000 +0900 ++#ifdef __cplusplus ++#define __inline inline ++#else ++#define __inline static __inline__ ++#endif + // + // Values are 32 bit values laid out as follows: + // +--- include/wingdi.h.orig 2008-01-18 22:17:42.000000000 +0900 ++++ include/wingdi.h 2009-08-21 09:21:56.000000000 +0900 @@ -9,6 +9,13 @@ #ifndef _WINGDI_ #define _WINGDI_ @@ -2752,20 +1950,7 @@ #pragma once -@@ -1169,11 +1176,10 @@ - typedef struct tagLOGPALETTE { - WORD palVersion; - WORD palNumEntries; -- __field_ecount_opt(palNumEntries) PALETTEENTRY palPalEntry[1]; -+ __field_ecount_opt(palNumEntries) PALETTEENTRY palPalEntry[1]; - } LOGPALETTE, *PLOGPALETTE, NEAR *NPLOGPALETTE, FAR *LPLOGPALETTE; - #endif // !_LOGPALETTE_DEFINED - -- - /* Logical Font */ - #define LF_FACESIZE 32 - -@@ -1901,7 +1907,7 @@ +@@ -1901,7 +1908,7 @@ /* size of a form name string */ #define CCHFORMNAME 32 @@ -2774,32 +1959,6 @@ typedef struct _devicemodeA { BYTE dmDeviceName[CCHDEVICENAME]; WORD dmSpecVersion; -@@ -2900,7 +2906,7 @@ - typedef FARPROC LINEDDAPROC; - #endif - -- -+WINGDIAPI int WINAPI FillRect(HDC,LPCRECT,HBRUSH); - - WINGDIAPI int WINAPI AddFontResourceA(__in LPCSTR); - WINGDIAPI int WINAPI AddFontResourceW(__in LPCWSTR); -@@ -3254,7 +3260,7 @@ - WINGDIAPI int WINAPI GetDeviceCaps( __in_opt HDC hdc, __in int index); - WINGDIAPI int WINAPI GetDIBits( __in HDC hdc, __in HBITMAP hbm, __in UINT start, __in UINT cLines, __out_opt LPVOID lpvBits, __inout_xcount(sizeof(BITMAPINFOHEADER)) LPBITMAPINFO lpbmi, __in UINT usage); // SAL actual size of lpbmi is computed from structure elements - --__success(return != GDI_ERROR) -+//__success(return != GDI_ERROR) - WINGDIAPI DWORD WINAPI GetFontData ( __in HDC hdc, - __in DWORD dwTable, - __in DWORD dwOffset, -@@ -4346,6 +4352,7 @@ - WINGDIAPI BOOL WINAPI ColorCorrectPalette( __in HDC hdc, __in HPALETTE hPal, __in DWORD deFirst, __in DWORD num); - #endif - -+ - #ifndef NOMETAFILE - - // Enhanced metafile constants. @@ -5424,6 +5431,10 @@ } #endif @@ -2811,70 +1970,26 @@ #endif /* _WINGDI_ */ ---- include/winsock2.h.orig 2008-03-22 06:10:42.912625000 +1000 -+++ include/winsock2.h 2009-02-16 21:34:39.065125000 +0900 -@@ -1,3 +1,6 @@ -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif - //$TAG BIZDEV - // $IPCategory: - // $DealPointID: 118736 -@@ -24,9 +27,9 @@ - * conditions for redistribution. - */ - --#ifndef _WINSOCK2API_ --#define _WINSOCK2API_ --#define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ -+#ifndef _WINSOCK2_H -+#define _WINSOCK2_H -+#define _WINSOCK_H /* to prevent later inclusion of winsock.h */ - - #pragma once +--- include/wintrust.h.orig 2008-01-18 22:17:42.000000000 +0900 ++++ include/wintrust.h 2009-08-21 09:21:56.000000000 +0900 +@@ -1252,6 +1252,7 @@ + // + #ifdef WT_DEFINE_ALL_APIS -@@ -66,6 +69,14 @@ - #include <windows.h> - #endif /* _INC_WINDOWS */ ++#if 0 + typedef struct _WIN_CERTIFICATE + { + DWORD dwLength; +@@ -1260,6 +1261,7 @@ + BYTE bCertificate[ANYSIZE_ARRAY]; -+#define __in -+#define __out -+#ifdef __cplusplus -+#define __inline inline -+#else -+#define __inline static __inline__ + } WIN_CERTIFICATE, *LPWIN_CERTIFICATE; +#endif -+ - /* - * Define the current Winsock version. To build an earlier Winsock version - * application redefine this value prior to including Winsock2.h. -@@ -1107,10 +1118,8 @@ - * registration (RNR) API - */ --#ifndef _tagBLOB_DEFINED --#define _tagBLOB_DEFINED --#define _BLOB_DEFINED --#define _LPBLOB_DEFINED -+#ifndef __BLOB_T_DEFINED -+#define __BLOB_T_DEFINED - typedef struct _BLOB { - ULONG cbSize ; - #ifdef MIDL_PASS -@@ -3920,5 +3929,9 @@ - #endif // IPV6STRICT - #endif //(_WIN32_WINNT >= 0x0501) - --#endif /* _WINSOCK2API_ */ -+#undef __in -+#undef __out -+#undef __inline -+ -+#endif /* _WINSOCK2_H */ - - ---- include/winuser.h.orig 2008-07-19 14:56:51.278750000 +0900 -+++ include/winuser.h 2009-02-16 21:34:39.065125000 +0900 + #define WIN_CERT_REVISION_1_0 (0x0100) + #define WIN_CERT_REVISION_2_0 (0x0200) +--- include/winuser.h.orig 2008-01-18 22:17:44.000000000 +0900 ++++ include/winuser.h 2009-08-21 09:21:56.000000000 +0900 @@ -11,6 +11,15 @@ #ifndef _WINUSER_ #define _WINUSER_ @@ -2900,16 +2015,7 @@ #ifndef NOUSER -@@ -215,6 +224,8 @@ - #pragma warning(disable:4995) - #endif - -+WINUSERAPI UINT WINAPI WinExec(LPCSTR,UINT); -+ - WINUSERAPI - int - WINAPI -@@ -10717,7 +10728,7 @@ +@@ -10717,7 +10726,7 @@ #define CDS_RESET 0x40000000 #define CDS_NORESET 0x10000000 @@ -2918,7 +2024,7 @@ /* Return values for ChangeDisplaySettings */ #define DISP_CHANGE_SUCCESSFUL 0 -@@ -12571,16 +12582,20 @@ +@@ -12571,16 +12580,20 @@ @@ -2944,107 +2050,8 @@ #endif /* !_WINUSER_ */ ---- include/ws2ipdef.h.orig 2008-01-18 22:17:44.000000000 +0900 -+++ include/ws2ipdef.h 2009-02-16 21:34:39.065125000 +0900 -@@ -1,3 +1,6 @@ -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif - /*++ - - Copyright (c) Microsoft Corporation. All rights reserved. -@@ -52,10 +55,10 @@ - #define WS2IPDEF_ASSERT(exp) ((VOID) 0) - #endif - --#ifdef _MSC_VER --#define WS2TCPIP_INLINE __inline -+#ifdef __cplusplus -+#define WS2TCPIP_INLINE inline - #else --#define WS2TCPIP_INLINE extern inline /* GNU style */ -+#define WS2TCPIP_INLINE static __inline__ - #endif - - #include <in6addr.h> -@@ -760,7 +763,7 @@ - ULONG ipv6mr_interface; // Interface index. - } IPV6_MREQ, *PIPV6_MREQ; - --#if (NTDDI_VERSION >= NTDDI_WINXP) -+#if 0 - // - // Structure for GROUP_REQ used by protocol independent source filters - // (MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP). -@@ -805,6 +808,8 @@ - ULONG ipi_ifindex; // Send/receive interface index. - } IN_PKTINFO, *PIN_PKTINFO; - -+#define C_ASSERT(x) -+ - C_ASSERT(sizeof(IN_PKTINFO) == 8); - - // ---- include/ws2tcpip.h.orig 2008-01-18 22:17:44.000000000 +0900 -+++ include/ws2tcpip.h 2009-02-16 21:34:39.065125000 +0900 -@@ -18,6 +18,9 @@ - - #ifndef _WS2TCPIP_H_ - #define _WS2TCPIP_H_ -+#if __GNUC__ >=3 -+#pragma GCC system_header -+#endif - - #if _MSC_VER > 1000 - #pragma once -@@ -27,15 +30,23 @@ - #include <ws2ipdef.h> - #include <limits.h> - -+#define __in -+#define __out -+#ifdef __cplusplus -+#define __inline inline -+#else -+#define __inline static __inline__ -+#endif -+ - /* Option to use with [gs]etsockopt at the IPPROTO_UDP level */ - - #define UDP_NOCHECKSUM 1 - #define UDP_CHECKSUM_COVERAGE 20 /* Set/get UDP-Lite checksum coverage */ - --#ifdef _MSC_VER --#define WS2TCPIP_INLINE __inline -+#ifdef __cplusplus -+#define WS2TCPIP_INLINE inline - #else --#define WS2TCPIP_INLINE extern inline /* GNU style */ -+#define WS2TCPIP_INLINE static __inline__ - #endif - - /* Error codes from getaddrinfo() */ -@@ -835,7 +846,7 @@ - return Error; - } - --#if (NTDDI_VERSION >= NTDDI_WINXP) -+#if 0 - WS2TCPIP_INLINE - int - setsourcefilter( -@@ -1056,5 +1067,9 @@ - #include <wspiapi.h> - #endif - -+#undef __in -+#undef __out -+#undef __inline -+ - #endif /* _WS2TCPIP_H_ */ - ---- include/wspiapi.h.orig 2005-04-14 17:55:04.000000000 +0900 -+++ include/wspiapi.h 2009-02-16 21:34:39.065125000 +0900 +--- include/wspiapi.h.orig 2008-01-18 22:17:44.000000000 +0900 ++++ include/wspiapi.h 2009-08-21 09:21:56.000000000 +0900 @@ -15,6 +15,9 @@ #ifndef _WSPIAPI_H_ @@ -3085,17 +2092,17 @@ /*==========================================================================; * * Copyright (C) Microsoft Corporation. All Rights Reserved. ---- include/d3dx9math.h.orig 2005-07-22 17:00:18.000000000 +0900 -+++ include/d3dx9math.h 2007-11-30 21:41:52.230625000 +0900 +--- include/d3dx9core.h.orig 2006-03-31 12:16:02.000000000 +0900 ++++ include/d3dx9core.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header +#endif - ////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////// // // Copyright (C) Microsoft Corporation. All Rights Reserved. ---- include/d3dx9math.inl.orig 2005-03-18 17:26:56.000000000 +0900 -+++ include/d3dx9math.inl 2007-11-30 21:41:38.496250000 +0900 +--- include/d3dx9math.h.orig 2005-07-22 17:00:18.000000000 +0900 ++++ include/d3dx9math.h 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header @@ -3103,110 +2110,16 @@ ////////////////////////////////////////////////////////////////////////////// // // Copyright (C) Microsoft Corporation. All Rights Reserved. ---- include/d3dx9core.h.orig 2006-03-31 12:16:02.000000000 +0900 -+++ include/d3dx9core.h 2007-11-30 21:41:13.199375000 +0900 +--- include/d3dx9math.inl.orig 2005-03-18 17:26:56.000000000 +0900 ++++ include/d3dx9math.inl 2009-08-21 09:21:56.000000000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 +#pragma GCC system_header +#endif - /////////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// // // Copyright (C) Microsoft Corporation. All Rights Reserved. ---- include/msi.h.orig 2008-01-18 22:17:28.000000000 +0900 -+++ include/msi.h 2009-02-16 21:34:39.065125000 +0900 -@@ -59,6 +59,14 @@ - #endif // _MSI_NO_CRYPTO - #endif //(_WIN32_MSI >= 150) - -+#define __in -+#define __out -+#ifdef __cplusplus -+#define __inline inline -+#else -+#define __inline static __inline__ -+#endif -+ - // -------------------------------------------------------------------------- - // Installer generic handle definitions - // -------------------------------------------------------------------------- -@@ -2248,5 +2256,9 @@ - // LOCALIZE END - - -+#undef __in -+#undef __out -+#undef __inline -+ - #endif // _MSI_H_ - ---- include/msiquery.h.orig 2008-01-18 22:17:28.000000000 +0900 -+++ include/msiquery.h 2009-02-16 21:34:39.065125000 +0900 -@@ -21,6 +21,14 @@ - #define _MSIQUERY_H_ - #include "msi.h" // INSTALLSTATE - -+#define __in -+#define __out -+#ifdef __cplusplus -+#define __inline inline -+#else -+#define __inline static __inline__ -+#endif -+ - #define MSI_NULL_INTEGER 0x80000000 // integer value reserved for null - - // MsiOpenDatabase persist predefine values, otherwise output database path is used -@@ -1026,5 +1034,9 @@ - } - #endif - -+#undef __in -+#undef __out -+#undef __inline -+ - #endif // _MSIQUERY_H_ - ---- include/olectl.h.orig 2008-03-22 06:10:42.000000000 +1000 -+++ include/olectl.h 2009-02-16 21:34:39.065125000 +0900 -@@ -28,6 +28,14 @@ - #include <ocidl.h> - #endif // _MAC - -+#define __in -+#define __out -+#ifdef __cplusplus -+#define __inline inline -+#else -+#define __inline static __inline__ -+#endif -+ - #ifdef _OLEAUT32_ - #define WINOLECTLAPI STDAPI - #define WINOLECTLAPI_(type) STDAPI_(type) -@@ -616,5 +624,9 @@ - - #endif // defined(__MKTYPLIB__) || defined(__midl) - -+#undef __in -+#undef __out -+#undef __inline -+ - #endif // _OLECTL_H_ - ---- include/propkeydef.h.orig 2008-01-18 22:17:32.000000000 +0900 -+++ include/propkeydef.h 2008-03-22 21:56:32.734375000 +1000 -@@ -2,6 +2,10 @@ - #define PID_FIRST_USABLE 2 - #endif - -+#ifndef __MIDL_CONST -+#define __MIDL_CONST const -+#endif -+ - #ifndef REFPROPERTYKEY - #ifdef __cplusplus - #define REFPROPERTYKEY const PROPERTYKEY & ---- icnlude/dxtrans.h.orig 2004-09-28 00:18:32.000000000 +0900 +--- include/dxtrans.h.orig 2004-09-28 00:18:32.000000000 +0900 +++ include/dxtrans.h 2007-01-02 22:08:41.640625000 +0900 @@ -1,3 +1,6 @@ +#if __GNUC__ >=3 diff --git a/external/prj/build.lst b/external/prj/build.lst index b187daf..8bcc6c1 100644 --- a/external/prj/build.lst +++ b/external/prj/build.lst @@ -1,6 +1,5 @@ -el external : SO:external_so soltools NULL +el external : soltools NULL el external usr1 - all el_mkout NULL el external\glibc nmake - all el_glibc NULL -el external\gpc nmake - all el_gpc NULL el external\gcc3_specific nmake - all el_gcc3 NULL el external\mingwheaders nmake - w el_mingwheaders NULL diff --git a/external/prj/d.lst b/external/prj/d.lst index bc7d7c1..9e0c681 100644 --- a/external/prj/d.lst +++ b/external/prj/d.lst @@ -1,6 +1,5 @@ mkdir: %_DEST%\inc%_EXT%\external mkdir: %_DEST%\inc%_EXT%\external\glibc -mkdir: %_DEST%\inc%_EXT%\external\gpc mkdir: %_DEST%\inc%_EXT%\external\mingw mkdir: %_DEST%\inc%_EXT%\external\mingw\include mkdir: %_DEST%\inc%_EXT%\external\mingw\include\atl @@ -8,24 +7,21 @@ mkdir: %_DEST%\inc%_EXT%\external\mingw\include\sys ..\glibc\rtufiles\config.h %_DEST%\inc%_EXT%\external\glibc\config.h ..\glibc\rtufiles\getopt.h %_DEST%\inc%_EXT%\external\glibc\getopt.h -..\gpc\gpc.h %_DEST%\inc%_EXT%\external\gpc\gpc.h ..\%__SRC%\slb\gnu_getopt.lib %_DEST%\lib%_EXT%\gnu_getopt.lib ..\%__SRC%\lib\libgnu_getopt.a %_DEST%\lib%_EXT%\libgnu_getopt.a ..\%__SRC%\lib\libgnu_getopt_static.a %_DEST%\lib%_EXT%\libgnu_getopt_static.a +..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\external\glibc\*.h + ..\%__SRC%\misc\mingw\include\*.h %_DEST%\inc%_EXT%\external\mingw\include\* ..\%__SRC%\misc\mingw\include\atl\*.h %_DEST%\inc%_EXT%\external\mingw\include\atl\* ..\%__SRC%\misc\mingw\include\sys\*.h %_DEST%\inc%_EXT%\external\mingw\include\sys\* -..\%__SRC%\slb\gpc.lib %_DEST%\lib%_EXT%\gpc.lib -..\%__SRC%\lib\libgpc.a %_DEST%\lib%_EXT%\libgpc.a -..\%__SRC%\lib\libgpc_static.a %_DEST%\lib%_EXT%\libgpc_static.a - ..\%__SRC%\lib\libautorec*.* %_DEST%\lib%_EXT%\lib*.* -..\%__SRC%\lib\libgcc_s.so.1 %_DEST%\lib%_EXT%\libgcc_s.so.1 -..\%__SRC%\lib\libstdc++.so.6 %_DEST%\lib%_EXT%\libstdc++.so.6 +..\%__SRC%\lib\libgcc_s.so.* %_DEST%\lib%_EXT%\libgcc_s.so.* +..\%__SRC%\lib\libstdc++.so.* %_DEST%\lib%_EXT%\libstdc++.so.* ..\dbghelp\dbghelp.dll %_DEST%\bin%_EXT%\dbghelp.dll @@ -58,6 +54,9 @@ mkdir: %_DEST%\inc%_EXT%\external\mingw\include\sys ..\msi\instmsiw.exe %_DEST%\bin%_EXT%\instmsiw.exe ..\%__SRC%\bin\mingwm10.dll %_DEST%\bin%_EXT%\mingwm10.dll +..\%__SRC%\bin\libgcc*.dll %_DEST%\bin%_EXT%\libgcc*.dll +..\%__SRC%\bin\libstdc++*.dll %_DEST%\bin%_EXT%\libstdc++*.dll + ..\%__SRC%\lib\libmsvcrt*.* %_DEST%\lib%_EXT%\lib*.* ..\%__SRC%\lib\lib*static*.dylib %_DEST%\lib%_EXT%\lib*static*.dylib diff --git a/fondu/download/fondu_src-051010.tar.gz b/fondu/download/fondu_src-051010.tar.gz Binary files differdeleted file mode 100644 index 9f5d663..0000000 --- a/fondu/download/fondu_src-051010.tar.gz +++ /dev/null diff --git a/fondu/prj/build.lst b/fondu/prj/build.lst deleted file mode 100644 index d99a2c2..0000000 --- a/fondu/prj/build.lst +++ /dev/null @@ -1,2 +0,0 @@ -fd fondu : solenv NULL -fd fondu nmake - u fd_fondu NULL diff --git a/fondu/prj/d.lst b/fondu/prj/d.lst deleted file mode 100644 index d68d83e..0000000 --- a/fondu/prj/d.lst +++ /dev/null @@ -1,2 +0,0 @@ -mkdir: %_DEST%\inc%_EXT%\fondu -..\%__SRC%\bin\fondu %_DEST%\bin%_EXT%\fondu diff --git a/hsqldb/download/hsqldb_1_8_0.zip b/hsqldb/download/hsqldb_1_8_0.zip Binary files differdeleted file mode 100644 index 8f932dc..0000000 --- a/hsqldb/download/hsqldb_1_8_0.zip +++ /dev/null diff --git a/hsqldb/makefile.mk b/hsqldb/makefile.mk index fb5bf8a..6b3166a 100755 --- a/hsqldb/makefile.mk +++ b/hsqldb/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.22 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -49,19 +45,18 @@ ANT_BUILDFILE=build$/build.xml # --- Files -------------------------------------------------------- TARFILE_NAME=hsqldb_$(HSQLDB_VERSION) +TARFILE_MD5=17410483b5b5f267aa18b7e00b65e6e0 TARFILE_ROOTDIR=hsqldb CONVERTFILES=build$/build.xml \ - src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java - -PATCH_FILES=patches$/accumulated_patches.patch + src$/org$/hsqldb$/persist$/HsqlDatabaseProperties.java \ + src$/org$/hsqldb$/Library.java -# ADDITIONAL_FILES= src$/org$/hsqldb$/Collation.java \ -# src$/org$/hsqldb$/TxManager.java \ -# src$/org$/hsqldb$/lib$/LongKeyIntValueHashMap.java \ -# src$/org$/hsqldb$/persist$/ScaledRAFileInJar.java \ -# src$/org$/hsqldb$/test$/TestCollation.java +PATCH_FILES=patches$/i96823.patch \ + patches$/i97032.patch \ + patches$/i103528.patch \ + patches$/i104901.patch .IF "$(JAVACISGCJ)"=="yes" JAVA_HOME= diff --git a/hsqldb/patches/i103528.patch b/hsqldb/patches/i103528.patch new file mode 100644 index 0000000..3cc7d2f --- /dev/null +++ b/hsqldb/patches/i103528.patch @@ -0,0 +1,11 @@ +--- misc/hsqldb/src/org/hsqldb/Library.java ++++ misc/build/hsqldb/src/org/hsqldb/Library.java +@@ -1957,7 +1957,7 @@ + functionMap.put("bitand", bitand); + functionMap.put("bitlength", bitLength); + functionMap.put("bitor", bitor); +- functionMap.put("bitxor", bitor); ++ functionMap.put("bitxor", bitxor); + functionMap.put("character", character); + functionMap.put("concat", concat); + functionMap.put("cot", cot); diff --git a/hsqldb/patches/i104901.patch b/hsqldb/patches/i104901.patch new file mode 100644 index 0000000..a38773f --- /dev/null +++ b/hsqldb/patches/i104901.patch @@ -0,0 +1,27 @@ +--- misc/hsqldb/src/org/hsqldb/Table.java 2007-10-19 23:59:07.000000000 +0200 ++++ misc/build/hsqldb/src/org/hsqldb/Table.java 2009-09-11 13:45:42.939231519 +0200 +@@ -149,10 +149,10 @@ + Constraint[] constraintList; // constrainst for the table + HsqlArrayList[] triggerLists; // array of trigger lists + private int[] colTypes; // fredt - types of columns +- private int[] colSizes; // fredt - copy of SIZE values for columns ++ int[] colSizes; // fredt - copy of SIZE values for columns + private int[] colScales; // fredt - copy of SCALE values for columns + private boolean[] colNullable; // fredt - modified copy of isNullable() values +- private Expression[] colDefaults; // fredt - expressions of DEFAULT values ++ Expression[] colDefaults; // fredt - expressions of DEFAULT values + private int[] defaultColumnMap; // fred - holding 0,1,2,3,... + private boolean hasDefaultValues; //fredt - shortcut for above + boolean sqlEnforceSize; // inherited from the database - +--- misc/hsqldb/src/org/hsqldb/TableWorks.java 2007-01-14 06:48:16.000000000 +0100 ++++ misc/build/hsqldb/src/org/hsqldb/TableWorks.java 2009-09-11 13:47:50.328667463 +0200 +@@ -670,7 +670,8 @@ + // default expressions can change + oldCol.setType(newCol); + oldCol.setDefaultExpression(newCol.getDefaultExpression()); +- table.setColumnTypeVars(colIndex); ++ table.colSizes[colIndex] = oldCol.getSize(); ++ table.colDefaults[colIndex] = oldCol.getDefaultExpression(); + table.resetDefaultsFlag(); + + return; diff --git a/hsqldb/patches/accumulated_patches.patch b/hsqldb/patches/i96823.patch index 42f1ef0..bea4a2b 100644 --- a/hsqldb/patches/accumulated_patches.patch +++ b/hsqldb/patches/i96823.patch @@ -11,7 +11,7 @@ case COUNT : buf.append(' ').append(Token.T_COUNT).append('('); - break; -+ return buf.toString(); ++ if ( "(*)".equals(left))buf.append('*');else buf.append(left); buf.append(')'); return buf.toString(); case SUM : buf.append(' ').append(Token.T_SUM).append('('); @@ -92,13 +92,3 @@ return ""; } ---- misc/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2008-03-17 17:05:41.000000000 +0100 -+++ misc/build/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2009-01-21 13:09:24.493470142 +0100 -@@ -429,6 +429,7 @@ - setProperty(hsqldb_log_size, 10); - setProperty(sql_enforce_strict_size, true); - setProperty(hsqldb_nio_data_file, false); -+ setProperty(hsqldb_lock_file, true); - } - - // OOo end diff --git a/hsqldb/patches/i97032.patch b/hsqldb/patches/i97032.patch new file mode 100644 index 0000000..9703b89 --- /dev/null +++ b/hsqldb/patches/i97032.patch @@ -0,0 +1,10 @@ +--- misc/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2008-03-17 17:05:41.000000000 +0100 ++++ misc/build/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2009-01-21 13:09:24.493470142 +0100 +@@ -429,6 +429,7 @@ + setProperty(hsqldb_log_size, 10); + setProperty(sql_enforce_strict_size, true); + setProperty(hsqldb_nio_data_file, false); ++ setProperty(hsqldb_lock_file, true); + } + + // OOo end diff --git a/hsqldb/patches/index.txt b/hsqldb/patches/index.txt deleted file mode 100644 index a7a06fc..0000000 --- a/hsqldb/patches/index.txt +++ /dev/null @@ -1,17 +0,0 @@ -==================================================================================== -File name ---------- - patch_file.patch - -Description ------------ - patches HSQL so that .... - -Issue ------ - http://www.openoffice.org/issues/show_bug.cgi?id=????? - http://www.openoffice.org/issues/show_bug.cgi?id=85087 - http://www.openoffice.org/issues/show_bug.cgi?id=97032 - <summary> - - diff --git a/hyphen/download/hyphen-2.4.tar.gz b/hyphen/download/hyphen-2.4.tar.gz Binary files differdeleted file mode 100644 index 7685ac9..0000000 --- a/hyphen/download/hyphen-2.4.tar.gz +++ /dev/null diff --git a/hyphen/hyphen-2.4.patch b/hyphen/hyphen-2.4.patch index 27f7085..33947f5 100644 --- a/hyphen/hyphen-2.4.patch +++ b/hyphen/hyphen-2.4.patch @@ -110,20 +110,16 @@ diff -u misc/hyphen-2.4/Makefile.in misc/build/hyphen-2.4/Makefile.in diff -u misc/hyphen-2.4/makefile.mk misc/build/hyphen-2.4/makefile.mk --- misc/hyphen-2.4/makefile.mk 2008-06-04 10:43:21.000000000 +0200 +++ misc/build/hyphen-2.4/makefile.mk 2008-06-04 12:40:46.000000000 +0200 -@@ -1 +1,57 @@ +@@ -1 +1,54 @@ -dummy +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# -+# Copyright 2008 by Sun Microsystems, Inc. ++# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# -+# $RCSfile: hyphen-2.4.patch,v $ -+# -+# $Revision: 1.1.4.2 $ -+# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify @@ -151,6 +147,7 @@ diff -u misc/hyphen-2.4/makefile.mk misc/build/hyphen-2.4/makefile.mk + +USE_DEFFILE=TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE ++UWINAPILIB=
+ +.INCLUDE : settings.mk + diff --git a/hyphen/makefile.mk b/hyphen/makefile.mk index 6ba6f10..f1aa380 100644 --- a/hyphen/makefile.mk +++ b/hyphen/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8.2.3 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,6 +37,7 @@ TARGET=hyphen # --- Files -------------------------------------------------------- TARFILE_NAME=hyphen-2.4 +TARFILE_MD5=d0b5af6e408b8d2958f3d83b5244f5e8 ADDITIONAL_FILES += makefile.mk @@ -63,7 +60,9 @@ LCL_CONFIGURE_CFLAGS+=-m64 LCL_CONFIGURE_CFLAGS+=$(EXTRA_CFLAGS) CONFIGURE_FLAGS+=CXXFLAGS="$(EXTRA_CFLAGS)" .ENDIF # "$(EXTRA_CFLAGS)"!="" -.ENDIF # "$(SYSBASE)"!="" +.ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!="" +CONFIGURE_FLAGS+=CPPFLAGS="$(EXTRA_CDEFS)" +.ENDIF .IF "$(LCL_CONFIGURE_CFLAGS)"!="" CONFIGURE_FLAGS+=CFLAGS='$(LCL_CONFIGURE_CFLAGS)' @@ -75,7 +74,7 @@ BUILD_ACTION=make hyph_en_US.dic @all: echo "Nothing to do here." .ELSE -BUILD_ACTION=make +BUILD_ACTION=make && make check OUT2INC += hyphen.h .ENDIF diff --git a/hyphen/prj/build.lst b/hyphen/prj/build.lst index dbb21f3..c953a57 100644 --- a/hyphen/prj/build.lst +++ b/hyphen/prj/build.lst @@ -1,3 +1,3 @@ -hyp hyphen : solenv sal NULL +hyp hyphen : soltools solenv NULL hyp hyphen usr1 - all hyp_mkout NULL hyp hyphen nmake - all hyp_hyphen NULL @@ -31,11 +31,9 @@ are in: <build>/misc/build/SampleICC-1.3.2/IccProfLib/IccProfLibConf.h -The patches: -SampleICC-1.3.2.patch is the file to be used for Linux and Windows -SampleICC-1.3.2-bendian.patch is the file to be used for -big endian platform, formed from the above patch plus the big endian -forcing. +The patchs: +SampleICC-1.3.2.patch tweaks the build to use the endianness +detected in sal. beppec56@openoffice.org diff --git a/icc/SampleICC-1.3.2-bendian.patch b/icc/SampleICC-1.3.2-bendian.patch deleted file mode 100644 index a4988a2..0000000 --- a/icc/SampleICC-1.3.2-bendian.patch +++ /dev/null @@ -1,5133 +0,0 @@ -*** misc/SampleICC-1.3.2/configure Mon Aug 20 22:10:59 2007 ---- misc/build/SampleICC-1.3.2/configure Fri Jan 25 14:23:09 2008 -*************** -*** 19991,19997 **** - - - -! ac_config_files="$ac_config_files Makefile IccProfLib/Makefile Tools/Makefile Tools/CmdLine/Makefile Tools/CmdLine/IccApplyNamedCmm/Makefile Tools/CmdLine/IccApplyProfiles/Makefile Tools/CmdLine/IccDumpProfile/Makefile Tools/CmdLine/IccProfLibTest/Makefile Tools/CmdLine/IccStripUnknownTags/Makefile Tools/CmdLine/IccV4ToMPE/Makefile Contrib/Makefile Contrib/CmdLine/Makefile Contrib/CmdLine/create_CLUT_profile/Makefile Contrib/CmdLine/create_CLUT_profile_from_probe/Makefile Contrib/CmdLine/create_display_profile/Makefile Contrib/ICC_utils/Makefile Contrib/Mac_OS_X/Makefile Contrib/Mac_OS_X/create_probe/Makefile Contrib/Mac_OS_X/extract_probe_data/Makefile Contrib/examples/Makefile Contrib/examples/RSR/Makefile Contrib/tests/Makefile Contrib/tests/flatten_AToB_tag/Makefile Contrib/tests/generate_device_codes/Makefile Contrib/tests/reconstruct_measurements/Makefile Contrib/tests/round_trip_PCS_LAB/Makefile" - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure - # tests run on this system so they can be shared between configure ---- 19991,19997 ---- - - - -! ac_config_files="$ac_config_files Makefile IccProfLib/Makefile Tools/Makefile Tools/CmdLine/Makefile Tools/CmdLine/IccDumpProfile/Makefile Tools/CmdLine/IccProfLibTest/Makefile Tools/CmdLine/IccStripUnknownTags/Makefile Tools/CmdLine/IccV4ToMPE/Makefile Contrib/Makefile Contrib/CmdLine/Makefile Contrib/ICC_utils/Makefile Contrib/CmdLine/create_sRGB_profile/Makefile" - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure - # tests run on this system so they can be shared between configure -*************** -*** 20571,20578 **** - "IccProfLib/Makefile" ) CONFIG_FILES="$CONFIG_FILES IccProfLib/Makefile" ;; - "Tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/Makefile" ;; - "Tools/CmdLine/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/Makefile" ;; -- "Tools/CmdLine/IccApplyNamedCmm/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccApplyNamedCmm/Makefile" ;; -- "Tools/CmdLine/IccApplyProfiles/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccApplyProfiles/Makefile" ;; - "Tools/CmdLine/IccDumpProfile/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccDumpProfile/Makefile" ;; - "Tools/CmdLine/IccProfLibTest/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccProfLibTest/Makefile" ;; - "Tools/CmdLine/IccStripUnknownTags/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccStripUnknownTags/Makefile" ;; ---- 20571,20576 ---- -*************** -*** 20579,20598 **** - "Tools/CmdLine/IccV4ToMPE/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccV4ToMPE/Makefile" ;; - "Contrib/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/Makefile" ;; - "Contrib/CmdLine/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/CmdLine/Makefile" ;; -! "Contrib/CmdLine/create_CLUT_profile/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/CmdLine/create_CLUT_profile/Makefile" ;; -! "Contrib/CmdLine/create_CLUT_profile_from_probe/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/CmdLine/create_CLUT_profile_from_probe/Makefile" ;; -! "Contrib/CmdLine/create_display_profile/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/CmdLine/create_display_profile/Makefile" ;; - "Contrib/ICC_utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/ICC_utils/Makefile" ;; -- "Contrib/Mac_OS_X/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/Mac_OS_X/Makefile" ;; -- "Contrib/Mac_OS_X/create_probe/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/Mac_OS_X/create_probe/Makefile" ;; -- "Contrib/Mac_OS_X/extract_probe_data/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/Mac_OS_X/extract_probe_data/Makefile" ;; -- "Contrib/examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/examples/Makefile" ;; -- "Contrib/examples/RSR/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/examples/RSR/Makefile" ;; -- "Contrib/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/tests/Makefile" ;; -- "Contrib/tests/flatten_AToB_tag/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/tests/flatten_AToB_tag/Makefile" ;; -- "Contrib/tests/generate_device_codes/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/tests/generate_device_codes/Makefile" ;; -- "Contrib/tests/reconstruct_measurements/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/tests/reconstruct_measurements/Makefile" ;; -- "Contrib/tests/round_trip_PCS_LAB/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/tests/round_trip_PCS_LAB/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 - echo "$as_me: error: invalid argument: $ac_config_target" >&2;} ---- 20577,20584 ---- - "Tools/CmdLine/IccV4ToMPE/Makefile" ) CONFIG_FILES="$CONFIG_FILES Tools/CmdLine/IccV4ToMPE/Makefile" ;; - "Contrib/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/Makefile" ;; - "Contrib/CmdLine/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/CmdLine/Makefile" ;; -! "Contrib/CmdLine/create_sRGB_profile/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/CmdLine/create_sRGB_profile/Makefile" ;; - "Contrib/ICC_utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES Contrib/ICC_utils/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 - echo "$as_me: error: invalid argument: $ac_config_target" >&2;} -*** misc/SampleICC-1.3.2/Contrib/Makefile.in Mon Aug 20 22:10:37 2007 ---- misc/build/SampleICC-1.3.2/Contrib/Makefile.in Fri Jan 25 14:23:09 2008 -*************** -*** 103,120 **** - - SUBDIRS = \ - ICC_utils \ -! CmdLine \ -! examples \ -! Mac_OS_X \ -! tests - - - DIST_SUBDIRS = \ - ICC_utils \ -! CmdLine \ -! examples \ -! Mac_OS_X \ -! tests - - subdir = Contrib - mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs ---- 103,114 ---- - - SUBDIRS = \ - ICC_utils \ -! CmdLine - - - DIST_SUBDIRS = \ - ICC_utils \ -! CmdLine - - subdir = Contrib - mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -*** misc/SampleICC-1.3.2/Contrib/CmdLine/Makefile.in Mon Aug 20 22:10:34 2007 ---- misc/build/SampleICC-1.3.2/Contrib/CmdLine/Makefile.in Fri Jan 25 14:23:09 2008 -*************** -*** 102,116 **** - install_sh = @install_sh@ - - SUBDIRS = \ -! create_CLUT_profile \ -! create_CLUT_profile_from_probe \ -! create_display_profile - - - DIST_SUBDIRS = \ -! create_CLUT_profile \ -! create_CLUT_profile_from_probe \ -! create_display_profile - - subdir = Contrib/CmdLine - mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs ---- 102,112 ---- - install_sh = @install_sh@ - - SUBDIRS = \ -! create_sRGB_profile - - - DIST_SUBDIRS = \ -! create_sRGB_profile - - subdir = Contrib/CmdLine - mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -*** misc/SampleICC-1.3.2/Contrib/ICC_utils/Makefile.in Mon Aug 20 22:10:35 2007 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Makefile.in Fri Jan 25 14:23:09 2008 -*************** -*** 133,139 **** - CONFIG_CLEAN_FILES = - LTLIBRARIES = $(lib_LTLIBRARIES) - -! libICC_utils_la_LIBADD = - am_libICC_utils_la_OBJECTS = Stubs.lo CAT.lo CLUT.lo CLUT_stuffer.lo \ - ICC_tool_exception.lo Vetters.lo - libICC_utils_la_OBJECTS = $(am_libICC_utils_la_OBJECTS) ---- 133,139 ---- - CONFIG_CLEAN_FILES = - LTLIBRARIES = $(lib_LTLIBRARIES) - -! libICC_utils_la_LIBADD = $(LDADD) - am_libICC_utils_la_OBJECTS = Stubs.lo CAT.lo CLUT.lo CLUT_stuffer.lo \ - ICC_tool_exception.lo Vetters.lo - libICC_utils_la_OBJECTS = $(am_libICC_utils_la_OBJECTS) -*** misc/SampleICC-1.3.2/Contrib/ICC_utils/Stubs.h Mon Aug 20 22:04:53 2007 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Stubs.h Fri Jan 25 14:23:09 2008 -*************** -*** 130,136 **** - - // use one of these to force desired sort order in assoc. containers of DPX - bool -! DPX::operator<(const DPX& p) const - { - return (r_ != p.r_) ? (r_ < p.r_) : ((g_ != p.g_) ? (g_ < p.g_) : (b_ < p.b_)); - } ---- 130,136 ---- - - // use one of these to force desired sort order in assoc. containers of DPX - bool -! operator<(const DPX& p) const - { - return (r_ != p.r_) ? (r_ < p.r_) : ((g_ != p.g_) ? (g_ < p.g_) : (b_ < p.b_)); - } -*** misc/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.cpp Mon Aug 20 22:04:54 2007 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.cpp Fri Jan 25 14:57:06 2008 -*************** -*** 1,322 **** -! /* -! File: Vetters.cpp -! -! Contains: Utility functions to handle common argument-checking tasks, in a -! way that hides platform-specific details from higher-level code. -! -! Version: V1 -! -! Copyright: © see below -! */ -! -! /* -! * The ICC Software License, Version 0.1 -! * -! * -! * Copyright (c) 2003-2006 The International Color Consortium. All rights -! * reserved. -! * -! * Redistribution and use in source and binary forms, with or without -! * modification, are permitted provided that the following conditions -! * are met: -! * -! * 1. Redistributions of source code must retain the above copyright -! * notice, this list of conditions and the following disclaimer. -! * -! * 2. Redistributions in binary form must reproduce the above copyright -! * notice, this list of conditions and the following disclaimer in -! * the documentation and/or other materials provided with the -! * distribution. -! * -! * 3. The end-user documentation included with the redistribution, -! * if any, must include the following acknowledgment: -! * "This product includes software developed by the -! * The International Color Consortium (www.color.org)" -! * Alternately, this acknowledgment may appear in the software itself, -! * if and wherever such third-party acknowledgments normally appear. -! * -! * 4. The names "ICC" and "The International Color Consortium" must -! * not be used to imply that the ICC organization endorses or -! * promotes products derived from this software without prior -! * written permission. For written permission, please see -! * <http://www.color.org/>. -! * -! * -! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -! * DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COLOR CONSORTIUM OR -! * ITS CONTRIBUTING MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -! * SUCH DAMAGE. -! * ==================================================================== -! * -! * This software consists of voluntary contributions made by many -! * individuals on behalf of the The International Color Consortium. -! * -! * -! * Membership in the ICC is encouraged when this software is used for -! * commercial purposes. -! * -! * -! * For more information on The International Color Consortium, please -! * see <http://www.color.org/>. -! * -! * -! */ -! -! ////////////////////////////////////////////////////////////////////// -! // HISTORY: -! // -! // -Initial implementation by Joseph Goldstone sumer 2007 -! // -! ////////////////////////////////////////////////////////////////////// -! -! #include "Vetters.h" -! -! #include <sstream> -! using namespace std; -! -! #ifndef WIN32 -! #include <sys/errno.h> -! #else -! #include <string.h> -! int strerror_r(int errnum, char *str, int strsize) -! { -! const char *errstr = strerror(errnum); -! -! if (errstr) { -! strncpy(str, errstr, strsize); -! return 0; -! } -! -! return -1; -! } -! #define stat _stat -! #endif -! -! #include "ICC_tool_exception.h" -! -! const char* -! path_tail(const char* const s) -! { -! const char* tail = strdup(s); -! const char* last_slash = strrchr(tail, '/'); -! if (last_slash != NULL) -! tail = last_slash + 1; -! return tail; -! } -! -! void -! vet_as_int(const char* const s, const string& name, -! const string& description) -! { -! istringstream ss(s); -! int i; -! ss >> i; -! if (ss.fail()) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', cannot be parsed as" -! << " an integer. It should be an integer representing " -! << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! -! void -! vet_as_float(const char* const s, const string& name, -! const string& description) -! { -! istringstream ss(s); -! float i; -! ss >> i; -! if (ss.fail()) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', cannot be parsed as" -! << " a floating-point number. It should be a floating-point number" -! << " representing " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! -! #define STRERROR_BUF_SIZE 256 -! off_t -! get_size(const char* const s) -! { -! struct stat sb; -! int stat_returned = stat(s, &sb); -! if (stat_returned < 0) -! { -! int stat_errno = errno; -! char strerror_buf[STRERROR_BUF_SIZE]; -! strerror_r(stat_errno, strerror_buf, STRERROR_BUF_SIZE); -! ostringstream oss; -! oss << "Could not access information for file `" << s << "': " -! << strerror_buf; -! throw ICC_tool_exception(oss.str()); -! } -! return sb.st_size; -! } -! -! bool -! check_mode(const char* const s, mode_t mode) -! { -! struct stat sb; -! int stat_returned = stat(s, &sb); -! if (stat_returned < 0) -! { -! int stat_errno = errno; -! char strerror_buf[STRERROR_BUF_SIZE]; -! strerror_r(stat_errno, strerror_buf, STRERROR_BUF_SIZE); -! ostringstream oss; -! oss << "Could not access information for file `" << s << "': " -! << strerror_buf; -! throw ICC_tool_exception(oss.str()); -! } -! return (sb.st_mode & mode) != 0; -! } -! -! bool -! is_existent_file_pathname(const char* const s) -! { -! struct stat sb; -! return stat(s, &sb) == 0; -! } -! -! bool -! is_plain_file_pathname(const char* const s) -! { -! return check_mode(s, S_IFREG); -! } -! -! bool -! is_directory(const char* const s) -! { -! return check_mode(s, S_IFDIR); -! } -! -! const char* const -! containing_directory(const char* const s) -! { -! if (strlen(s) == 0) -! throw ICC_tool_exception("name of directory passed to containing_directory" -! " function was zero-length."); -! char* tmp = strdup(s); -! // lop off any trailing seperator -! if (tmp[strlen(tmp) - 1] == '/') -! tmp[strlen(tmp) - 1] = 0; -! if (strlen(tmp) == 0) -! throw ICC_tool_exception("root directory (which has no containing" -! " directory) passed to containing_directory" -! " function"); -! char* idx = strrchr(tmp, '/'); -! if (idx != NULL) -! { -! *idx = 0; -! return tmp; -! } -! char* current_directory = getenv("PWD"); -! if (current_directory == NULL) -! throw ICC_tool_exception("pathname passed to containing_directory has no" -! " embedded seperator, and there is no value for" -! " PWD defined in the environment"); -! return strdup(current_directory); -! } -! -! bool -! is_readable_pathname(const char* const s) -! { -! return check_mode(s, S_IRUSR) -! || check_mode(s, S_IRGRP) -! || check_mode(s, S_IROTH); -! } -! -! bool -! is_writable_pathname(const char* const s) -! { -! return check_mode(s, S_IWUSR) -! || check_mode(s, S_IWGRP) -! || check_mode(s, S_IWOTH); -! } -! -! bool -! is_pathname_of_empty_file(const char* const s) -! { -! return get_size(s) > 0; -! } -! -! void -! vet_input_file_pathname(const char* const s, const string& name, -! const string& description) -! { -! if (! is_plain_file_pathname(s)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', is not the pathname" -! << " of a plain file (i.e. it is the pathname of a directory, or of a" -! << " symbolic link, or of some other sort of special file.) It should be" -! << " " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! if (! is_readable_pathname(s)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', is not the pathname" -! << " of a readable file (i.e. you do not have permission to read that" -! << " file, or you do not have permission to read some directory" -! << " containing that file."; -! throw ICC_tool_exception(oss.str()); -! } -! if (! is_pathname_of_empty_file(s)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', is not the pathname" -! << " of an existing readable file, but that file is of zero length." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! -! void -! vet_output_file_pathname(const char* const s, const string& name, -! const string& description, -! bool silent_overwrite_OK) -! { -! const char* const container = containing_directory(s); -! if (! is_writable_pathname(container)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', has a directory" -! << " component which is not writable." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! if (is_existent_file_pathname(s)) -! { -! if (is_plain_file_pathname(s)) -! if (is_writable_pathname(s)) -! { -! if (! silent_overwrite_OK) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "' is of an existing" -! << " file." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } else { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "' is of an existing" -! << " file which is not writable." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! } ---- 1,329 ---- -! /* -! File: Vetters.cpp -! -! Contains: Utility functions to handle common argument-checking tasks, in a -! way that hides platform-specific details from higher-level code. -! -! Version: V1 -! -! Copyright: © see below -! */ -! -! /* -! * The ICC Software License, Version 0.1 -! * -! * -! * Copyright (c) 2003-2006 The International Color Consortium. All rights -! * reserved. -! * -! * Redistribution and use in source and binary forms, with or without -! * modification, are permitted provided that the following conditions -! * are met: -! * -! * 1. Redistributions of source code must retain the above copyright -! * notice, this list of conditions and the following disclaimer. -! * -! * 2. Redistributions in binary form must reproduce the above copyright -! * notice, this list of conditions and the following disclaimer in -! * the documentation and/or other materials provided with the -! * distribution. -! * -! * 3. The end-user documentation included with the redistribution, -! * if any, must include the following acknowledgment: -! * "This product includes software developed by the -! * The International Color Consortium (www.color.org)" -! * Alternately, this acknowledgment may appear in the software itself, -! * if and wherever such third-party acknowledgments normally appear. -! * -! * 4. The names "ICC" and "The International Color Consortium" must -! * not be used to imply that the ICC organization endorses or -! * promotes products derived from this software without prior -! * written permission. For written permission, please see -! * <http://www.color.org/>. -! * -! * -! * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -! * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -! * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -! * DISCLAIMED. IN NO EVENT SHALL THE INTERNATIONAL COLOR CONSORTIUM OR -! * ITS CONTRIBUTING MEMBERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -! * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -! * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -! * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -! * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -! * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT -! * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -! * SUCH DAMAGE. -! * ==================================================================== -! * -! * This software consists of voluntary contributions made by many -! * individuals on behalf of the The International Color Consortium. -! * -! * -! * Membership in the ICC is encouraged when this software is used for -! * commercial purposes. -! * -! * -! * For more information on The International Color Consortium, please -! * see <http://www.color.org/>. -! * -! * -! */ -! -! ////////////////////////////////////////////////////////////////////// -! // HISTORY: -! // -! // -Initial implementation by Joseph Goldstone sumer 2007 -! // -! ////////////////////////////////////////////////////////////////////// -! -! #include "Vetters.h" -! -! #include <sstream> -! using namespace std; -! -! #ifndef WIN32 -! #ifdef sun -! #include <errno.h> -! #else -! #include <sys/errno.h> -! #endif -! #else -! #include <string.h> -! #define stat _stat -! #endif -! -! #if defined WIN32 || defined sun -! int strerror_r(int errnum, char *str, int strsize) -! { -! const char *errstr = strerror(errnum); -! -! if (errstr) { -! strncpy(str, errstr, strsize); -! return 0; -! } -! -! return -1; -! } -! #endif -! -! #include "ICC_tool_exception.h" -! -! const char* -! path_tail(const char* const s) -! { -! const char* tail = strdup(s); -! const char* last_slash = strrchr(tail, '/'); -! if (last_slash != NULL) -! tail = last_slash + 1; -! return tail; -! } -! -! void -! vet_as_int(const char* const s, const string& name, -! const string& description) -! { -! istringstream ss(s); -! int i; -! ss >> i; -! if (ss.fail()) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', cannot be parsed as" -! << " an integer. It should be an integer representing " -! << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! -! void -! vet_as_float(const char* const s, const string& name, -! const string& description) -! { -! istringstream ss(s); -! float i; -! ss >> i; -! if (ss.fail()) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', cannot be parsed as" -! << " a floating-point number. It should be a floating-point number" -! << " representing " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! -! #define STRERROR_BUF_SIZE 256 -! off_t -! get_size(const char* const s) -! { -! struct stat sb; -! int stat_returned = stat(s, &sb); -! if (stat_returned < 0) -! { -! int stat_errno = errno; -! char strerror_buf[STRERROR_BUF_SIZE]; -! strerror_r(stat_errno, strerror_buf, STRERROR_BUF_SIZE); -! ostringstream oss; -! oss << "Could not access information for file `" << s << "': " -! << strerror_buf; -! throw ICC_tool_exception(oss.str()); -! } -! return sb.st_size; -! } -! -! bool -! check_mode(const char* const s, mode_t mode) -! { -! struct stat sb; -! int stat_returned = stat(s, &sb); -! if (stat_returned < 0) -! { -! int stat_errno = errno; -! char strerror_buf[STRERROR_BUF_SIZE]; -! strerror_r(stat_errno, strerror_buf, STRERROR_BUF_SIZE); -! ostringstream oss; -! oss << "Could not access information for file `" << s << "': " -! << strerror_buf; -! throw ICC_tool_exception(oss.str()); -! } -! return (sb.st_mode & mode) != 0; -! } -! -! bool -! is_existent_file_pathname(const char* const s) -! { -! struct stat sb; -! return stat(s, &sb) == 0; -! } -! -! bool -! is_plain_file_pathname(const char* const s) -! { -! return check_mode(s, S_IFREG); -! } -! -! bool -! is_directory(const char* const s) -! { -! return check_mode(s, S_IFDIR); -! } -! -! const char* const -! containing_directory(const char* const s) -! { -! if (strlen(s) == 0) -! throw ICC_tool_exception("name of directory passed to containing_directory" -! " function was zero-length."); -! char* tmp = strdup(s); -! // lop off any trailing seperator -! if (tmp[strlen(tmp) - 1] == '/') -! tmp[strlen(tmp) - 1] = 0; -! if (strlen(tmp) == 0) -! throw ICC_tool_exception("root directory (which has no containing" -! " directory) passed to containing_directory" -! " function"); -! char* idx = strrchr(tmp, '/'); -! if (idx != NULL) -! { -! *idx = 0; -! return tmp; -! } -! char* current_directory = getenv("PWD"); -! if (current_directory == NULL) -! throw ICC_tool_exception("pathname passed to containing_directory has no" -! " embedded seperator, and there is no value for" -! " PWD defined in the environment"); -! return strdup(current_directory); -! } -! -! bool -! is_readable_pathname(const char* const s) -! { -! return check_mode(s, S_IRUSR) -! || check_mode(s, S_IRGRP) -! || check_mode(s, S_IROTH); -! } -! -! bool -! is_writable_pathname(const char* const s) -! { -! return check_mode(s, S_IWUSR) -! || check_mode(s, S_IWGRP) -! || check_mode(s, S_IWOTH); -! } -! -! bool -! is_pathname_of_empty_file(const char* const s) -! { -! return get_size(s) > 0; -! } -! -! void -! vet_input_file_pathname(const char* const s, const string& name, -! const string& description) -! { -! if (! is_plain_file_pathname(s)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', is not the pathname" -! << " of a plain file (i.e. it is the pathname of a directory, or of a" -! << " symbolic link, or of some other sort of special file.) It should be" -! << " " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! if (! is_readable_pathname(s)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', is not the pathname" -! << " of a readable file (i.e. you do not have permission to read that" -! << " file, or you do not have permission to read some directory" -! << " containing that file."; -! throw ICC_tool_exception(oss.str()); -! } -! if (! is_pathname_of_empty_file(s)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', is not the pathname" -! << " of an existing readable file, but that file is of zero length." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! -! void -! vet_output_file_pathname(const char* const s, const string& name, -! const string& description, -! bool silent_overwrite_OK) -! { -! const char* const container = containing_directory(s); -! if (! is_writable_pathname(container)) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "', has a directory" -! << " component which is not writable." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! if (is_existent_file_pathname(s)) -! { -! if (is_plain_file_pathname(s)) -! if (is_writable_pathname(s)) -! { -! if (! silent_overwrite_OK) -! { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "' is of an existing" -! << " file." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } else { -! ostringstream oss; -! oss << "The " << name << " argument given, `" << s << "' is of an existing" -! << " file which is not writable." -! << " The argument should be " << description << "."; -! throw ICC_tool_exception(oss.str()); -! } -! } -! } -*** misc/SampleICC-1.3.2/IccProfLib/IccIO.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccIO.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 78,84 **** - #include "IccIO.h" - #include "IccUtil.h" - #include <stdlib.h> -! #include <memory.h> - #include <string.h> - - #ifndef __max ---- 78,84 ---- - #include "IccIO.h" - #include "IccUtil.h" - #include <stdlib.h> -! #include <memory> - #include <string.h> - - #ifndef __max -*** misc/SampleICC-1.3.2/IccProfLib/IccIO.h Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccIO.h Fri Jan 25 14:23:09 2008 -*************** -*** 79,84 **** ---- 79,85 ---- - #define _ICCIO_H - - #include "IccDefs.h" -+ #include "memory" - #include "stdio.h" - - #ifdef USESAMPLEICCNAMESPACE -*** misc/SampleICC-1.3.2/IccProfLib/IccMpeACS.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccMpeACS.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 136,152 **** - icChar sigBuf[30]; - - if (GetBAcsSig()) -! sDescription += "ELEM_bACS\r\n"; - else -! sDescription += "ELEM_eACS\r\n"; - - icGetSig(sigBuf, m_signature); - sDescription += " Signature = "; - sDescription += sigBuf; -! sDescription += "\r\n"; - - if (m_pData) { -! sDescription += "\r\nData Follows:\r\n"; - - icMemDump(sDescription, m_pData, m_nDataSize); - } ---- 136,152 ---- - icChar sigBuf[30]; - - if (GetBAcsSig()) -! sDescription += "ELEM_bACS\n"; - else -! sDescription += "ELEM_eACS\n"; - - icGetSig(sigBuf, m_signature); - sDescription += " Signature = "; - sDescription += sigBuf; -! sDescription += "\n"; - - if (m_pData) { -! sDescription += "\nData Follows:\n"; - - icMemDump(sDescription, m_pData, m_nDataSize); - } -*** misc/SampleICC-1.3.2/IccProfLib/IccMpeBasic.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccMpeBasic.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 218,249 **** - sprintf(buf, "%.8f", m_endPoint); - sDescription += buf; - } -! sprintf(buf, "]\r\nFunctionType: %04Xh\r\n", m_nFunctionType); - sDescription += buf; - - switch(m_nFunctionType) { - case 0x0000: - if (m_params[1]==0.0 && m_params[2]==0.0) -! sprintf(buf, "Y = %.8f\r\n\r\n", m_params[3]); - else if (m_params[0]==1.0 && m_params[1]==1.0 && m_params[2]==0.0 && m_params[3]==0.0) -! sprintf(buf, "Y = X\r\n\r\n"); - else if (m_params[0]==1.0 && m_params[2]==0.0) -! sprintf(buf, "Y = %.8f * X + %.8f\r\n\r\n", - m_params[1], m_params[3]); - else -! sprintf(buf, "Y = (%.8f * X + %.8f)^%.4f + %.8f\r\n\r\n", - m_params[1], m_params[2], m_params[0], m_params[3]); - sDescription += buf; - return; - - case 0x0001: -! sprintf(buf, "Y = %.8f * log (%.8f * (X ^ %.8f) + %.8f) + %.8f\r\n\r\n", - m_params[1], m_params[2], m_params[0], m_params[3], m_params[4]); - sDescription += buf; - return; - - case 0x0002: -! sprintf(buf, "Y = %.8f * (%.8f ^ (%.8f * X + %.8f)) + %.8f\r\n\r\n", - m_params[0], m_params[1], m_params[2], m_params[3], m_params[4]); - sDescription += buf; - return; ---- 218,249 ---- - sprintf(buf, "%.8f", m_endPoint); - sDescription += buf; - } -! sprintf(buf, "]\nFunctionType: %04Xh\n", m_nFunctionType); - sDescription += buf; - - switch(m_nFunctionType) { - case 0x0000: - if (m_params[1]==0.0 && m_params[2]==0.0) -! sprintf(buf, "Y = %.8f\n\n", m_params[3]); - else if (m_params[0]==1.0 && m_params[1]==1.0 && m_params[2]==0.0 && m_params[3]==0.0) -! sprintf(buf, "Y = X\n\n"); - else if (m_params[0]==1.0 && m_params[2]==0.0) -! sprintf(buf, "Y = %.8f * X + %.8f\n\n", - m_params[1], m_params[3]); - else -! sprintf(buf, "Y = (%.8f * X + %.8f)^%.4f + %.8f\n\n", - m_params[1], m_params[2], m_params[0], m_params[3]); - sDescription += buf; - return; - - case 0x0001: -! sprintf(buf, "Y = %.8f * log (%.8f * (X ^ %.8f) + %.8f) + %.8f\n\n", - m_params[1], m_params[2], m_params[0], m_params[3], m_params[4]); - sDescription += buf; - return; - - case 0x0002: -! sprintf(buf, "Y = %.8f * (%.8f ^ (%.8f * X + %.8f)) + %.8f\n\n", - m_params[0], m_params[1], m_params[2], m_params[3], m_params[4]); - sDescription += buf; - return; -*************** -*** 250,260 **** - - default: - int i; -! sprintf(buf, "Unknown Function with %d parameters:\r\n\r\n", m_nParameters); - sDescription += buf; - - for (i=0; i<m_nParameters; i++) { -! sprintf(buf, "Param[%d] = %.8lf\r\n\r\n", i, m_params[i]); - sDescription += buf; - } - } ---- 250,260 ---- - - default: - int i; -! sprintf(buf, "Unknown Function with %d parameters:\n\n", m_nParameters); - sDescription += buf; - - for (i=0; i<m_nParameters; i++) { -! sprintf(buf, "Param[%d] = %.8lf\n\n", i, m_params[i]); - sDescription += buf; - } - } -*************** -*** 496,502 **** - if (m_nReserved || m_nReserved2) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has non zero reserved data.\r\n"; - rv = icValidateWarning; - } - ---- 496,502 ---- - if (m_nReserved || m_nReserved2) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has non zero reserved data.\n"; - rv = icValidateWarning; - } - -*************** -*** 505,517 **** - if (!m_params || m_nParameters<4) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " formula curve has Invalid formulaCurveSegment parameters.\r\n"; - rv = icValidateCriticalError; - } - else if (m_nParameters > 4) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has too many formulaCurveSegment parameters.\r\n"; - rv = icValidateWarning; - } - break; ---- 505,517 ---- - if (!m_params || m_nParameters<4) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " formula curve has Invalid formulaCurveSegment parameters.\n"; - rv = icValidateCriticalError; - } - else if (m_nParameters > 4) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has too many formulaCurveSegment parameters.\n"; - rv = icValidateWarning; - } - break; -*************** -*** 520,532 **** - if (!m_params || m_nParameters<5) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " formula curve has Invalid formulaCurveSegment parameters.\r\n"; - rv = icValidateCriticalError; - } - else if (m_nParameters > 5) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has too many formulaCurveSegment parameters.\r\n"; - rv = icValidateWarning; - } - break; ---- 520,532 ---- - if (!m_params || m_nParameters<5) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " formula curve has Invalid formulaCurveSegment parameters.\n"; - rv = icValidateCriticalError; - } - else if (m_nParameters > 5) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has too many formulaCurveSegment parameters.\n"; - rv = icValidateWarning; - } - break; -*************** -*** 535,547 **** - if (!m_params || m_nParameters<5) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " formula curve has Invalid formulaCurveSegment parameters.\r\n"; - rv = icValidateCriticalError; - } - else if (m_nParameters > 5) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has too many formulaCurveSegment parameters.\r\n"; - rv = icValidateWarning; - } - break; ---- 535,547 ---- - if (!m_params || m_nParameters<5) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " formula curve has Invalid formulaCurveSegment parameters.\n"; - rv = icValidateCriticalError; - } - else if (m_nParameters > 5) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " formula curve has too many formulaCurveSegment parameters.\n"; - rv = icValidateWarning; - } - break; -*************** -*** 551,557 **** - icChar buf[128]; - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sprintf(buf, " formula curve uses unknown formulaCurveSegment function type %d\r\n", m_nFunctionType); - sReport += buf; - rv = icValidateCriticalError; - } ---- 551,557 ---- - icChar buf[128]; - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sprintf(buf, " formula curve uses unknown formulaCurveSegment function type %d\n", m_nFunctionType); - sReport += buf; - rv = icValidateCriticalError; - } -*************** -*** 727,733 **** - sDescription += buf; - } - -! sprintf(buf, "]\r\n"); - sDescription += buf; - } - else { ---- 727,733 ---- - sDescription += buf; - } - -! sprintf(buf, "]\n"); - sDescription += buf; - } - else { -*************** -*** 744,752 **** - sprintf(buf, "%.8f", m_endPoint); - sDescription += buf; - } -! sprintf(buf, "]\r\n"); - sDescription += buf; -! sDescription += "IN OUT\r\n"; - - icUInt32Number i; - ---- 744,752 ---- - sprintf(buf, "%.8f", m_endPoint); - sDescription += buf; - } -! sprintf(buf, "]\n"); - sDescription += buf; -! sDescription += "IN OUT\n"; - - icUInt32Number i; - -*************** -*** 754,764 **** - icFloatNumber last = (icFloatNumber)(m_nCount-1); - - for (i=0; i<m_nCount; i++) { -! sprintf(buf, "%.8f %.8f\r\n", m_startPoint + (icFloatNumber)i*range/last, m_pSamples[i]); - sDescription += buf; - } - } -! sDescription += "\r\n"; - } - - /** ---- 754,764 ---- - icFloatNumber last = (icFloatNumber)(m_nCount-1); - - for (i=0; i<m_nCount; i++) { -! sprintf(buf, "%.8f %.8f\n", m_startPoint + (icFloatNumber)i*range/last, m_pSamples[i]); - sDescription += buf; - } - } -! sDescription += "\n"; - } - - /** -*************** -*** 910,916 **** - if (m_nReserved) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " sampled curve has non zero reserved data.\r\n"; - rv = icValidateWarning; - } - ---- 910,916 ---- - if (m_nReserved) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " sampled curve has non zero reserved data.\n"; - rv = icValidateWarning; - } - -*************** -*** 917,929 **** - if (m_nCount<2) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " sampled curve has too few sample points.\r\n"; - rv = icValidateCriticalError; - } - else if (m_endPoint-m_startPoint == 0.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " sampled curve has a range of zero.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - ---- 917,929 ---- - if (m_nCount<2) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " sampled curve has too few sample points.\n"; - rv = icValidateCriticalError; - } - else if (m_endPoint-m_startPoint == 0.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " sampled curve has a range of zero.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - -*************** -*** 1054,1060 **** - { - CIccCurveSegmentList::iterator i; - -! sDescription += "BEGIN_CURVE\r\n"; - for (i=m_list->begin(); i!=m_list->end(); i++) { - (*i)->Describe(sDescription); - } ---- 1054,1060 ---- - { - CIccCurveSegmentList::iterator i; - -! sDescription += "BEGIN_CURVE\n"; - for (i=m_list->begin(); i!=m_list->end(); i++) { - (*i)->Describe(sDescription); - } -*************** -*** 1342,1348 **** - if (m_nReserved1 || m_nReserved2) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " Segmented curve has non zero reserved data.\r\n"; - rv = icValidateWarning; - } - ---- 1342,1348 ---- - if (m_nReserved1 || m_nReserved2) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " Segmented curve has non zero reserved data.\n"; - rv = icValidateWarning; - } - -*************** -*** 1349,1355 **** - if (m_list->size()==0) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " Has Empty CurveSegment!\r\n"; - return icValidateCriticalError; - } - ---- 1349,1355 ---- - if (m_list->size()==0) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " Has Empty CurveSegment!\n"; - return icValidateCriticalError; - } - -*************** -*** 1599,1609 **** - icChar buf[81]; - int i; - -! sprintf(buf, "BEGIN_CURVE_SET %d\r\n", m_nInputChannels); - sDescription += buf; - - for (i=0; i<m_nInputChannels; i++) { -! sprintf(buf, "Curve %d of %d\r\n", i+1, m_nInputChannels); - sDescription += buf; - if (m_curve[i]) { - m_curve[i]->Describe(sDescription); ---- 1599,1609 ---- - icChar buf[81]; - int i; - -! sprintf(buf, "BEGIN_CURVE_SET %d\n", m_nInputChannels); - sDescription += buf; - - for (i=0; i<m_nInputChannels; i++) { -! sprintf(buf, "Curve %d of %d\n", i+1, m_nInputChannels); - sDescription += buf; - if (m_curve[i]) { - m_curve[i]->Describe(sDescription); -*************** -*** 1877,1883 **** - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " Has Empty Curve Element(s)!\r\n"; - return icValidateCriticalError; - } - ---- 1877,1883 ---- - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " Has Empty Curve Element(s)!\n"; - return icValidateCriticalError; - } - -*************** -*** 2042,2048 **** - int i, j; - icFloatNumber *data = m_pMatrix; - -! sprintf(buf, "BEGIN_ELEM_MATRIX %d %d\r\n", m_nInputChannels, m_nOutputChannels); - sDescription += buf; - - for (j=0; j<m_nOutputChannels; j++) { ---- 2042,2048 ---- - int i, j; - icFloatNumber *data = m_pMatrix; - -! sprintf(buf, "BEGIN_ELEM_MATRIX %d %d\n", m_nInputChannels, m_nOutputChannels); - sDescription += buf; - - for (j=0; j<m_nOutputChannels; j++) { -*************** -*** 2052,2058 **** - sprintf(buf, "%12.8lf", data[i]); - sDescription += buf; - } -! sprintf(buf, " + %12.8lf\r\n", m_pConstants[j]); - sDescription += buf; - data += i; - } ---- 2052,2058 ---- - sprintf(buf, "%12.8lf", data[i]); - sDescription += buf; - } -! sprintf(buf, " + %12.8lf\n", m_pConstants[j]); - sDescription += buf; - data += i; - } -*************** -*** 2273,2279 **** - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " Has Empty Matrix data!\r\n"; - return icValidateCriticalError; - } - ---- 2273,2279 ---- - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " Has Empty Matrix data!\n"; - return icValidateCriticalError; - } - -*************** -*** 2620,2626 **** - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " Has No CLUT!\r\n"; - return icValidateCriticalError; - } - ---- 2620,2626 ---- - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " Has No CLUT!\n"; - return icValidateCriticalError; - } - -*** misc/SampleICC-1.3.2/IccProfLib/IccProfLibConf.h Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccProfLibConf.h Fri Jan 25 14:23:09 2008 -*************** -*** 112,126 **** - #define ICUINT64TYPE unsigned long long - #define ICINT64TYPE long long - -! #if defined(__APPLE__) -! #if defined(__LITTLE_ENDIAN__) -! #define ICC_BYTE_ORDER_LITTLE_ENDIAN -! #else - #define ICC_BYTE_ORDER_BIG_ENDIAN -! #endif -! #else -! #define ICC_BYTE_ORDER_LITTLE_ENDIAN -! #endif - - #define ICCPROFLIB_API - #define ICCPROFLIB_EXTERN ---- 112,126 ---- - #define ICUINT64TYPE unsigned long long - #define ICINT64TYPE long long - -! /* #if defined(__APPLE__) */ -! /* #if defined(__LITTLE_ENDIAN__) */ -! /* #define ICC_BYTE_ORDER_LITTLE_ENDIAN */ -! /* #else */ - #define ICC_BYTE_ORDER_BIG_ENDIAN -! /* #endif */ -! /* #else */ -! /* #define ICC_BYTE_ORDER_LITTLE_ENDIAN */ -! /* #endif */ - - #define ICCPROFLIB_API - #define ICCPROFLIB_EXTERN -*** misc/SampleICC-1.3.2/IccProfLib/IccProfile.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccProfile.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 567,573 **** - - if (!ReadBasic(pIO)) { - sReport += icValidateCriticalErrorMsg; -! sReport += " - Unable to read profile!**\r\n\tProfile has invalid structure!\r\n"; - Cleanup(); - - return icValidateCriticalError; ---- 567,573 ---- - - if (!ReadBasic(pIO)) { - sReport += icValidateCriticalErrorMsg; -! sReport += " - Unable to read profile!**\n\tProfile has invalid structure!\n"; - Cleanup(); - - return icValidateCriticalError; -*************** -*** 576,582 **** - // Check profile header - if (!CheckFileSize(pIO)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Bad Header File Size\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 576,582 ---- - // Check profile header - if (!CheckFileSize(pIO)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Bad Header File Size\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 588,594 **** - CalcProfileID(pIO, &profileID); - if (strncmp((char*)profileID.ID8, (char*)m_Header.profileID.ID8, 16) != 0) { - sReport += icValidateNonCompliantMsg; -! sReport += "Bad Profile ID\r\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 588,594 ---- - CalcProfileID(pIO, &profileID); - if (strncmp((char*)profileID.ID8, (char*)m_Header.profileID.ID8, 16) != 0) { - sReport += icValidateNonCompliantMsg; -! sReport += "Bad Profile ID\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 601,607 **** - sReport += icValidateCriticalErrorMsg; - sReport += " - "; - sReport += Info.GetTagSigName(i->TagInfo.sig); -! sReport += " - Tag has invalid structure!\r\n"; - - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 601,607 ---- - sReport += icValidateCriticalErrorMsg; - sReport += " - "; - sReport += Info.GetTagSigName(i->TagInfo.sig); -! sReport += " - Tag has invalid structure!\n"; - - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 1026,1032 **** - - default: - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown profile class!\r\n", Info.GetProfileClassSigName(m_Header.deviceClass)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 1026,1032 ---- - - default: - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown profile class!\n", Info.GetProfileClassSigName(m_Header.deviceClass)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 1033,1039 **** - - if (!Info.IsValidSpace(m_Header.colorSpace)) { - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown color space!\r\n", Info.GetColorSpaceSigName(m_Header.colorSpace)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 1033,1039 ---- - - if (!Info.IsValidSpace(m_Header.colorSpace)) { - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown color space!\n", Info.GetColorSpaceSigName(m_Header.colorSpace)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 1041,1047 **** - if (m_Header.deviceClass==icSigLinkClass) { - if (!Info.IsValidSpace(m_Header.pcs)) { - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown pcs color space!\r\n", Info.GetColorSpaceSigName(m_Header.pcs)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 1041,1047 ---- - if (m_Header.deviceClass==icSigLinkClass) { - if (!Info.IsValidSpace(m_Header.pcs)) { - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown pcs color space!\n", Info.GetColorSpaceSigName(m_Header.pcs)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 1049,1055 **** - else { - if (m_Header.pcs!=icSigXYZData && m_Header.pcs!=icSigLabData) { - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Invalid pcs color space!\r\n", Info.GetColorSpaceSigName(m_Header.pcs)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 1049,1055 ---- - else { - if (m_Header.pcs!=icSigXYZData && m_Header.pcs!=icSigLabData) { - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Invalid pcs color space!\n", Info.GetColorSpaceSigName(m_Header.pcs)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 1068,1074 **** - - default: - sReport += icValidateWarningMsg; -! sprintf(buf, " - %s: Unknown platform signature.\r\n", Info.GetPlatformSigName(m_Header.platform)); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1068,1074 ---- - - default: - sReport += icValidateWarningMsg; -! sprintf(buf, " - %s: Unknown platform signature.\n", Info.GetPlatformSigName(m_Header.platform)); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1095,1101 **** - - default: - sReport += icValidateWarningMsg; -! sprintf(buf, " - %s: Unregisterd CMM signature.\r\n", Info.GetCmmSigName((icCmmSignature)m_Header.cmmId)); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1095,1101 ---- - - default: - sReport += icValidateWarningMsg; -! sprintf(buf, " - %s: Unregisterd CMM signature.\n", Info.GetCmmSigName((icCmmSignature)m_Header.cmmId)); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1109,1115 **** - - default: - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown rendering intent!\r\n", Info.GetRenderingIntentName((icRenderingIntent)m_Header.renderingIntent)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 1109,1115 ---- - - default: - sReport += icValidateCriticalErrorMsg; -! sprintf(buf, " - %s: Unknown rendering intent!\n", Info.GetRenderingIntentName((icRenderingIntent)m_Header.renderingIntent)); - sReport += buf; - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 1120,1126 **** - icFloatNumber Z = icFtoD(m_Header.illuminant.Z); - if (X<0.9640 || X>0.9644 || Y!=1.0 || Z<0.8247 || Z>0.8251) { - sReport += icValidateNonCompliantMsg; -! sReport += " - Non D50 Illuminant XYZ values.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 1120,1126 ---- - icFloatNumber Z = icFtoD(m_Header.illuminant.Z); - if (X<0.9640 || X>0.9644 || Y!=1.0 || Z<0.8247 || Z>0.8251) { - sReport += icValidateNonCompliantMsg; -! sReport += " - Non D50 Illuminant XYZ values.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 1130,1136 **** - } - if (sum) { - sReport += icValidateNonCompliantMsg; -! sReport += " - Reserved value must be zero.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 1130,1136 ---- - } - if (sum) { - sReport += icValidateNonCompliantMsg; -! sReport += " - Reserved value must be zero.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 1163,1169 **** - { - sReport += icValidateWarningMsg; - sReport += buf; -! sReport += " - Tag exclusion test failed.\r\n"; - rv = false; - } - } ---- 1163,1169 ---- - { - sReport += icValidateWarningMsg; - sReport += buf; -! sReport += " - Tag exclusion test failed.\n"; - rv = false; - } - } -*************** -*** 1177,1183 **** - { - sReport += icValidateWarningMsg; - sReport += buf; -! sReport += " - Tag exclusion test failed.\r\n"; - rv = false; - } - break; ---- 1177,1183 ---- - { - sReport += icValidateWarningMsg; - sReport += buf; -! sReport += " - Tag exclusion test failed.\n"; - rv = false; - } - break; -*************** -*** 1192,1198 **** - { - sReport += icValidateWarningMsg; - sReport += buf; -! sReport += " - Tag exclusion test failed.\r\n"; - rv = false; - } - break; ---- 1192,1198 ---- - { - sReport += icValidateWarningMsg; - sReport += buf; -! sReport += " - Tag exclusion test failed.\n"; - rv = false; - } - break; -*************** -*** 1234,1240 **** - if (!IsTypeValid(tagsig, typesig)) { - sReport += icValidateNonCompliantMsg; - sReport += buf; -! sprintf(buf," - %s: Invalid tag type (Might be critical!).\r\n", Info.GetTagTypeSigName(typesig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 1234,1240 ---- - if (!IsTypeValid(tagsig, typesig)) { - sReport += icValidateNonCompliantMsg; - sReport += buf; -! sprintf(buf," - %s: Invalid tag type (Might be critical!).\n", Info.GetTagTypeSigName(typesig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 1477,1483 **** - { - if (m_Tags->size() <= 0) { - sReport += icValidateCriticalErrorMsg; -! sReport += "No tags present.\r\n"; - return icValidateCriticalError; - } - ---- 1477,1483 ---- - { - if (m_Tags->size() <= 0) { - sReport += icValidateCriticalErrorMsg; -! sReport += "No tags present.\n"; - return icValidateCriticalError; - } - -*************** -*** 1486,1492 **** - if (!GetTag(icSigProfileDescriptionTag) || - !GetTag(icSigCopyrightTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Required tags missing.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 1486,1492 ---- - if (!GetTag(icSigProfileDescriptionTag) || - !GetTag(icSigCopyrightTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Required tags missing.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 1495,1501 **** - if (sig != icSigLinkClass) { - if (!GetTag(icSigMediaWhitePointTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Media white point tag missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 1495,1501 ---- - if (sig != icSigLinkClass) { - if (!GetTag(icSigMediaWhitePointTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Media white point tag missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 1505,1511 **** - if (m_Header.colorSpace == icSigGrayData) { - if (!GetTag(icSigGrayTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Gray TRC tag missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 1505,1511 ---- - if (m_Header.colorSpace == icSigGrayData) { - if (!GetTag(icSigGrayTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Gray TRC tag missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 1515,1521 **** - !GetTag(icSigBlueMatrixColumnTag) || !GetTag(icSigRedTRCTag) || - !GetTag(icSigGreenTRCTag) || !GetTag(icSigBlueTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 1515,1521 ---- - !GetTag(icSigBlueMatrixColumnTag) || !GetTag(icSigRedTRCTag) || - !GetTag(icSigGreenTRCTag) || !GetTag(icSigBlueTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 1526,1532 **** - if (m_Header.colorSpace == icSigGrayData) { - if (!GetTag(icSigGrayTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Gray TRC tag missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 1526,1532 ---- - if (m_Header.colorSpace == icSigGrayData) { - if (!GetTag(icSigGrayTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Gray TRC tag missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 1536,1542 **** - !GetTag(icSigBlueMatrixColumnTag) || !GetTag(icSigRedTRCTag) || - !GetTag(icSigGreenTRCTag) || !GetTag(icSigBlueTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 1536,1542 ---- - !GetTag(icSigBlueMatrixColumnTag) || !GetTag(icSigRedTRCTag) || - !GetTag(icSigGreenTRCTag) || !GetTag(icSigBlueTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 1547,1553 **** - if (m_Header.colorSpace == icSigGrayData) { - if (!GetTag(icSigGrayTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Gray TRC tag missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 1547,1553 ---- - if (m_Header.colorSpace == icSigGrayData) { - if (!GetTag(icSigGrayTRCTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Gray TRC tag missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 1556,1568 **** - !GetTag(icSigAToB1Tag) || !GetTag(icSigBToA1Tag) || - !GetTag(icSigAToB2Tag) || !GetTag(icSigBToA2Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - - if (!GetTag(icSigGamutTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Gamut tag missing.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 1556,1568 ---- - !GetTag(icSigAToB1Tag) || !GetTag(icSigBToA1Tag) || - !GetTag(icSigAToB2Tag) || !GetTag(icSigBToA2Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - - if (!GetTag(icSigGamutTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Gamut tag missing.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 1585,1591 **** - case icSig16colorData: - if (!GetTag(icSigColorantTableTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "xCLR output profile is missing colorantTableTag\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 1585,1591 ---- - case icSig16colorData: - if (!GetTag(icSigColorantTableTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "xCLR output profile is missing colorantTableTag\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 1599,1605 **** - case icSigLinkClass: - if (!GetTag(icSigAToB0Tag) || !GetTag(icSigProfileSequenceDescTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 1599,1605 ---- - case icSigLinkClass: - if (!GetTag(icSigAToB0Tag) || !GetTag(icSigProfileSequenceDescTag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 1606,1612 **** - if (icIsSpaceCLR(m_Header.colorSpace)) { - if (!GetTag(icSigColorantTableTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Required tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } ---- 1606,1612 ---- - if (icIsSpaceCLR(m_Header.colorSpace)) { - if (!GetTag(icSigColorantTableTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Required tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } -*************** -*** 1614,1620 **** - if (icIsSpaceCLR(m_Header.pcs)) { - if (!GetTag(icSigColorantTableOutTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Required tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } ---- 1614,1620 ---- - if (icIsSpaceCLR(m_Header.pcs)) { - if (!GetTag(icSigColorantTableOutTag)) { - sReport += icValidateNonCompliantMsg; -! sReport += "Required tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } -*************** -*** 1623,1629 **** - case icSigColorSpaceClass: - if (!GetTag(icSigAToB0Tag) || !GetTag(icSigBToA0Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1623,1629 ---- - case icSigColorSpaceClass: - if (!GetTag(icSigAToB0Tag) || !GetTag(icSigBToA0Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1631,1637 **** - case icSigAbstractClass: - if (!GetTag(icSigAToB0Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1631,1637 ---- - case icSigAbstractClass: - if (!GetTag(icSigAToB0Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1639,1645 **** - case icSigNamedColorClass: - if (!GetTag(icSigNamedColor2Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 1639,1645 ---- - case icSigNamedColorClass: - if (!GetTag(icSigNamedColor2Tag)) { - sReport += icValidateCriticalErrorMsg; -! sReport += "Critical tag(s) missing.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 1647,1653 **** - - default: - sReport += icValidateCriticalErrorMsg; -! sReport += "Unknown Profile Class.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - break; - } ---- 1647,1653 ---- - - default: - sReport += icValidateCriticalErrorMsg; -! sReport += "Unknown Profile Class.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - break; - } -*************** -*** 1724,1730 **** - // Check for duplicate tags - if (!AreTagsUnique()) { - sReport += icValidateWarning; -! sReport += " - There are duplicate tags.\r\n"; - rv =icMaxStatus(rv, icValidateWarning); - } - ---- 1724,1730 ---- - // Check for duplicate tags - if (!AreTagsUnique()) { - sReport += icValidateWarning; -! sReport += " - There are duplicate tags.\n"; - rv =icMaxStatus(rv, icValidateWarning); - } - -*************** -*** 1979,1985 **** - sReport = icValidateCriticalErrorMsg; - sReport += " - "; - sReport += szFilename; -! sReport += "- Invalid Filename\r\n"; - delete pFileIO; - return NULL; - } ---- 1979,1985 ---- - sReport = icValidateCriticalErrorMsg; - sReport += " - "; - sReport += szFilename; -! sReport += "- Invalid Filename\n"; - delete pFileIO; - return NULL; - } -*** misc/SampleICC-1.3.2/IccProfLib/IccTagBasic.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagBasic.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 166,172 **** - CIccInfo Info; - sReport += icValidateNonCompliantMsg; - sReport += Info.GetSigName(sig); -! sReport += " - Reserved Value must be zero.\r\n"; - - rv = icValidateNonCompliant; - } ---- 166,172 ---- - CIccInfo Info; - sReport += icValidateNonCompliantMsg; - sReport += Info.GetSigName(sig); -! sReport += " - Reserved Value must be zero.\n"; - - rv = icValidateNonCompliant; - } -*************** -*** 340,346 **** - sprintf(buf, "%u Bytes.", m_nSize-4); - sDescription += buf; - -! sDescription += "\r\n\r\nData Follows:\r\n"; - - icMemDump(sDescription, m_pData+4, m_nSize-4); - } ---- 340,346 ---- - sprintf(buf, "%u Bytes.", m_nSize-4); - sDescription += buf; - -! sDescription += "\n\nData Follows:\n"; - - icMemDump(sDescription, m_pData+4, m_nSize-4); - } -*************** -*** 511,517 **** - if (m_szText && *m_szText) - sDescription += m_szText; - -! sDescription += "\"\r\n"; - } - - ---- 511,517 ---- - if (m_szText && *m_szText) - sDescription += m_szText; - -! sDescription += "\"\n"; - } - - -*************** -*** 629,635 **** - if (m_nBufSize<7) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Tag must have at least seven text characters.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; ---- 629,635 ---- - if (m_nBufSize<7) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Tag must have at least seven text characters.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; -*************** -*** 636,642 **** - default: - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Unknown Tag.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - int i; ---- 636,642 ---- - default: - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Unknown Tag.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - int i; -*************** -*** 644,650 **** - if (m_szText[i]&0x80) { - sReport += icValidateWarning; - sReport += sSigName; -! sReport += " - Text do not contain 7bit data.\r\n"; - } - } - } ---- 644,650 ---- - if (m_szText[i]&0x80) { - sReport += icValidateWarning; - sReport += sSigName; -! sReport += " - Text do not contain 7bit data.\n"; - } - } - } -*************** -*** 651,657 **** - else { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty Tag.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - ---- 651,657 ---- - else { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty Tag.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - -*************** -*** 941,947 **** - if (m_szText && *m_szText) - sDescription += m_szText; - -! sDescription += "\"\r\n"; - } - - ---- 941,947 ---- - if (m_szText && *m_szText) - sDescription += m_szText; - -! sDescription += "\"\n"; - } - - -*************** -*** 1101,1107 **** - if (m_nScriptSize>67) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - ScriptCode count must not be greater than 67.\r\n"; - - rv =icMaxStatus(rv, icValidateNonCompliant); - } ---- 1101,1107 ---- - if (m_nScriptSize>67) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - ScriptCode count must not be greater than 67.\n"; - - rv =icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 1260,1266 **** - CIccInfo Fmt; - - sDescription += Fmt.GetSigName(m_nSig); -! sDescription += "\r\n"; - } - - ---- 1260,1266 ---- - CIccInfo Fmt; - - sDescription += Fmt.GetSigName(m_nSig); -! sDescription += "\n"; - } - - -*************** -*** 1320,1326 **** - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Technology.\r\n", Info.GetSigName(m_nSig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 1320,1326 ---- - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Technology.\n", Info.GetSigName(m_nSig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 1336,1342 **** - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Reference Medium Gamut.\r\n", Info.GetSigName(m_nSig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 1336,1342 ---- - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Reference Medium Gamut.\n", Info.GetSigName(m_nSig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 1355,1361 **** - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Colorimetric Intent Image State.\r\n", Info.GetSigName(m_nSig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 1355,1361 ---- - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Colorimetric Intent Image State.\n", Info.GetSigName(m_nSig)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 1686,1692 **** - - sDescription.reserve(sDescription.size() + m_nSize*79); - -! sprintf(buf, "BEGIN_NAMED_COLORS flags=%08x %u %u\r\n", m_nVendorFlags, m_nSize, m_nDeviceCoords); - sDescription += buf; - - for (i=0; i<m_nSize; i++) { ---- 1686,1692 ---- - - sDescription.reserve(sDescription.size() + m_nSize*79); - -! sprintf(buf, "BEGIN_NAMED_COLORS flags=%08x %u %u\n", m_nVendorFlags, m_nSize, m_nDeviceCoords); - sDescription += buf; - - for (i=0; i<m_nSize; i++) { -*************** -*** 1717,1723 **** - sDescription += buf; - } - } -! sDescription += "\r\n"; - - pNamedColor = (SIccNamedColorEntry*)((icChar*)pNamedColor + m_nColorEntrySize); - } ---- 1717,1723 ---- - sDescription += buf; - } - } -! sDescription += "\n"; - - pNamedColor = (SIccNamedColorEntry*)((icChar*)pNamedColor + m_nColorEntrySize); - } -*************** -*** 2082,2088 **** - if (!m_nSize) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty tag!\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - ---- 2082,2088 ---- - if (!m_nSize) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty tag!\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - -*************** -*** 2092,2098 **** - if (m_nDeviceCoords != nCoords) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of device co-ordinates.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } ---- 2092,2098 ---- - if (m_nDeviceCoords != nCoords) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of device co-ordinates.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } -*************** -*** 2099,2105 **** - else { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } ---- 2099,2105 ---- - else { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } -*************** -*** 2285,2291 **** - icChar buf[128]; - - if (m_nSize == 1 ) { -! sprintf(buf, "X=%.4lf, Y=%.4lf, Z=%.4lf\r\n", icFtoD(m_XYZ[0].X), icFtoD(m_XYZ[0].Y), icFtoD(m_XYZ[0].Z)); - sDescription += buf; - } - else { ---- 2285,2291 ---- - icChar buf[128]; - - if (m_nSize == 1 ) { -! sprintf(buf, "X=%.4lf, Y=%.4lf, Z=%.4lf\n", icFtoD(m_XYZ[0].X), icFtoD(m_XYZ[0].Y), icFtoD(m_XYZ[0].Z)); - sDescription += buf; - } - else { -*************** -*** 2293,2299 **** - sDescription.reserve(sDescription.size() + m_nSize*79); - - for (i=0; i<m_nSize; i++) { -! sprintf(buf, "value[%u]: X=%.4lf, Y=%.4lf, Z=%.4lf\r\n", i, icFtoD(m_XYZ[i].X), icFtoD(m_XYZ[i].Y), icFtoD(m_XYZ[i].Z)); - sDescription += buf; - } - } ---- 2293,2299 ---- - sDescription.reserve(sDescription.size() + m_nSize*79); - - for (i=0; i<m_nSize; i++) { -! sprintf(buf, "value[%u]: X=%.4lf, Y=%.4lf, Z=%.4lf\n", i, icFtoD(m_XYZ[i].X), icFtoD(m_XYZ[i].Y), icFtoD(m_XYZ[i].Z)); - sDescription += buf; - } - } -*************** -*** 2347,2353 **** - if (!m_nSize) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty tag.\r\n"; - - rv = icMaxStatus(rv, icValidateWarning); - return rv; ---- 2347,2353 ---- - if (!m_nSize) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty tag.\n"; - - rv = icMaxStatus(rv, icValidateWarning); - return rv; -*************** -*** 2553,2566 **** - - icUInt32Number i; - //sDescription.reserve(sDescription.size() + m_nChannels*79); -! sprintf(buf, "Number of Channels : %u\r\n", m_nChannels); - sDescription += buf; - -! sprintf(buf, "Colorant Encoding : %s\r\n", Fmt.GetColorantEncoding((icColorantEncoding)m_nColorantType)); - sDescription += buf; - - for (i=0; i<m_nChannels; i++) { -! sprintf(buf, "value[%u]: x=%.3lf, y=%.3lf\r\n", i, icUFtoD(m_xy[i].x), icUFtoD(m_xy[i].y)); - sDescription += buf; - } - ---- 2553,2566 ---- - - icUInt32Number i; - //sDescription.reserve(sDescription.size() + m_nChannels*79); -! sprintf(buf, "Number of Channels : %u\n", m_nChannels); - sDescription += buf; - -! sprintf(buf, "Colorant Encoding : %s\n", Fmt.GetColorantEncoding((icColorantEncoding)m_nColorantType)); - sDescription += buf; - - for (i=0; i<m_nChannels; i++) { -! sprintf(buf, "value[%u]: x=%.3lf, y=%.3lf\n", i, icUFtoD(m_xy[i].x), icUFtoD(m_xy[i].y)); - sDescription += buf; - } - -*************** -*** 2617,2623 **** - if (m_nChannels!=3) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of device channels must be three.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 2617,2623 ---- - if (m_nChannels!=3) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of device channels must be three.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 2629,2635 **** - (m_xy[2].x != icDtoUF((icFloatNumber)0.150)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.060)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; ---- 2629,2635 ---- - (m_xy[2].x != icDtoUF((icFloatNumber)0.150)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.060)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; -*************** -*** 2642,2648 **** - (m_xy[2].x != icDtoUF((icFloatNumber)0.155)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.070)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; ---- 2642,2648 ---- - (m_xy[2].x != icDtoUF((icFloatNumber)0.155)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.070)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; -*************** -*** 2655,2661 **** - (m_xy[2].x != icDtoUF((icFloatNumber)0.15)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.06)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; ---- 2655,2661 ---- - (m_xy[2].x != icDtoUF((icFloatNumber)0.15)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.06)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; -*************** -*** 2668,2674 **** - (m_xy[2].x != icDtoUF((icFloatNumber)0.155)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.070)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; ---- 2668,2674 ---- - (m_xy[2].x != icDtoUF((icFloatNumber)0.155)) || (m_xy[2].y != icDtoUF((icFloatNumber)0.070)) ) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Chromaticity data does not match specification.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - break; -*************** -*** 2678,2684 **** - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid colorant type encoding.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } ---- 2678,2684 ---- - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid colorant type encoding.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } -*************** -*** 2884,2892 **** - - if (m_nSize == 1 ) { - if (Tsig==icSigS15Fixed16ArrayType) -! sprintf(buf, "Value = %.4lf\r\n", icFtoD(m_Num[0])); - else -! sprintf(buf, "Value = %.4lf\r\n", icUFtoD(m_Num[0])); - sDescription += buf; - } - else { ---- 2884,2892 ---- - - if (m_nSize == 1 ) { - if (Tsig==icSigS15Fixed16ArrayType) -! sprintf(buf, "Value = %.4lf\n", icFtoD(m_Num[0])); - else -! sprintf(buf, "Value = %.4lf\n", icUFtoD(m_Num[0])); - sDescription += buf; - } - else { -*************** -*** 2893,2910 **** - icUInt32Number i; - - if (Tsig==icSigS15Fixed16ArrayType && m_nSize==9) { -! sDescription += "Matrix Form:\r\n"; - icMatrixDump(sDescription, (icS15Fixed16Number*)m_Num); - -! sDescription += "\r\nArrayForm:\r\n"; - } - sDescription.reserve(sDescription.size() + m_nSize*79); - - for (i=0; i<m_nSize; i++) { - if (Tsig==icSigS15Fixed16ArrayType) -! sprintf(buf, "Value[%u] = %.4lf\r\n", i, icFtoD(m_Num[i])); - else -! sprintf(buf, "Value[%u] = %.4lf\r\n", i, icUFtoD(m_Num[i])); - sDescription += buf; - } - } ---- 2893,2910 ---- - icUInt32Number i; - - if (Tsig==icSigS15Fixed16ArrayType && m_nSize==9) { -! sDescription += "Matrix Form:\n"; - icMatrixDump(sDescription, (icS15Fixed16Number*)m_Num); - -! sDescription += "\nArrayForm:\n"; - } - sDescription.reserve(sDescription.size() + m_nSize*79); - - for (i=0; i<m_nSize; i++) { - if (Tsig==icSigS15Fixed16ArrayType) -! sprintf(buf, "Value[%u] = %.4lf\n", i, icFtoD(m_Num[i])); - else -! sprintf(buf, "Value[%u] = %.4lf\n", i, icUFtoD(m_Num[i])); - sDescription += buf; - } - } -*************** -*** 3172,3178 **** - icChar buf[128]; - - if (m_nSize == 1 ) { -! sprintf(buf, "Value = %u (0x%x)\r\n", m_Num[0], m_Num[0]); - sDescription += buf; - } - else { ---- 3172,3178 ---- - icChar buf[128]; - - if (m_nSize == 1 ) { -! sprintf(buf, "Value = %u (0x%x)\n", m_Num[0], m_Num[0]); - sDescription += buf; - } - else { -*************** -*** 3180,3186 **** - sDescription.reserve(sDescription.size() + m_nSize*79); - - for (i=0; i<m_nSize; i++) { -! sprintf(buf, "Value[%u] = %u (0x%x)\r\n", i, m_Num[i], m_Num[i]); - sDescription += buf; - } - } ---- 3180,3186 ---- - sDescription.reserve(sDescription.size() + m_nSize*79); - - for (i=0; i<m_nSize; i++) { -! sprintf(buf, "Value[%u] = %u (0x%x)\n", i, m_Num[i], m_Num[i]); - sDescription += buf; - } - } -*************** -*** 3374,3388 **** - CIccInfo Fmt; - icChar buf[128]; - -! sDescription += Fmt.GetStandardObserverName(m_Data.stdObserver); sDescription += "\r\n"; -! sprintf(buf, "Backing measurement: X=%.4lf, Y=%.4lf, Z=%.4lf\r\n", - icFtoD(m_Data.backing.X), - icFtoD(m_Data.backing.Y), - icFtoD(m_Data.backing.Z)); - sDescription += buf; -! sDescription += Fmt.GetMeasurementGeometryName(m_Data.geometry); sDescription += "\r\n"; -! sDescription += Fmt.GetMeasurementFlareName(m_Data.flare); sDescription += "\r\n"; -! sDescription += Fmt.GetIlluminantName(m_Data.illuminant); sDescription += "\r\n"; - } - - ---- 3374,3388 ---- - CIccInfo Fmt; - icChar buf[128]; - -! sDescription += Fmt.GetStandardObserverName(m_Data.stdObserver); sDescription += "\n"; -! sprintf(buf, "Backing measurement: X=%.4lf, Y=%.4lf, Z=%.4lf\n", - icFtoD(m_Data.backing.X), - icFtoD(m_Data.backing.Y), - icFtoD(m_Data.backing.Z)); - sDescription += buf; -! sDescription += Fmt.GetMeasurementGeometryName(m_Data.geometry); sDescription += "\n"; -! sDescription += Fmt.GetMeasurementFlareName(m_Data.flare); sDescription += "\n"; -! sDescription += Fmt.GetIlluminantName(m_Data.illuminant); sDescription += "\n"; - } - - -*************** -*** 3416,3422 **** - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid standard observer encoding.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 3416,3422 ---- - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid standard observer encoding.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 3429,3435 **** - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid measurement geometry encoding.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 3429,3435 ---- - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid measurement geometry encoding.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 3448,3454 **** - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid standard illuminant encoding.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 3448,3454 ---- - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid standard illuminant encoding.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 3902,3910 **** - - for (i=m_Strings->begin(); i!=m_Strings->end(); i++) { - if (i!=m_Strings->begin()) -! sDescription += "\r\n"; - -! sprintf(szBuf, "Language = '%c%c', Region = '%c%c'\r\n", - i->m_nLanguageCode>>8, i->m_nLanguageCode, - i->m_nCountryCode>>8, i->m_nCountryCode); - ---- 3902,3910 ---- - - for (i=m_Strings->begin(); i!=m_Strings->end(); i++) { - if (i!=m_Strings->begin()) -! sDescription += "\n"; - -! sprintf(szBuf, "Language = '%c%c', Region = '%c%c'\n", - i->m_nLanguageCode>>8, i->m_nLanguageCode, - i->m_nCountryCode>>8, i->m_nCountryCode); - -*************** -*** 3919,3925 **** - i->GetAnsi(szBuf, nSize); - sDescription += "\""; - sDescription += szBuf; -! sDescription += "\"\r\n"; - } - } - ---- 3919,3925 ---- - i->GetAnsi(szBuf, nSize); - sDescription += "\""; - sDescription += szBuf; -! sDescription += "\"\n"; - } - } - -*************** -*** 3948,3954 **** - if (!m_Strings->size()) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty tag!\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - ---- 3948,3954 ---- - if (!m_Strings->size()) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty tag!\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - -*************** -*** 4246,4260 **** - { - icChar buf[128]; - -! sDescription = "\r\nData:\r\n"; - - if (IsTypeAscii()) { -! sprintf(buf, "%s\r\n", (icChar*)m_pData); - sDescription += buf; - } - else - for (int i = 0; i<(int)m_nSize; i++) { -! sprintf(buf, "%d\r\n", m_pData[i]); - sDescription += buf; - } - ---- 4246,4260 ---- - { - icChar buf[128]; - -! sDescription = "\nData:\n"; - - if (IsTypeAscii()) { -! sprintf(buf, "%s\n", (icChar*)m_pData); - sDescription += buf; - } - else - for (int i = 0; i<(int)m_nSize; i++) { -! sprintf(buf, "%d\n", m_pData[i]); - sDescription += buf; - } - -*************** -*** 4312,4318 **** - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid data flag encoding.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 4312,4318 ---- - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Invalid data flag encoding.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 4477,4487 **** - icChar buf[128]; - - sDescription = "Date = "; -! sprintf(buf, "%u-%u-%u\r\n", m_DateTime.month, m_DateTime.day, m_DateTime.year); - sDescription += buf; - - sDescription += "Time = "; -! sprintf(buf, "%u:%u:%u\r\n", m_DateTime.hours, m_DateTime.minutes, m_DateTime.seconds); - sDescription += buf; - } - ---- 4477,4487 ---- - icChar buf[128]; - - sDescription = "Date = "; -! sprintf(buf, "%u-%u-%u\n", m_DateTime.month, m_DateTime.day, m_DateTime.year); - sDescription += buf; - - sDescription += "Time = "; -! sprintf(buf, "%u:%u:%u\n", m_DateTime.hours, m_DateTime.minutes, m_DateTime.seconds); - sDescription += buf; - } - -*************** -*** 4697,4708 **** - { - icChar buf[128]; - -! sprintf(buf, "Colorant Count : %u\r\n", m_nCount); - sDescription += buf; -! sDescription += "Order of Colorants:\r\n"; - - for (int i=0; i<(int)m_nCount; i++) { -! sprintf(buf, "%u\r\n", m_pData[i]); - sDescription += buf; - } - } ---- 4697,4708 ---- - { - icChar buf[128]; - -! sprintf(buf, "Colorant Count : %u\n", m_nCount); - sDescription += buf; -! sDescription += "Order of Colorants:\n"; - - for (int i=0; i<(int)m_nCount; i++) { -! sprintf(buf, "%u\n", m_pData[i]); - sDescription += buf; - } - } -*************** -*** 4757,4763 **** - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } ---- 4757,4763 ---- - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } -*************** -*** 4765,4771 **** - if (m_nCount != icGetSpaceSamples(pProfile->m_Header.colorSpace)) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of colorants.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 4765,4771 ---- - if (m_nCount != icGetSpaceSamples(pProfile->m_Header.colorSpace)) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of colorants.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 4977,4983 **** - icUInt32Number i, nLen, nMaxLen=0; - icFloatNumber Lab[3]; - -! sprintf(buf, "BEGIN_COLORANTS %u\r\n", m_nCount); - sDescription += buf; - - for (i=0; i<m_nCount; i++) { ---- 4977,4983 ---- - icUInt32Number i, nLen, nMaxLen=0; - icFloatNumber Lab[3]; - -! sprintf(buf, "BEGIN_COLORANTS %u\n", m_nCount); - sDescription += buf; - - for (i=0; i<m_nCount; i++) { -*************** -*** 4988,4998 **** - sDescription += "# NAME "; - - if (m_PCS == icSigXYZData) { -! sprintf(buf, "XYZ_X XYZ_Y XYZ_Z\r\n"); - sDescription += buf; - } - else { -! sprintf(buf, "Lab_L Lab_a Lab_b\r\n"); - sDescription += buf; - } - for (i=0; i<m_nCount; i++) { ---- 4988,4998 ---- - sDescription += "# NAME "; - - if (m_PCS == icSigXYZData) { -! sprintf(buf, "XYZ_X XYZ_Y XYZ_Z\n"); - sDescription += buf; - } - else { -! sprintf(buf, "Lab_L Lab_a Lab_b\n"); - sDescription += buf; - } - for (i=0; i<m_nCount; i++) { -*************** -*** 5003,5009 **** - sDescription += buf; - - if (m_PCS == icSigXYZData) { -! sprintf(buf, "%7.4lf %7.4lf %7.4lf\r\n", icUSFtoD(m_pData[i].data[0]), icUSFtoD(m_pData[i].data[1]), icUSFtoD(m_pData[i].data[2])); - sDescription += buf; - } - else { ---- 5003,5009 ---- - sDescription += buf; - - if (m_PCS == icSigXYZData) { -! sprintf(buf, "%7.4lf %7.4lf %7.4lf\n", icUSFtoD(m_pData[i].data[0]), icUSFtoD(m_pData[i].data[1]), icUSFtoD(m_pData[i].data[2])); - sDescription += buf; - } - else { -*************** -*** 5011,5017 **** - Lab[1] = icU16toF(m_pData[i].data[1]); - Lab[2] = icU16toF(m_pData[i].data[2]); - icLabFromPcs(Lab); -! sprintf(buf, "%7.4lf %8.4lf %8.4lf\r\n", Lab[0], Lab[1], Lab[2]); - sDescription += buf; - } - } ---- 5011,5017 ---- - Lab[1] = icU16toF(m_pData[i].data[1]); - Lab[2] = icU16toF(m_pData[i].data[2]); - icLabFromPcs(Lab); -! sprintf(buf, "%7.4lf %8.4lf %8.4lf\n", Lab[0], Lab[1], Lab[2]); - sDescription += buf; - } - } -*************** -*** 5066,5072 **** - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } ---- 5066,5072 ---- - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } -*************** -*** 5076,5082 **** - if (pProfile->m_Header.deviceClass!=icSigLinkClass) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Use of this tag is allowed only in DeviceLink Profiles.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } ---- 5076,5082 ---- - if (pProfile->m_Header.deviceClass!=icSigLinkClass) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Use of this tag is allowed only in DeviceLink Profiles.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - } -*************** -*** 5084,5090 **** - if (m_nCount != icGetSpaceSamples(pProfile->m_Header.colorSpace)) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of colorants.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 5084,5090 ---- - if (m_nCount != icGetSpaceSamples(pProfile->m_Header.colorSpace)) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of colorants.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 5261,5273 **** - icChar buf[128]; - CIccInfo Fmt; - -! sprintf(buf, "Illuminant Tristimulus values: X = %.4lf, Y = %.4lf, Z = %.4lf\r\n", - icFtoD(m_XYZIllum.X), - icFtoD(m_XYZIllum.Y), - icFtoD(m_XYZIllum.Z)); - sDescription += buf; - -! sprintf(buf, "Surround Tristimulus values: X = %.4lf, Y = %.4lf, Z = %.4lf\r\n", - icFtoD(m_XYZSurround.X), - icFtoD(m_XYZSurround.Y), - icFtoD(m_XYZSurround.Z)); ---- 5261,5273 ---- - icChar buf[128]; - CIccInfo Fmt; - -! sprintf(buf, "Illuminant Tristimulus values: X = %.4lf, Y = %.4lf, Z = %.4lf\n", - icFtoD(m_XYZIllum.X), - icFtoD(m_XYZIllum.Y), - icFtoD(m_XYZIllum.Z)); - sDescription += buf; - -! sprintf(buf, "Surround Tristimulus values: X = %.4lf, Y = %.4lf, Z = %.4lf\n", - icFtoD(m_XYZSurround.X), - icFtoD(m_XYZSurround.Y), - icFtoD(m_XYZSurround.Z)); -*************** -*** 5276,5282 **** - sDescription += "Illuminant Type: "; - - sDescription += Fmt.GetIlluminantName(m_illumType); -! sDescription += "\r\n"; - - } - ---- 5276,5282 ---- - sDescription += "Illuminant Type: "; - - sDescription += Fmt.GetIlluminantName(m_illumType); -! sDescription += "\n"; - - } - -*************** -*** 5800,5831 **** - icChar buf[128], buf2[28]; - icUInt32Number count=0; - -! sprintf(buf, "Number of Profile Description Structures: %u\r\n", m_Descriptions->size()); - sDescription += buf; - - for (i=m_Descriptions->begin(); i!=m_Descriptions->end(); i++, count++) { -! sDescription += "\r\n"; - -! sprintf(buf, "Profile Description Structure Number [%u] follows:\r\n", count+1); - sDescription += buf; - -! sprintf(buf, "Device Manufacturer Signature: %s\r\n", icGetSig(buf2, i->m_deviceMfg, false)); - sDescription += buf; - -! sprintf(buf, "Device Model Signature: %s\r\n", icGetSig(buf2, i->m_deviceModel, false)); - sDescription += buf; - -! sprintf(buf, "Device Attributes: %08x%08x\r\n", (icUInt32Number)(i->m_attributes >> 32), (icUInt32Number)(i->m_attributes)); - sDescription += buf; - -! sprintf(buf, "Device Technology Signature: %s\r\n", icGetSig(buf2, i->m_technology, false)); - sDescription += buf; - -! sprintf(buf, "Description of device manufacturer: \r\n"); - sDescription += buf; - i->m_deviceMfgDesc.Describe(sDescription); - -! sprintf(buf, "Description of device model: \r\n"); - sDescription += buf; - i->m_deviceModelDesc.Describe(sDescription); - } ---- 5800,5831 ---- - icChar buf[128], buf2[28]; - icUInt32Number count=0; - -! sprintf(buf, "Number of Profile Description Structures: %u\n", m_Descriptions->size()); - sDescription += buf; - - for (i=m_Descriptions->begin(); i!=m_Descriptions->end(); i++, count++) { -! sDescription += "\n"; - -! sprintf(buf, "Profile Description Structure Number [%u] follows:\n", count+1); - sDescription += buf; - -! sprintf(buf, "Device Manufacturer Signature: %s\n", icGetSig(buf2, i->m_deviceMfg, false)); - sDescription += buf; - -! sprintf(buf, "Device Model Signature: %s\n", icGetSig(buf2, i->m_deviceModel, false)); - sDescription += buf; - -! sprintf(buf, "Device Attributes: %08x%08x\n", (icUInt32Number)(i->m_attributes >> 32), (icUInt32Number)(i->m_attributes)); - sDescription += buf; - -! sprintf(buf, "Device Technology Signature: %s\n", icGetSig(buf2, i->m_technology, false)); - sDescription += buf; - -! sprintf(buf, "Description of device manufacturer: \n"); - sDescription += buf; - i->m_deviceMfgDesc.Describe(sDescription); - -! sprintf(buf, "Description of device model: \n"); - sDescription += buf; - i->m_deviceModelDesc.Describe(sDescription); - } -*************** -*** 5886,5892 **** - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Technology.\r\n", Info.GetSigName(i->m_technology)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 5886,5892 ---- - { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sprintf(buf, " - %s: Unknown Technology.\n", Info.GetSigName(i->m_technology)); - sReport += buf; - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 5896,5902 **** - sReport += icValidateNonCompliantMsg; - sReport += sSigName; - -! sReport += " Contains non-aligned deviceMfgDesc text tag information\r\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 5896,5902 ---- - sReport += icValidateNonCompliantMsg; - sReport += sSigName; - -! sReport += " Contains non-aligned deviceMfgDesc text tag information\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 5905,5911 **** - sReport += icValidateNonCompliantMsg; - sReport += sSigName; - -! sReport += " Contains non-aligned deviceModelDesc text tag information\r\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 5905,5911 ---- - sReport += icValidateNonCompliantMsg; - sReport += sSigName; - -! sReport += " Contains non-aligned deviceModelDesc text tag information\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 6174,6198 **** - CIccResponse16List::iterator j; - - sDescription += "Measurement Unit: "; -! sDescription += Fmt.GetMeasurementUnit((icSignature)GetMeasurementType()); sDescription += "\r\n"; - - - for (int i=0; i<m_nChannels; i++) { - nResponseList = m_Response16ListArray[i]; - -! sDescription += "\r\n"; -! sprintf(buf, "Maximum Colorant XYZ Measurement for Channel-%u : X=%.4lf, Y=%.4lf, Z=%.4lf\r\n", i+1, - icFtoD(m_maxColorantXYZ[i].X), icFtoD(m_maxColorantXYZ[i].Y), icFtoD(m_maxColorantXYZ[i].Z)); - sDescription += buf; - -! sprintf(buf, "Number of Measurements for Channel-%u : %u\r\n", i+1, nResponseList.size()); - sDescription += buf; - -! sprintf(buf, "Measurement Data for Channel-%u follows:\r\n", i+1); - sDescription += buf; - - for (j=nResponseList.begin(); j!=nResponseList.end(); j++) { -! sprintf(buf, "Device Value= %u : Measurement Value= %.4lf\r\n", j->deviceCode, icFtoD(j->measurementValue)); - sDescription += buf; - } - } ---- 6174,6198 ---- - CIccResponse16List::iterator j; - - sDescription += "Measurement Unit: "; -! sDescription += Fmt.GetMeasurementUnit((icSignature)GetMeasurementType()); sDescription += "\n"; - - - for (int i=0; i<m_nChannels; i++) { - nResponseList = m_Response16ListArray[i]; - -! sDescription += "\n"; -! sprintf(buf, "Maximum Colorant XYZ Measurement for Channel-%u : X=%.4lf, Y=%.4lf, Z=%.4lf\n", i+1, - icFtoD(m_maxColorantXYZ[i].X), icFtoD(m_maxColorantXYZ[i].Y), icFtoD(m_maxColorantXYZ[i].Z)); - sDescription += buf; - -! sprintf(buf, "Number of Measurements for Channel-%u : %u\n", i+1, nResponseList.size()); - sDescription += buf; - -! sprintf(buf, "Measurement Data for Channel-%u follows:\n", i+1); - sDescription += buf; - - for (j=nResponseList.begin(); j!=nResponseList.end(); j++) { -! sprintf(buf, "Device Value= %u : Measurement Value= %.4lf\n", j->deviceCode, icFtoD(j->measurementValue)); - sDescription += buf; - } - } -*************** -*** 6234,6240 **** - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Unknown measurement unit signature.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 6234,6240 ---- - default: - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Unknown measurement unit signature.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 6241,6247 **** - if (!m_nChannels) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of channels.\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - return rv; - } ---- 6241,6247 ---- - if (!m_nChannels) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Incorrect number of channels.\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - return rv; - } -*************** -*** 6479,6495 **** - CIccResponseCurveSet::iterator i; - icChar buf[128]; - -! sprintf(buf, "Number of Channels: %u\r\n", m_nChannels); - sDescription += buf; - -! sprintf(buf, "Number of Measurement Types used: %u\r\n", m_ResponseCurves->size()); - sDescription += buf; - - int count = 0; - for (i=m_ResponseCurves->begin(); i!=m_ResponseCurves->end(); i++, count++) { -! sDescription += "\r\n"; - -! sprintf(buf, "Response Curve for measurement type [%u] follows:\r\n", count+1); - sDescription += buf; - - i->Describe(sDescription); ---- 6479,6495 ---- - CIccResponseCurveSet::iterator i; - icChar buf[128]; - -! sprintf(buf, "Number of Channels: %u\n", m_nChannels); - sDescription += buf; - -! sprintf(buf, "Number of Measurement Types used: %u\n", m_ResponseCurves->size()); - sDescription += buf; - - int count = 0; - for (i=m_ResponseCurves->begin(); i!=m_ResponseCurves->end(); i++, count++) { -! sDescription += "\n"; - -! sprintf(buf, "Response Curve for measurement type [%u] follows:\n", count+1); - sDescription += buf; - - i->Describe(sDescription); -*************** -*** 6658,6664 **** - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } ---- 6658,6664 ---- - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } -*************** -*** 6666,6678 **** - if (m_nChannels!=icGetSpaceSamples(pProfile->m_Header.colorSpace)) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Incorrect number of channels.\r\n"; - } - - if (!GetNumResponseCurveTypes()) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty Tag!.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - else { ---- 6666,6678 ---- - if (m_nChannels!=icGetSpaceSamples(pProfile->m_Header.colorSpace)) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Incorrect number of channels.\n"; - } - - if (!GetNumResponseCurveTypes()) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Empty Tag!.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - else { -*** misc/SampleICC-1.3.2/IccProfLib/IccTagLut.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagLut.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 323,345 **** - icChar buf[128], *ptr; - - if (!m_nSize) { -! sprintf(buf, "BEGIN_CURVE In_Out\r\n"); - sDescription += buf; -! sDescription += "Y = X\r\n"; - } - else if (m_nSize==1) { - icFloatNumber dGamma = (icFloatNumber)(m_Curve[0] * 256.0); -! sprintf(buf, "BEGIN_CURVE In_Out\r\n"); - sDescription += buf; -! sprintf(buf, "Y = X ^ %.4lf\r\n", dGamma); - sDescription += buf; - } - else { - int i; - -! sprintf(buf, "BEGIN_LUT In_Out 1 1\r\n"); - sDescription += buf; -! sDescription += "IN OUT\r\n"; - - for (i=0; i<(int)m_nSize; i++) { - ptr = buf; ---- 323,345 ---- - icChar buf[128], *ptr; - - if (!m_nSize) { -! sprintf(buf, "BEGIN_CURVE In_Out\n"); - sDescription += buf; -! sDescription += "Y = X\n"; - } - else if (m_nSize==1) { - icFloatNumber dGamma = (icFloatNumber)(m_Curve[0] * 256.0); -! sprintf(buf, "BEGIN_CURVE In_Out\n"); - sDescription += buf; -! sprintf(buf, "Y = X ^ %.4lf\n", dGamma); - sDescription += buf; - } - else { - int i; - -! sprintf(buf, "BEGIN_LUT In_Out 1 1\n"); - sDescription += buf; -! sDescription += "IN OUT\n"; - - for (i=0; i<(int)m_nSize; i++) { - ptr = buf; -*************** -*** 354,365 **** - - ptr += strlen(ptr); - -! strcpy(ptr, "\r\n"); - - sDescription += buf; - } - } -! sDescription += "\r\n"; - } - - ---- 354,365 ---- - - ptr += strlen(ptr); - -! strcpy(ptr, "\n"); - - sDescription += buf; - } - } -! sDescription += "\n"; - } - - -*************** -*** 383,405 **** - icChar buf[128], *ptr; - - if (!m_nSize) { -! sprintf(buf, "BEGIN_CURVE %s\r\n", szName); - sDescription += buf; -! sDescription += "Y = X\r\n"; - } - else if (m_nSize==1) { - icFloatNumber dGamma = (icFloatNumber)(m_Curve[0] * 256.0); -! sprintf(buf, "BEGIN_CURVE %s\r\n", szName); - sDescription += buf; -! sprintf(buf, "Y = X ^ %.4lf\r\n", dGamma); - sDescription += buf; - } - else { - int i; - -! sprintf(buf, "BEGIN_LUT %s 1 1\r\n", szName); - sDescription += buf; -! sDescription += "IN OUT\r\n"; - - sDescription.reserve(sDescription.size() + m_nSize * 20); - ---- 383,405 ---- - icChar buf[128], *ptr; - - if (!m_nSize) { -! sprintf(buf, "BEGIN_CURVE %s\n", szName); - sDescription += buf; -! sDescription += "Y = X\n"; - } - else if (m_nSize==1) { - icFloatNumber dGamma = (icFloatNumber)(m_Curve[0] * 256.0); -! sprintf(buf, "BEGIN_CURVE %s\n", szName); - sDescription += buf; -! sprintf(buf, "Y = X ^ %.4lf\n", dGamma); - sDescription += buf; - } - else { - int i; - -! sprintf(buf, "BEGIN_LUT %s 1 1\n", szName); - sDescription += buf; -! sDescription += "IN OUT\n"; - - sDescription.reserve(sDescription.size() + m_nSize * 20); - -*************** -*** 416,427 **** - - ptr += strlen(ptr); - -! strcpy(ptr, "\r\n"); - - sDescription += buf; - } - } -! sDescription += "\r\n"; - } - - ---- 416,427 ---- - - ptr += strlen(ptr); - -! strcpy(ptr, "\n"); - - sDescription += buf; - } - } -! sDescription += "\n"; - } - - -*************** -*** 614,620 **** - if (m_Curve[0]>0.0 || m_Curve[m_nSize-1]<1.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Curve cannot be accurately inverted.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } ---- 614,620 ---- - if (m_Curve[0]>0.0 || m_Curve[m_nSize-1]<1.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Curve cannot be accurately inverted.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } -*************** -*** 822,877 **** - { - icChar buf[128]; - -! sprintf(buf, "FunctionType: %04Xh\r\n", m_nFunctionType); - sDescription += buf; - - switch(m_nFunctionType) { - case 0x0000: -! sprintf(buf, "Y = X ^ %.4lf\r\n", icFtoD(m_Param[0])); - sDescription += buf; - return; - - case 0x0001: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf when (X >= %.4lf / %.4lf)\r\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - -! sprintf(buf, "Y = 0 when (X < %.4lf / %.4lf)\r\n", - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - return; - - case 0x0002: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf + %.4lf when (X >= %.4lf / %.4lf)\r\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - icFtoD(m_Param[3]), - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - -! sprintf(buf, "Y = %.4lf when (X < %.4lf / %.4lf)\r\n", icFtoD(m_Param[3]), - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - return; - - case 0x0003: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf when (X >= %.4lf)\r\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - icFtoD(m_Param[4])); - sDescription += buf; - -! sprintf(buf, "Y = %lf * X when (X < %.4lf)\r\n", - icFtoD(m_Param[3]), icFtoD(m_Param[4])); - sDescription += buf; - return; - - case 0x0004: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf + %.4lf when (X >= %.4lf)\r\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - icFtoD(m_Param[5]), icFtoD(m_Param[4])); - sDescription += buf; - -! sprintf(buf, "Y = %lf * X + %.4lf when (X < %.4lf)\r\n", - icFtoD(m_Param[3]), icFtoD(m_Param[6]), icFtoD(m_Param[4])); - sDescription += buf; - return; ---- 822,877 ---- - { - icChar buf[128]; - -! sprintf(buf, "FunctionType: %04Xh\n", m_nFunctionType); - sDescription += buf; - - switch(m_nFunctionType) { - case 0x0000: -! sprintf(buf, "Y = X ^ %.4lf\n", icFtoD(m_Param[0])); - sDescription += buf; - return; - - case 0x0001: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf when (X >= %.4lf / %.4lf)\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - -! sprintf(buf, "Y = 0 when (X < %.4lf / %.4lf)\n", - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - return; - - case 0x0002: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf + %.4lf when (X >= %.4lf / %.4lf)\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - icFtoD(m_Param[3]), - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - -! sprintf(buf, "Y = %.4lf when (X < %.4lf / %.4lf)\n", icFtoD(m_Param[3]), - -icFtoD(m_Param[2]), icFtoD(m_Param[1])); - sDescription += buf; - return; - - case 0x0003: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf when (X >= %.4lf)\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - icFtoD(m_Param[4])); - sDescription += buf; - -! sprintf(buf, "Y = %lf * X when (X < %.4lf)\n", - icFtoD(m_Param[3]), icFtoD(m_Param[4])); - sDescription += buf; - return; - - case 0x0004: -! sprintf(buf, "Y = (%.4lf * X + %.4lf) ^ %.4lf + %.4lf when (X >= %.4lf)\n", - icFtoD(m_Param[1]), icFtoD(m_Param[2]), icFtoD(m_Param[0]), - icFtoD(m_Param[5]), icFtoD(m_Param[4])); - sDescription += buf; - -! sprintf(buf, "Y = %lf * X + %.4lf when (X < %.4lf)\n", - icFtoD(m_Param[3]), icFtoD(m_Param[6]), icFtoD(m_Param[4])); - sDescription += buf; - return; -*************** -*** 878,888 **** - - default: - int i; -! sprintf(buf, "Unknown Function with %d parameters:\r\n"); - sDescription += buf; - - for (i=0; i<m_nNumParam; i++) { -! sprintf(buf, "Param[%d] = %.4lf\r\n", i, icFtoD(m_Param[i])); - sDescription += buf; - } - } ---- 878,888 ---- - - default: - int i; -! sprintf(buf, "Unknown Function with %d parameters:\n", m_nNumParam); - sDescription += buf; - - for (i=0; i<m_nNumParam; i++) { -! sprintf(buf, "Param[%d] = %.4lf\n", i, icFtoD(m_Param[i])); - sDescription += buf; - } - } -*************** -*** 907,916 **** - { - icChar buf[128]; - -! sprintf(buf, "BEGIN_CURVE %s\r\n", szName); - sDescription += buf; - Describe(sDescription); -! sDescription += "\r\n"; - } - - ---- 907,916 ---- - { - icChar buf[128]; - -! sprintf(buf, "BEGIN_CURVE %s\n", szName); - sDescription += buf; - Describe(sDescription); -! sDescription += "\n"; - } - - -*************** -*** 1106,1112 **** - if (m_nReserved2!=0) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Reserved Value must be zero.\r\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 1106,1112 ---- - if (m_nReserved2!=0) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Reserved Value must be zero.\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 1116,1122 **** - if (m_nNumParam!=1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1116,1122 ---- - if (m_nNumParam!=1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1125,1131 **** - if (m_nNumParam!=3) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1125,1131 ---- - if (m_nNumParam!=3) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1134,1140 **** - if (m_nNumParam!=4) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1134,1140 ---- - if (m_nNumParam!=4) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1143,1149 **** - if (m_nNumParam!=5) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1143,1149 ---- - if (m_nNumParam!=5) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1152,1158 **** - if (m_nNumParam!=7) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; ---- 1152,1158 ---- - if (m_nNumParam!=7) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Number of parameters inconsistent with function type.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - break; -*************** -*** 1160,1166 **** - default: - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Unknown function type.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 1160,1166 ---- - default: - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Unknown function type.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 1170,1176 **** - if (lval>0.0 || uval<1.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Curve cannot be accurately inverted.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } ---- 1170,1176 ---- - if (lval>0.0 || uval<1.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Curve cannot be accurately inverted.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } -*************** -*** 1255,1286 **** - { - icChar buf[128]; - -! sprintf(buf, "BEGIN_MATRIX %s\r\n", szName); - sDescription += buf; - - if (!m_bUseConstants) { -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\r\n", - m_e[0], m_e[1], m_e[2]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\r\n", - m_e[3], m_e[4], m_e[5]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\r\n", - m_e[6], m_e[7], m_e[8]); - sDescription += buf; - } - else { -! sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\r\n", - m_e[0], m_e[1], m_e[2], m_e[9]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\r\n", - m_e[3], m_e[4], m_e[5], m_e[10]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\r\n", - m_e[6], m_e[7], m_e[8], m_e[11]); - sDescription += buf; - } -! sDescription += "\r\n"; - } - - /** ---- 1255,1286 ---- - { - icChar buf[128]; - -! sprintf(buf, "BEGIN_MATRIX %s\n", szName); - sDescription += buf; - - if (!m_bUseConstants) { -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\n", - m_e[0], m_e[1], m_e[2]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\n", - m_e[3], m_e[4], m_e[5]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\n", - m_e[6], m_e[7], m_e[8]); - sDescription += buf; - } - else { -! sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\n", - m_e[0], m_e[1], m_e[2], m_e[9]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\n", - m_e[3], m_e[4], m_e[5], m_e[10]); - sDescription += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf + %8.4lf\n", - m_e[6], m_e[7], m_e[8], m_e[11]); - sDescription += buf; - } -! sDescription += "\n"; - } - - /** -*************** -*** 1377,1383 **** - if (m_e[0]!=1.0 || m_e[4]!=1.0 || m_e[9]!=1.0 || sum!=3.0) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Matrix must be identity.\r\n"; - rv = icValidateNonCompliant; - } - } ---- 1377,1383 ---- - if (m_e[0]!=1.0 || m_e[4]!=1.0 || m_e[9]!=1.0 || sum!=3.0) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Matrix must be identity.\n"; - rv = icValidateNonCompliant; - } - } -*************** -*** 1754,1760 **** - - ptr += sprintf(ptr, " %s", m_pVal); - } -! strcpy(ptr, "\r\n"); - sDescription += (const icChar*)m_pOutText; - - } ---- 1754,1760 ---- - - ptr += sprintf(ptr, " %s", m_pVal); - } -! strcpy(ptr, "\n"); - sDescription += (const icChar*)m_pOutText; - - } -*************** -*** 1866,1872 **** - icChar szOutText[2048], szColor[40]; - int i, len; - -! sprintf(szOutText, "BEGIN_LUT %s %d %d\r\n", szName, m_nInput, m_nOutput); - sDescription += szOutText; - - for (i=0; i<m_nInput; i++) { ---- 1866,1872 ---- - icChar szOutText[2048], szColor[40]; - int i, len; - -! sprintf(szOutText, "BEGIN_LUT %s %d %d\n", szName, m_nInput, m_nOutput); - sDescription += szOutText; - - for (i=0; i<m_nInput; i++) { -*************** -*** 1883,1889 **** - sDescription += szOutText; - } - -! sDescription += "\r\n"; - - len = 0; - for (i=0; i<m_nInput; i++) { ---- 1883,1889 ---- - sDescription += szOutText; - } - -! sDescription += "\n"; - - len = 0; - for (i=0; i<m_nInput; i++) { -*************** -*** 1907,1913 **** - - Iterate(sDescription, 0, 0); - -! sDescription += "\r\n"; - } - - ---- 1907,1913 ---- - - Iterate(sDescription, 0, 0); - -! sDescription += "\n"; - } - - -*************** -*** 2693,2699 **** - if (m_nReserved2[0]!=0 || m_nReserved2[1]!=0 || m_nReserved2[2]!=0) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Reserved Value must be zero.\r\n"; - - rv = icValidateNonCompliant; - } ---- 2693,2699 ---- - if (m_nReserved2[0]!=0 || m_nReserved2[1]!=0 || m_nReserved2[2]!=0) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - Reserved Value must be zero.\n"; - - rv = icValidateNonCompliant; - } -*************** -*** 2704,2710 **** - if (m_GridPoints[i]<2) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sprintf(temp, " - CLUT: At least 2 grid points should be present in dimension %u.\r\n",i ); - sReport += temp; - rv = icMaxStatus(rv, icValidateCriticalError); - } ---- 2704,2710 ---- - if (m_GridPoints[i]<2) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sprintf(temp, " - CLUT: At least 2 grid points should be present in dimension %u.\n",i ); - sReport += temp; - rv = icMaxStatus(rv, icValidateCriticalError); - } -*************** -*** 3122,3128 **** - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } ---- 3122,3128 ---- - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n"; - rv = icMaxStatus(rv, icValidateWarning); - return rv; - } -*************** -*** 3138,3144 **** - if (m_nInput!=nInput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of input channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3138,3144 ---- - if (m_nInput!=nInput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of input channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3146,3152 **** - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3146,3152 ---- - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3160,3166 **** - if (m_nInput!=nInput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of input channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3160,3166 ---- - if (m_nInput!=nInput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of input channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3168,3174 **** - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3168,3174 ---- - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3180,3186 **** - if (m_nInput!=nInput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of input channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3180,3186 ---- - if (m_nInput!=nInput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of input channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3188,3194 **** - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3188,3194 ---- - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3206,3212 **** - if (!m_CLUT) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - CLUT must be present.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3206,3212 ---- - if (!m_CLUT) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - CLUT must be present.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 3748,3754 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3748,3754 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 3762,3768 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of M-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3762,3768 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of M-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 3772,3778 **** - if (!m_CLUT) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - CLUT must be present if using A-curves.\r\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 3772,3778 ---- - if (!m_CLUT) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - CLUT must be present if using A-curves.\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 3784,3790 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3784,3790 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 3876,3882 **** - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - return rv; - } ---- 3876,3882 ---- - if (!pProfile) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Tag validation incomplete: Pointer to profile unavailable.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - return rv; - } -*************** -*** 3900,3906 **** - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - ---- 3900,3906 ---- - if (m_nOutput!=nOutput) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of output channels.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - -*************** -*** 3913,3919 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3913,3919 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 3927,3933 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of M-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3927,3933 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of M-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 3937,3943 **** - if (!m_CLUT) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - CLUT must be present if using A-curves.\r\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } ---- 3937,3943 ---- - if (!m_CLUT) { - sReport += icValidateNonCompliantMsg; - sReport += sSigName; -! sReport += " - CLUT must be present if using A-curves.\n"; - - rv = icMaxStatus(rv, icValidateNonCompliant); - } -*************** -*** 3949,3955 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 3949,3955 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4311,4317 **** - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut8Tags do not support single entry gamma curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4311,4317 ---- - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut8Tags do not support single entry gamma curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4319,4325 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4319,4325 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4336,4342 **** - if (m_XYZMatrix[0]!=1.0 || m_XYZMatrix[4]!=1.0 || m_XYZMatrix[9]!=1.0 || sum!=3.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Matrix must be identity.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } ---- 4336,4342 ---- - if (m_XYZMatrix[0]!=1.0 || m_XYZMatrix[4]!=1.0 || m_XYZMatrix[9]!=1.0 || sum!=3.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Matrix must be identity.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } -*************** -*** 4351,4357 **** - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut8Tags do not support single entry gamma curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4351,4357 ---- - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut8Tags do not support single entry gamma curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4359,4365 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4359,4365 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4721,4727 **** - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut16Tags do not support single entry gamma curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4721,4727 ---- - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut16Tags do not support single entry gamma curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4729,4735 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4729,4735 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of B-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4746,4752 **** - if (m_XYZMatrix[0]!=1.0 || m_XYZMatrix[4]!=1.0 || m_XYZMatrix[9]!=1.0 || sum!=3.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Matrix must be identity.\r\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } ---- 4746,4752 ---- - if (m_XYZMatrix[0]!=1.0 || m_XYZMatrix[4]!=1.0 || m_XYZMatrix[9]!=1.0 || sum!=3.0) { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " - Matrix must be identity.\n"; - rv = icMaxStatus(rv, icValidateWarning); - } - } -*************** -*** 4761,4767 **** - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut16Tags do not support single entry gamma curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4761,4767 ---- - if (pTagCurve->GetSize()==1) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - lut16Tags do not support single entry gamma curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*************** -*** 4769,4775 **** - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\r\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } ---- 4769,4775 ---- - else { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " - Incorrect number of A-curves.\n"; - rv = icMaxStatus(rv, icValidateCriticalError); - } - } -*** misc/SampleICC-1.3.2/IccProfLib/IccTagMPE.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagMPE.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 218,224 **** - icGetSig(sigbuf, m_sig), m_nSize); - sDescription += buf; - -! sDescription += "\r\n\r\nData Follows:\r\n"; - - icMemDump(sDescription, m_pData, m_nSize); - ---- 218,224 ---- - icGetSig(sigbuf, m_sig), m_nSize); - sDescription += buf; - -! sDescription += "\n\nData Follows:\n"; - - icMemDump(sDescription, m_pData, m_nSize); - -*************** -*** 364,370 **** - sReport += " - Contains unknown processing element type ("; - icGetSig(buf, m_sig, true); - sReport += buf; -! sReport += ").\r\n"; - - return icValidateCriticalError; - } ---- 364,370 ---- - sReport += " - Contains unknown processing element type ("; - icGetSig(buf, m_sig, true); - sReport += buf; -! sReport += ").\n"; - - return icValidateCriticalError; - } -*************** -*** 392,398 **** - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " - Reserved Value must be zero.\r\n"; - - rv = icValidateNonCompliant; - } ---- 392,398 ---- - sReport += " - Element "; - sSigName = Info.GetSigName(GetType()); - sReport += sSigName; -! sReport += " - Reserved Value must be zero.\n"; - - rv = icValidateNonCompliant; - } -*************** -*** 738,755 **** - { - icChar buf[128]; - -! sprintf(buf, "BEGIN MULTI_PROCESS_ELEMENT_TAG %d %d\r\n", m_nInputChannels, m_nOutputChannels); - sDescription += buf; -! sDescription += "\r\n"; - - CIccMultiProcessElementList::iterator i; - int j; - - for (j=0, i=m_list->begin(); i!=m_list->end(); j++, i++) { -! sprintf(buf, "PROCESS_ELEMENT #%d\r\n", j+1); - sDescription += buf; - i->ptr->Describe(sDescription); -! sDescription += "\r\n"; - } - } - ---- 738,755 ---- - { - icChar buf[128]; - -! sprintf(buf, "BEGIN MULTI_PROCESS_ELEMENT_TAG %d %d\n", m_nInputChannels, m_nOutputChannels); - sDescription += buf; -! sDescription += "\n"; - - CIccMultiProcessElementList::iterator i; - int j; - - for (j=0, i=m_list->begin(); i!=m_list->end(); j++, i++) { -! sprintf(buf, "PROCESS_ELEMENT #%d\n", j+1); - sDescription += buf; - i->ptr->Describe(sDescription); -! sDescription += "\n"; - } - } - -*************** -*** 1207,1219 **** - if (m_nInputChannels != m_nOutputChannels) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " No processing elements and input and output channels do not match!\r\n"; - return icValidateCriticalError; - } - else { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " No processing elements.\r\n"; - return icValidateWarning; - } - } ---- 1207,1219 ---- - if (m_nInputChannels != m_nOutputChannels) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " No processing elements and input and output channels do not match!\n"; - return icValidateCriticalError; - } - else { - sReport += icValidateWarningMsg; - sReport += sSigName; -! sReport += " No processing elements.\n"; - return icValidateWarning; - } - } -*************** -*** 1224,1230 **** - if (i->ptr->NumInputChannels() != m_nInputChannels) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " Mis-matching number of input channels!\r\n"; - return icValidateCriticalError; - } - ---- 1224,1230 ---- - if (i->ptr->NumInputChannels() != m_nInputChannels) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " Mis-matching number of input channels!\n"; - return icValidateCriticalError; - } - -*************** -*** 1239,1245 **** - sReport += "->"; - sReport += i->ptr->GetClassName(); - -! sReport += " Mis-matching number of channels!\r\n"; - return icValidateCriticalError; - } - } ---- 1239,1245 ---- - sReport += "->"; - sReport += i->ptr->GetClassName(); - -! sReport += " Mis-matching number of channels!\n"; - return icValidateCriticalError; - } - } -*************** -*** 1251,1257 **** - if (last && last->NumOutputChannels() != m_nOutputChannels) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " Mis-matching number of output channels!\r\n"; - return icValidateCriticalError; - } - ---- 1251,1257 ---- - if (last && last->NumOutputChannels() != m_nOutputChannels) { - sReport += icValidateCriticalErrorMsg; - sReport += sSigName; -! sReport += " Mis-matching number of output channels!\n"; - return icValidateCriticalError; - } - -*** misc/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 234,240 **** - { - std::string Dump; - -! sDescription += "ProfileID:\r\n"; - - int i; - char buf[20]; ---- 234,240 ---- - { - std::string Dump; - -! sDescription += "ProfileID:\n"; - - int i; - char buf[20]; -*************** -*** 244,255 **** - sprintf(buf, "%2x", m_profileID.ID8[i]); - sDescription += buf; - } -! sDescription += "\r\n"; - -! sDescription += "Description:\r\n"; - m_desc.Describe(sDescription); - -! sDescription += "\r\n"; - } - - ---- 244,255 ---- - sprintf(buf, "%2x", m_profileID.ID8[i]); - sDescription += buf; - } -! sDescription += "\n"; - -! sDescription += "Description:\n"; - m_desc.Describe(sDescription); - -! sDescription += "\n"; - } - - -*************** -*** 434,454 **** - { - icChar buf[128]; - -! sprintf(buf, "BEGIN ProfileSequenceIdentification_TAG\r\n"); - sDescription += buf; -! sDescription += "\r\n"; - - int i; - CIccProfileIdDescList::iterator j; - for (i=0, j=m_list->begin(); j!=m_list->end(); i++, j++) { -! sprintf(buf, "ProfileDescription_%d:\r\n", i+1); - sDescription += buf; - j->Describe(sDescription); - } - -! sprintf(buf, "END ProfileSequenceIdentification_TAG\r\n"); - sDescription += buf; -! sDescription += "\r\n"; - } - - ---- 434,454 ---- - { - icChar buf[128]; - -! sprintf(buf, "BEGIN ProfileSequenceIdentification_TAG\n"); - sDescription += buf; -! sDescription += "\n"; - - int i; - CIccProfileIdDescList::iterator j; - for (i=0, j=m_list->begin(); j!=m_list->end(); i++, j++) { -! sprintf(buf, "ProfileDescription_%d:\n", i+1); - sDescription += buf; - j->Describe(sDescription); - } - -! sprintf(buf, "END ProfileSequenceIdentification_TAG\n"); - sDescription += buf; -! sDescription += "\n"; - } - - -*** misc/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.h Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.h Fri Jan 25 14:23:09 2008 -*************** -*** 161,164 **** - } - #endif - -! #endif //_ICCTAGPROFSEQID_H ---- 161,164 ---- - } - #endif - -! #endif //_ICCTAGPROFSEQID_H -*** misc/SampleICC-1.3.2/IccProfLib/IccUtil.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccUtil.cpp Fri Jan 25 14:23:09 2008 -*************** -*** 79,85 **** - #include "IccUtil.h" - #include "IccTagFactory.h" - #include <stdlib.h> -! #include <memory.h> - #include <ctype.h> - #include <math.h> - #include <string.h> ---- 79,85 ---- - #include "IccUtil.h" - #include "IccTagFactory.h" - #include <stdlib.h> -! #include <memory> - #include <ctype.h> - #include <math.h> - #include <string.h> -*************** -*** 678,688 **** - { - icChar buf[128]; - -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\r\n", icFtoD(pMatrix[0]), icFtoD(pMatrix[1]), icFtoD(pMatrix[2])); - sDump += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\r\n", icFtoD(pMatrix[3]), icFtoD(pMatrix[4]), icFtoD(pMatrix[5])); - sDump += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\r\n", icFtoD(pMatrix[6]), icFtoD(pMatrix[7]), icFtoD(pMatrix[8])); - sDump += buf; - } - ---- 679,689 ---- - { - icChar buf[128]; - -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\n", icFtoD(pMatrix[0]), icFtoD(pMatrix[1]), icFtoD(pMatrix[2])); - sDump += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\n", icFtoD(pMatrix[3]), icFtoD(pMatrix[4]), icFtoD(pMatrix[5])); - sDump += buf; -! sprintf(buf, "%8.4lf %8.4lf %8.4lf\n", icFtoD(pMatrix[6]), icFtoD(pMatrix[7]), icFtoD(pMatrix[8])); - sDump += buf; - } - -*************** -*** 1516,1534 **** - - if (XYZ.X < 0) { - sReport += icValidateNonCompliantMsg; -! sReport += " - XYZNumber: Negative X value!\r\n"; - rv = icValidateNonCompliant; - } - - if (XYZ.Y < 0) { - sReport += icValidateNonCompliantMsg; -! sReport += " - XYZNumber: Negative Y value!\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - - if (XYZ.Z < 0) { - sReport += icValidateNonCompliantMsg; -! sReport += " - XYZNumber: Negative Z value!\r\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - ---- 1517,1535 ---- - - if (XYZ.X < 0) { - sReport += icValidateNonCompliantMsg; -! sReport += " - XYZNumber: Negative X value!\n"; - rv = icValidateNonCompliant; - } - - if (XYZ.Y < 0) { - sReport += icValidateNonCompliantMsg; -! sReport += " - XYZNumber: Negative Y value!\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - - if (XYZ.Z < 0) { - sReport += icValidateNonCompliantMsg; -! sReport += " - XYZNumber: Negative Z value!\n"; - rv = icMaxStatus(rv, icValidateNonCompliant); - } - -*************** -*** 1548,1554 **** - icChar buf[128]; - if (dateTime.year<1992) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid year!\r\n",dateTime.year); - sReport += buf; - rv = icValidateWarning; - } ---- 1549,1555 ---- - icChar buf[128]; - if (dateTime.year<1992) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid year!\n",dateTime.year); - sReport += buf; - rv = icValidateWarning; - } -*************** -*** 1557,1563 **** - if (newtime->tm_mon==11 && newtime->tm_mday==31) { - if (dateTime.year>(year+1)) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid year!\r\n",dateTime.year); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1558,1564 ---- - if (newtime->tm_mon==11 && newtime->tm_mday==31) { - if (dateTime.year>(year+1)) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid year!\n",dateTime.year); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1565,1571 **** - else { - if (dateTime.year>year) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid year!\r\n",dateTime.year); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1566,1572 ---- - else { - if (dateTime.year>year) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid year!\n",dateTime.year); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1573,1579 **** - - if (dateTime.month<1 || dateTime.month>12) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid month!\r\n",dateTime.month); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1574,1580 ---- - - if (dateTime.month<1 || dateTime.month>12) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid month!\n",dateTime.month); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1580,1586 **** - - if (dateTime.day<1 || dateTime.day>31) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid day!\r\n",dateTime.day); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1581,1587 ---- - - if (dateTime.day<1 || dateTime.day>31) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid day!\n",dateTime.day); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1588,1594 **** - if (dateTime.month==2) { - if (dateTime.day>29) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid day for February!\r\n",dateTime.day); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1589,1595 ---- - if (dateTime.month==2) { - if (dateTime.day>29) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid day for February!\n",dateTime.day); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1596,1602 **** - if (dateTime.day==29) { - if ((dateTime.year%4)!=0) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid day for February, year is not a leap year(%u)!\r\n",dateTime.day, dateTime.year); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1597,1603 ---- - if (dateTime.day==29) { - if ((dateTime.year%4)!=0) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid day for February, year is not a leap year(%u)!\n",dateTime.day, dateTime.year); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1605,1611 **** - - if (dateTime.hours>23) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid hour!\r\n",dateTime.hours); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1606,1612 ---- - - if (dateTime.hours>23) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid hour!\n",dateTime.hours); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1612,1618 **** - - if (dateTime.minutes>59) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid minutes!\r\n",dateTime.minutes); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1613,1619 ---- - - if (dateTime.minutes>59) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid minutes!\n",dateTime.minutes); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*************** -*** 1619,1625 **** - - if (dateTime.seconds>59) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid seconds!\r\n",dateTime.hours); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } ---- 1620,1626 ---- - - if (dateTime.seconds>59) { - sReport += icValidateWarningMsg; -! sprintf(buf," - %u: Invalid seconds!\n",dateTime.hours); - sReport += buf; - rv = icMaxStatus(rv, icValidateWarning); - } -*** misc/SampleICC-1.3.2/IccProfLib/icProfileHeader.h Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/icProfileHeader.h Fri Jan 25 14:23:09 2008 -*************** -*** 659,668 **** - typedef enum { - icFlare0 = 0x00000000, /* 0% flare */ - icFlare100 = 0x00000001, /* 100% flare */ - } icMeasurementFlare; - - /** Convenience Enum Definition - Not defined in ICC specification*/ -! #define icMaxEnumFlare ((icMeasurementFlare) 0xFFFFFFFF) - #define icMaxFlare ((icMeasurementFlare) 0xFFFFFFFF) /* as defined by earlier versions */ - - ---- 659,669 ---- - typedef enum { - icFlare0 = 0x00000000, /* 0% flare */ - icFlare100 = 0x00000001, /* 100% flare */ -+ icMaxEnumFlare = 0xFFFFFFFF - } icMeasurementFlare; - - /** Convenience Enum Definition - Not defined in ICC specification*/ -! /*#define icMaxEnumFlare ((icMeasurementFlare) 0xFFFFFFFF)*/ - #define icMaxFlare ((icMeasurementFlare) 0xFFFFFFFF) /* as defined by earlier versions */ - - -*** misc/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Mon Aug 20 22:10:42 2007 ---- misc/build/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Fri Jan 25 14:23:09 2008 -*************** -*** 101,117 **** - am__quote = @am__quote@ - install_sh = @install_sh@ - -! SUBDIRS = IccApplyNamedCmm \ -! @SICC_ICC_APPLY_PROFILES@ \ -! IccDumpProfile \ - IccProfLibTest \ - IccStripUnknownTags \ - IccV4ToMPE - - -! DIST_SUBDIRS = IccApplyNamedCmm \ -! IccApplyProfiles \ -! IccDumpProfile \ - IccProfLibTest \ - IccStripUnknownTags \ - IccV4ToMPE ---- 101,113 ---- - am__quote = @am__quote@ - install_sh = @install_sh@ - -! SUBDIRS = IccDumpProfile \ - IccProfLibTest \ - IccStripUnknownTags \ - IccV4ToMPE - - -! DIST_SUBDIRS = IccDumpProfile \ - IccProfLibTest \ - IccStripUnknownTags \ - IccV4ToMPE -*** misc/SampleICC-1.3.2/Contrib/ICC_utils/CLUT.cpp 2007-08-20 22:04:53.000000000 +0200 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/CLUT.cpp 2008-01-31 13:53:16.000000000 +0100 -*************** -*** 77,82 **** ---- 77,84 ---- - // - ////////////////////////////////////////////////////////////////////// - -+ #include <stdlib.h> -+ #include <string.h> - #include <iostream> - #include <fstream> - #include <sstream> -*** misc/SampleICC-1.3.2/Contrib/ICC_utils/ICC_tool_exception.h 2007-08-20 22:04:54.000000000 +0200 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/ICC_tool_exception.h 2008-01-31 13:54:51.000000000 +0100 -*************** -*** 83,88 **** ---- 83,89 ---- - #ifndef __DEFINED_ICC_TOOL_EXCEPTION_H__ - #define __DEFINED_ICC_TOOL_EXCEPTION_H__ - -+ #include <string.h> - #include <exception> - #include <string> - -*** misc/SampleICC-1.3.2/IccProfLib/IccCmm.cpp 2007-08-20 22:05:00.000000000 +0200 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccCmm.cpp 2008-01-31 13:49:54.000000000 +0100 -*************** -*** 79,84 **** ---- 79,86 ---- - #pragma warning( disable: 4786) //disable warning in <list.h> - #endif - -+ #include <stdlib.h> -+ #include <string.h> - #include "IccCmm.h" - #include "IccTag.h" - #include "IccIO.h" -*** misc/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.h 2007-08-20 22:04:53.000000000 +0200 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.h 2008-01-31 14:05:58.000000000 +0100 -*************** -*** 83,88 **** ---- 83,89 ---- - #include <string> - #include <sys/types.h> - #include <sys/stat.h> -+ #include <stdlib.h> - - #ifdef WIN32 - typedef unsigned short mode_t; diff --git a/icc/SampleICC-1.3.2.patch b/icc/SampleICC-1.3.2.patch index ed072b6..dadce6f 100644 --- a/icc/SampleICC-1.3.2.patch +++ b/icc/SampleICC-1.3.2.patch @@ -1,5 +1,5 @@ *** misc/SampleICC-1.3.2/configure Mon Aug 20 22:10:59 2007 ---- misc/build/SampleICC-1.3.2/configure Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/configure Fri Jan 25 14:23:09 2008 *************** *** 19991,19997 **** @@ -60,7 +60,7 @@ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} *** misc/SampleICC-1.3.2/Contrib/Makefile.in Mon Aug 20 22:10:37 2007 ---- misc/build/SampleICC-1.3.2/Contrib/Makefile.in Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/Contrib/Makefile.in Fri Jan 25 14:23:09 2008 *************** *** 103,120 **** @@ -95,7 +95,7 @@ subdir = Contrib mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs *** misc/SampleICC-1.3.2/Contrib/CmdLine/Makefile.in Mon Aug 20 22:10:34 2007 ---- misc/build/SampleICC-1.3.2/Contrib/CmdLine/Makefile.in Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/Contrib/CmdLine/Makefile.in Fri Jan 25 14:23:09 2008 *************** *** 102,116 **** install_sh = @install_sh@ @@ -126,7 +126,7 @@ subdir = Contrib/CmdLine mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs *** misc/SampleICC-1.3.2/Contrib/ICC_utils/Makefile.in Mon Aug 20 22:10:35 2007 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Makefile.in Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Makefile.in Fri Jan 25 14:23:09 2008 *************** *** 133,139 **** CONFIG_CLEAN_FILES = @@ -145,7 +145,7 @@ ICC_tool_exception.lo Vetters.lo libICC_utils_la_OBJECTS = $(am_libICC_utils_la_OBJECTS) *** misc/SampleICC-1.3.2/Contrib/ICC_utils/Stubs.h Mon Aug 20 22:04:53 2007 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Stubs.h Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Stubs.h Fri Jan 25 14:23:09 2008 *************** *** 130,136 **** @@ -164,7 +164,7 @@ return (r_ != p.r_) ? (r_ < p.r_) : ((g_ != p.g_) ? (g_ < p.g_) : (b_ < p.b_)); } *** misc/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.cpp Mon Aug 20 22:04:54 2007 ---- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.cpp Fri Jan 25 14:49:56 2008 +--- misc/build/SampleICC-1.3.2/Contrib/ICC_utils/Vetters.cpp Fri Jan 25 14:57:06 2008 *************** *** 1,322 **** ! /* @@ -820,7 +820,7 @@ ! } ! } *** misc/SampleICC-1.3.2/IccProfLib/IccIO.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccIO.cpp Fri Jan 25 14:25:33 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccIO.cpp Fri Jan 25 14:23:09 2008 *************** *** 78,84 **** #include "IccIO.h" @@ -838,8 +838,20 @@ #include <string.h> #ifndef __max +*** misc/SampleICC-1.3.2/IccProfLib/IccIO.h Mon Aug 20 22:05:00 2007 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccIO.h Fri Jan 25 14:23:09 2008 +*************** +*** 79,84 **** +--- 79,85 ---- + #define _ICCIO_H + + #include "IccDefs.h" ++ #include "memory" + #include "stdio.h" + + #ifdef USESAMPLEICCNAMESPACE *** misc/SampleICC-1.3.2/IccProfLib/IccMpeACS.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccMpeACS.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccMpeACS.cpp Fri Jan 25 14:23:09 2008 *************** *** 136,152 **** icChar sigBuf[30]; @@ -878,7 +890,7 @@ icMemDump(sDescription, m_pData, m_nDataSize); } *** misc/SampleICC-1.3.2/IccProfLib/IccMpeBasic.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccMpeBasic.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccMpeBasic.cpp Fri Jan 25 14:23:09 2008 *************** *** 218,249 **** sprintf(buf, "%.8f", m_endPoint); @@ -1362,8 +1374,56 @@ return icValidateCriticalError; } +*** misc/SampleICC-1.3.2/IccProfLib/IccProfLibConf.h Mon Aug 20 22:05:00 2007 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccProfLibConf.h Fri Jan 25 14:23:09 2008 +*************** +*** 107,126 **** + + #else // non-PC, perhaps Mac or Linux + +! #define ICCUINT64 unsigned long long +! #define ICCINT64 long long +! #define ICUINT64TYPE unsigned long long +! #define ICINT64TYPE long long +! +! #if defined(__APPLE__) +! #if defined(__LITTLE_ENDIAN__) +! #define ICC_BYTE_ORDER_LITTLE_ENDIAN +! #else +! #define ICC_BYTE_ORDER_BIG_ENDIAN +! #endif +! #else +! #define ICC_BYTE_ORDER_LITTLE_ENDIAN +! #endif + + #define ICCPROFLIB_API + #define ICCPROFLIB_EXTERN +--- 107,129 ---- + + #else // non-PC, perhaps Mac or Linux + +! #include <sal/types.h> +! #include <osl/endian.h> +! +! #define ICCUINT64 sal_uInt64 +! #define ICCINT64 sal_Int64 +! #define ICUINT64TYPE sal_uInt64 +! #define ICINT64TYPE sal_Int64 +! #define ICINT32TYPE sal_Int32 +! #define ICUINT32TYPE sal_uInt32 +! +! #if defined(_LITTLE_ENDIAN) +! # define ICC_BYTE_ORDER_LITTLE_ENDIAN +! #elif defined(_BIG_ENDIAN) +! # define ICC_BYTE_ORDER_BIG_ENDIAN +! #else +! # error "ENDIAN unknown" +! #endif + + #define ICCPROFLIB_API + #define ICCPROFLIB_EXTERN *** misc/SampleICC-1.3.2/IccProfLib/IccProfile.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccProfile.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccProfile.cpp Fri Jan 25 14:23:09 2008 *************** *** 567,573 **** @@ -1989,7 +2049,7 @@ return NULL; } *** misc/SampleICC-1.3.2/IccProfLib/IccTagBasic.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagBasic.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccTagBasic.cpp Fri Jan 25 14:23:09 2008 *************** *** 166,172 **** CIccInfo Info; @@ -3311,7 +3371,7 @@ } else { *** misc/SampleICC-1.3.2/IccProfLib/IccTagLut.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagLut.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccTagLut.cpp Fri Jan 25 14:23:09 2008 *************** *** 323,345 **** icChar buf[128], *ptr; @@ -4443,7 +4503,7 @@ } } *** misc/SampleICC-1.3.2/IccProfLib/IccTagMPE.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagMPE.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccTagMPE.cpp Fri Jan 25 14:23:09 2008 *************** *** 218,224 **** icGetSig(sigbuf, m_sig), m_nSize); @@ -4615,7 +4675,7 @@ } *** misc/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.cpp Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.cpp Fri Jan 25 14:23:09 2008 *************** *** 234,240 **** { @@ -4706,7 +4766,7 @@ *** misc/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.h Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.h Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccTagProfSeqId.h Fri Jan 25 14:23:09 2008 *************** *** 161,164 **** } @@ -4719,7 +4779,7 @@ ! #endif //_ICCTAGPROFSEQID_H *** misc/SampleICC-1.3.2/IccProfLib/IccUtil.cpp Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/IccUtil.cpp Fri Jan 25 14:27:16 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/IccUtil.cpp Fri Jan 25 14:23:09 2008 *************** *** 79,85 **** #include "IccUtil.h" @@ -4974,7 +5034,7 @@ rv = icMaxStatus(rv, icValidateWarning); } *** misc/SampleICC-1.3.2/IccProfLib/icProfileHeader.h Mon Aug 20 22:05:00 2007 ---- misc/build/SampleICC-1.3.2/IccProfLib/icProfileHeader.h Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/IccProfLib/icProfileHeader.h Fri Jan 25 14:23:09 2008 *************** *** 659,668 **** typedef enum { @@ -5000,7 +5060,7 @@ *** misc/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Mon Aug 20 22:10:42 2007 ---- misc/build/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Fri Jan 25 14:24:00 2008 +--- misc/build/SampleICC-1.3.2/Tools/CmdLine/Makefile.in Fri Jan 25 14:23:09 2008 *************** *** 101,117 **** am__quote = @am__quote@ diff --git a/icc/download/SampleICC-1.3.2.tar.gz b/icc/download/SampleICC-1.3.2.tar.gz Binary files differdeleted file mode 100644 index 741eea2..0000000 --- a/icc/download/SampleICC-1.3.2.tar.gz +++ /dev/null diff --git a/icc/makefile.mk b/icc/makefile.mk index 5542db0..87ebf3a 100644 --- a/icc/makefile.mk +++ b/icc/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,12 +37,8 @@ TARGET=icc # --- Files -------------------------------------------------------- TARFILE_NAME=SampleICC-1.3.2 -#checking for endianess -.IF "$(CPU)"=="I" +TARFILE_MD5=fdb27bfe2dbe2e7b57ae194d9bf36bab PATCH_FILES=$(TARFILE_NAME).patch -.ELSE -PATCH_FILES=$(TARFILE_NAME)-bendian.patch -.ENDIF CONVERTFILES= \ IccProfLib$/IccTagProfSeqId.h \ @@ -54,7 +46,7 @@ CONVERTFILES= \ Contrib$/ICC_utils$/Stubs.h \ Contrib$/ICC_utils$/Vetters.cpp -CONFIGURE_ACTION= $(GNUCOPY) -r $(BACK_PATH)..$/source$/create_sRGB_profile Contrib$/CmdLine && unzip $(BACK_PATH)..$/makefiles.zip +CONFIGURE_ACTION= $(GNUCOPY) -r $(BACK_PATH)..$/source$/create_sRGB_profile Contrib$/CmdLine && unzip -o $(BACK_PATH)..$/makefiles.zip BUILD_ACTION=dmake && cd Contrib$/CmdLine$/create_sRGB_profile && $(AUGMENT_LIBRARY_PATH) .$/create_sRGB_profile # --- Targets ------------------------------------------------------ diff --git a/icc/prj/build.lst b/icc/prj/build.lst index 7ce035b..9eace5d 100644 --- a/icc/prj/build.lst +++ b/icc/prj/build.lst @@ -1,3 +1,3 @@ -ip icc : solenv external NULL +ip icc : solenv stlport external sal NULL ip icc usr1 - all ip_mkout NULL ip icc nmake - all ip_icc NULL diff --git a/icc/source/create_sRGB_profile/create_sRGB_profile.cpp b/icc/source/create_sRGB_profile/create_sRGB_profile.cpp index a75c676..20a8c7c 100644 --- a/icc/source/create_sRGB_profile/create_sRGB_profile.cpp +++ b/icc/source/create_sRGB_profile/create_sRGB_profile.cpp @@ -2,11 +2,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: create_sRGB_profile.cpp,v $ - * - * $Revision: 1.6 $ - * - * last change: $Author: rt $ $Date: 2008-04-11 07:31:14 $ Derived by beppec56@openoffice.org from various examples in SampleICC library, the original copyright retained. diff --git a/libegg/prj/build.lst b/libegg/prj/build.lst index a4cb56a..f9d2c7b 100644 --- a/libegg/prj/build.lst +++ b/libegg/prj/build.lst @@ -1,2 +1,2 @@ -eg libegg : soltools NULL +eg libegg : soltools stlport NULL eg libegg\source nmake - u eg_src NULL diff --git a/libegg/source/eggtrayicon.c b/libegg/source/eggtrayicon.c index ded899e..7207b5f 100644 --- a/libegg/source/eggtrayicon.c +++ b/libegg/source/eggtrayicon.c @@ -76,6 +76,14 @@ static void egg_tray_icon_update_manager_window (EggTrayIcon *icon, static void egg_tray_icon_manager_window_destroyed (EggTrayIcon *icon); #endif +/* + * This is made somewhat more 'interesting' by the facts that: + * a) GTypePlugin is a foul & tangled mess + * b) We may have been unloaded, and left an invalid + * EggTrayIcon class lying around in the GType database, + * we could use GTypePlugin to fix this, but see a) - + * this is far easier and simpler. + */ GType egg_tray_icon_get_type (void) { @@ -88,18 +96,23 @@ egg_tray_icon_get_type (void) sizeof (EggTrayIconClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) egg_tray_icon_class_init, + (GClassInitFunc) NULL, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof (EggTrayIcon), 0, /* n_preallocs */ - (GInstanceInitFunc) egg_tray_icon_init, + (GInstanceInitFunc) NULL, /* instance_init */ NULL }; - our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0); + our_type = g_type_from_name ("EggTrayIcon"); + if (!our_type) + our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0); } + /* always overwrite the function pointers */ + egg_tray_icon_class_init (g_type_class_ref (our_type)); + return our_type; } @@ -128,22 +141,15 @@ egg_tray_icon_class_init (EggTrayIconClass *klass) container_class->add = egg_tray_icon_add; - g_object_class_install_property (gobject_class, - PROP_ORIENTATION, - g_param_spec_enum ("orientation", - _("Orientation"), - _("The orientation of the tray."), - GTK_TYPE_ORIENTATION, - GTK_ORIENTATION_HORIZONTAL, - G_PARAM_READABLE)); - -#if defined (GDK_WINDOWING_X11) - /* Nothing */ -#elif defined (GDK_WINDOWING_WIN32) - g_warning ("Port eggtrayicon to Win32"); -#else - g_warning ("Port eggtrayicon to this GTK+ backend"); -#endif + if (!g_object_class_find_property (gobject_class, "orientation")) + g_object_class_install_property (gobject_class, + PROP_ORIENTATION, + g_param_spec_enum ("orientation", + "Orientation", + "The orientation of the tray.", + GTK_TYPE_ORIENTATION, + GTK_ORIENTATION_HORIZONTAL, + G_PARAM_READABLE)); } static void @@ -471,7 +477,9 @@ egg_tray_icon_new_for_screen (GdkScreen *screen, const char *name) EggTrayIcon* egg_tray_icon_new (const gchar *name) { - return g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL); + EggTrayIcon *icon = g_object_new (EGG_TYPE_TRAY_ICON, "title", name, NULL); + egg_tray_icon_init (icon); + return icon; } guint diff --git a/libegg/source/makefile.mk b/libegg/source/makefile.mk index f7c572b..0301405 100644 --- a/libegg/source/makefile.mk +++ b/libegg/source/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,7 +37,7 @@ C_RESTRICTIONFLAGS*=-xc99=no_lib # --- Settings ---------------------------------- .INCLUDE : settings.mk - +.IF "$(L10N_framework)"=="" .IF "$(ENABLE_GTK)"!="" PKGCONFIG_MODULES=gtk+-2.0 gdk-2.0 @@ -53,7 +49,7 @@ CFLAGS+=$(PKGCONFIG_CFLAGS) SLOFILES=\ $(SLO)$/eggtrayicon.obj -SHL1STDLIBS+=$(PKGCONFIG_LIBS) +SHL1STDLIBS+=$(PKGCONFIG_LIBS) $(X11LINK_DYNAMIC) .IF "$(PKGCONFIG_ROOT)"!="" SHL1SONAME+=-z nodefs SHL1NOCHECK=TRUE @@ -66,5 +62,5 @@ SHL1LIBS= $(SLB)$/eggtray.lib .ENDIF # "$(ENABLE_GTK)"!="" # --- Targets ---------------------------------- - +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/libtextcat/data/new_fingerprints/fpdb.conf b/libtextcat/data/new_fingerprints/fpdb.conf index 5b54fef..df56f9e 100644 --- a/libtextcat/data/new_fingerprints/fpdb.conf +++ b/libtextcat/data/new_fingerprints/fpdb.conf @@ -82,3 +82,4 @@ ukrainian.lm uk--utf8 vietnamese.lm vi--utf8 welsh.lm cy--utf8 yiddish_utf.lm yi--utf8 +zulu.lm zu--utf8 diff --git a/libtextcat/data/new_fingerprints/lm/zulu.lm b/libtextcat/data/new_fingerprints/lm/zulu.lm new file mode 100644 index 0000000..f30c09c --- /dev/null +++ b/libtextcat/data/new_fingerprints/lm/zulu.lm @@ -0,0 +1,400 @@ +_ +a +e +i +n +u +o +l +k +h +s +a_ +b +t +m +g +w +z +e_ +i_ +ng +ku +d +y +la +an +_n +th +le +_u +o_ +el +ba +_k +en +in +wa +p +_e +zi +. +hi +si +al +ha +uk +ab +_i +r +is +ka +_a +kh +we +li +ni +ma +_ng +he +ul +._ +ga +thi +la_ +be +ak +c +on +nd +na +ok +am +lo +ho +, +se +ph +hi_ +ut +es +nga +_ku +,_ +ez +thi_ +un +uth +le_ +uku +hu +f +u_ +um +ek +ne +go +q +_uk +at +aba +_l +sh +lu +M +_uku +ol +_b +hl +ni_ +ngo +kw +- +N +ik +oku +em +nt +as +ge +az +ya +iz +sa +_o +S +uthi +A +za +_w +wa_ +_s +mb +kut +kuth +ela +ye +_y +uthi_ +il +ay +ele +ba_ +I +dl +nge +ath +ub +ke +U +zo +na_ +yi +us +kuthi +esi +ob +v +om +ama +it +lo_ +bu +L +ezi +j +ny +im +ing +li_ +_ab +eni +no +de +ela_ +ze +ang +ko +ala +lw +yo +zin +_U +lel +eng +mi +_ngo +eb +uz +me +gi +ti +ukut +so +ukuth +bo +da +_ba +nz +_aba +the +eli +akh +eni_ +E +ban +s_ +aka +_kw +ma_ +ap +_ukut +he_ +ini +di +K +ka_ +ib +kwa +ulu +ele_ +kho +nj +bi +_z +khu +we_ +lal +enz +ho_ +et +C +gu +zi_ +and +hla +ngi +pha +_um +_ka +isi +_nge +isa +aph +ung +izi +dla +ala_ +zw +nde +to +n_ +ne_ +nk +ke_ +_I +athi +_no +lan +_wa +kul +B +ind +fu +wen +ikh +azi +ule +kub +e. +_S +x +o. +ona +kha +_iz +je +bh +_M +er +kwe +oba +ane +O +_N +sa_ +a. +lwa +_ez +kus +ki +mu +od +" +ebe +P +_nga +hul +_m +ase +ben +_be +T +ic +nda +_si +_na +/ +ant +ngu +ad +anga +nje +ith +a._ +ye_ +athi_ +R +os +alo +tha +za_ +eth +_es +uma +ana +ile +te +ale +aban +: +_A +oba_ +hat +kun +ha_ +phe +be_ +ali +_am +si_ +wo +uy +sik +ise +kan +hath +dlal +_ne +zwe +aw +han +tu +nye +qe +_ko +ah +hel +thu +isa_ +gob +_K +_lo +ta +_ama +ot +ula +_em +ze_ +i. +ngob +_izi +hol +ar +ani +ole +uba +_in +up +eka +ini_ +goba +tho +hon +_ezi +ona_ +ezin +ngoba +lu_ +goba_ +ip +a, +eli_ +t_ +nya +ndl +sha +_is +the_ +i._ +amb diff --git a/libtextcat/download/libtextcat-2.2.tar.gz b/libtextcat/download/libtextcat-2.2.tar.gz Binary files differdeleted file mode 100644 index 2d28f2f..0000000 --- a/libtextcat/download/libtextcat-2.2.tar.gz +++ /dev/null diff --git a/libtextcat/libtextcat-2.2.patch b/libtextcat/libtextcat-2.2.patch index c9ce4ad..ca7a26c 100644 --- a/libtextcat/libtextcat-2.2.patch +++ b/libtextcat/libtextcat-2.2.patch @@ -1,5 +1,14 @@ --- misc/libtextcat-2.2/configure Thu May 22 13:39:55 2003 +++ misc/build/libtextcat-2.2/configure Mon Mar 31 11:29:14 2008 +@@ -3451,7 +3451,7 @@ + ;; + + # This must be Linux ELF. +-linux-gnu*) ++linux-gnu*|k*bsd*-gnu*) + case $host_cpu in + alpha* | hppa* | i*86 | mips | mipsel | powerpc* | sparc* | ia64*) + lt_cv_deplibs_check_method=pass_all ;; @@ -5391,7 +5391,8 @@ allow_undefined_flag= no_undefined_flag= @@ -28,6 +37,15 @@ version_type=freebsd-$objformat case $version_type in freebsd-elf*) +@@ -6365,7 +6365,7 @@ + ;; + + # This must be Linux ELF. +-linux-gnu*) ++linux-gnu*|k*bsd*-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no --- misc/libtextcat-2.2/src/Makefile.in Thu May 22 13:39:52 2003 +++ misc/build/libtextcat-2.2/src/Makefile.in Mon Mar 31 11:29:14 2008 @@ -124,20 +124,20 @@ @@ -932,20 +950,16 @@ +} --- misc/libtextcat-2.2/src/makefile.mk Mon Mar 31 11:30:06 2008 +++ misc/build/libtextcat-2.2/src/makefile.mk Mon Mar 31 11:29:42 2008 -@@ -1 +1,90 @@ +@@ -1 +1,87 @@ -dummy +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# -+# Copyright 2008 by Sun Microsystems, Inc. ++# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# -+# $RCSfile: libtextcat-2.2.patch,v $ -+# -+# $Revision: 1.8 $ -+# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify @@ -973,6 +987,7 @@ + +USE_DEFFILE=TRUE +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE ++UWINAPILIB= + +.INCLUDE : settings.mk + @@ -1585,3 +1600,2479 @@ + +/* Define to `unsigned' if <sys/types.h> does not define. */ +/* #undef size_t */ +--- misc/libtextcat-2.2/config.guess 2010-04-15 09:20:04.000000000 +0000 ++++ misc/build/libtextcat-2.2/config.guess 2010-04-15 09:20:41.000000000 +0000 +@@ -1,9 +1,10 @@ + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002 Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++# Free Software Foundation, Inc. + +-timestamp='2002-10-21' ++timestamp='2009-12-30' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -17,23 +18,25 @@ + # + # 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. ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++# 02110-1301, USA. + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + +-# Originally written by Per Bothner <per@bothner.com>. +-# Please send patches to <config-patches@gnu.org>. Submit a context +-# diff and a properly formatted ChangeLog entry. ++ ++# Originally written by Per Bothner. Please send patches (context ++# diff format) to <config-patches@gnu.org> and include a ChangeLog ++# entry. + # + # This script attempts to guess a canonical system name similar to + # config.sub. If it succeeds, it prints the system name on stdout, and + # exits with 0. Otherwise, it exits with 1. + # +-# The plan is that this can be called by configure scripts if you +-# don't specify an explicit build system type. ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -53,8 +56,9 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free ++Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -66,11 +70,11 @@ + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) +- echo "$timestamp" ; exit 0 ;; ++ echo "$timestamp" ; exit ;; + --version | -v ) +- echo "$version" ; exit 0 ;; ++ echo "$version" ; exit ;; + --help | --h* | -h ) +- echo "$usage"; exit 0 ;; ++ echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. +@@ -98,14 +102,18 @@ + # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still + # use `HOST_CC' if defined, but it is deprecated. + +-# This shell variable is my proudest work .. or something. --bje ++# Portable tmp directory creation inspired by the Autoconf team. + +-set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +-(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) +- || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +-dummy=$tmpdir/dummy ; +-files="$dummy.c $dummy.o $dummy.rel $dummy" ; +-trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; ++set_cc_for_build=' ++trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; ++trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; ++: ${TMPDIR=/tmp} ; ++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || ++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || ++ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || ++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; ++dummy=$tmp/dummy ; ++tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; + case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do +@@ -113,15 +121,13 @@ + CC_FOR_BUILD="$c"; break ; + fi ; + done ; +- rm -f $files ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +-esac ; +-unset files' ++esac ; set_cc_for_build= ;' + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi@noc.rutgers.edu 1994-08-24) +@@ -156,6 +162,7 @@ + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; ++ sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched +@@ -164,7 +171,7 @@ + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ +- | grep __ELF__ >/dev/null ++ | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? +@@ -178,144 +185,128 @@ + ;; + esac + # The OS release +- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ++ # Debian GNU/NetBSD machines have a different userland, and ++ # thus, need a distinct triplet. However, they do not need ++ # kernel version information, so it can be replaced with a ++ # suitable tag, in the style of linux-gnu. ++ case "${UNAME_VERSION}" in ++ Debian*) ++ release='-gnu' ++ ;; ++ *) ++ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ++ ;; ++ esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" +- exit 0 ;; +- amiga:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- arc:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- hp300:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mac68k:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- macppc:OpenBSD:*:*) +- echo powerpc-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvme68k:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvme88k:OpenBSD:*:*) +- echo m88k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvmeppc:OpenBSD:*:*) +- echo powerpc-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- pmax:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sgi:OpenBSD:*:*) +- echo mipseb-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sun3:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- wgrisc:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:OpenBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; ++ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ++ exit ;; ++ *:ekkoBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} ++ exit ;; ++ *:SolidBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} ++ exit ;; ++ macppc:MirBSD:*:*) ++ echo powerpc-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; ++ *:MirBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; + alpha:OSF1:*:*) +- if test $UNAME_RELEASE = "V4.0"; then ++ case $UNAME_RELEASE in ++ *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` +- fi ++ ;; ++ *5.*) ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ ;; ++ esac ++ # According to Compaq, /usr/sbin/psrinfo has been available on ++ # OSF/1 and Tru64 systems produced since 1995. I hope that ++ # covers most systems running today. This code pipes the CPU ++ # types through head -n 1, so we only detect the type of CPU 0. ++ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` ++ case "$ALPHA_CPU_TYPE" in ++ "EV4 (21064)") ++ UNAME_MACHINE="alpha" ;; ++ "EV4.5 (21064)") ++ UNAME_MACHINE="alpha" ;; ++ "LCA4 (21066/21068)") ++ UNAME_MACHINE="alpha" ;; ++ "EV5 (21164)") ++ UNAME_MACHINE="alphaev5" ;; ++ "EV5.6 (21164A)") ++ UNAME_MACHINE="alphaev56" ;; ++ "EV5.6 (21164PC)") ++ UNAME_MACHINE="alphapca56" ;; ++ "EV5.7 (21164PC)") ++ UNAME_MACHINE="alphapca57" ;; ++ "EV6 (21264)") ++ UNAME_MACHINE="alphaev6" ;; ++ "EV6.7 (21264A)") ++ UNAME_MACHINE="alphaev67" ;; ++ "EV6.8CB (21264C)") ++ UNAME_MACHINE="alphaev68" ;; ++ "EV6.8AL (21264B)") ++ UNAME_MACHINE="alphaev68" ;; ++ "EV6.8CX (21264D)") ++ UNAME_MACHINE="alphaev68" ;; ++ "EV6.9A (21264/EV69A)") ++ UNAME_MACHINE="alphaev69" ;; ++ "EV7 (21364)") ++ UNAME_MACHINE="alphaev7" ;; ++ "EV7.9 (21364A)") ++ UNAME_MACHINE="alphaev79" ;; ++ esac ++ # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. +- eval $set_cc_for_build +- cat <<EOF >$dummy.s +- .data +-\$Lformat: +- .byte 37,100,45,37,120,10,0 # "%d-%x\n" +- +- .text +- .globl main +- .align 4 +- .ent main +-main: +- .frame \$30,16,\$26,0 +- ldgp \$29,0(\$27) +- .prologue 1 +- .long 0x47e03d80 # implver \$0 +- lda \$2,-1 +- .long 0x47e20c21 # amask \$2,\$1 +- lda \$16,\$Lformat +- mov \$0,\$17 +- not \$1,\$18 +- jsr \$26,printf +- ldgp \$29,0(\$26) +- mov 0,\$16 +- jsr \$26,exit +- .end main +-EOF +- $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null +- if test "$?" = 0 ; then +- case `$dummy` in +- 0-0) +- UNAME_MACHINE="alpha" +- ;; +- 1-0) +- UNAME_MACHINE="alphaev5" +- ;; +- 1-1) +- UNAME_MACHINE="alphaev56" +- ;; +- 1-101) +- UNAME_MACHINE="alphapca56" +- ;; +- 2-303) +- UNAME_MACHINE="alphaev6" +- ;; +- 2-307) +- UNAME_MACHINE="alphaev67" +- ;; +- 2-1307) +- UNAME_MACHINE="alphaev68" +- ;; +- 3-1307) +- UNAME_MACHINE="alphaev7" +- ;; +- esac +- fi +- rm -f $dummy.s $dummy && rmdir $tmpdir +- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- exit 0 ;; ++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ++ exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix +- exit 0 ;; ++ exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 +- exit 0 ;; ++ exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 +- exit 0;; ++ exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos +- exit 0 ;; ++ exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos +- exit 0 ;; ++ exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition +- exit 0 ;; ++ exit ;; ++ *:z/VM:*:*) ++ echo s390-ibm-zvmoe ++ exit ;; ++ *:OS400:*:*) ++ echo powerpc-ibm-os400 ++ exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} +- exit 0;; ++ exit ;; ++ arm:riscos:*:*|arm:RISCOS:*:*) ++ echo arm-unknown-riscos ++ exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp +- exit 0;; ++ exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then +@@ -323,29 +314,51 @@ + else + echo pyramid-pyramid-bsd + fi +- exit 0 ;; ++ exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 +- exit 0 ;; +- DRS?6000:UNIX_SV:4.2*:7*) ++ exit ;; ++ DRS?6000:unix:4.0:6*) ++ echo sparc-icl-nx6 ++ exit ;; ++ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in +- sparc) echo sparc-icl-nx7 && exit 0 ;; ++ sparc) echo sparc-icl-nx7; exit ;; + esac ;; ++ s390x:SunOS:*:*) ++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; +- i86pc:SunOS:5.*:*) +- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; ++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) ++ echo i386-pc-auroraux${UNAME_RELEASE} ++ exit ;; ++ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) ++ eval $set_cc_for_build ++ SUN_ARCH="i386" ++ # If there is a compiler, see if it is configured for 64-bit objects. ++ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. ++ # This test works for both compilers. ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ SUN_ARCH="x86_64" ++ fi ++ fi ++ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) +@@ -354,10 +367,10 @@ + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` +- exit 0 ;; ++ exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 +@@ -369,10 +382,10 @@ + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac +- exit 0 ;; ++ exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor +@@ -383,37 +396,40 @@ + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ m68k:machten:*:*) ++ echo m68k-apple-machten${UNAME_RELEASE} ++ exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 +- exit 0 ;; ++ exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +@@ -437,33 +453,33 @@ + exit (-1); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c \ +- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ +- && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +- rm -f $dummy.c $dummy && rmdir $tmpdir ++ $CC_FOR_BUILD -o $dummy $dummy.c && ++ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && ++ SYSTEM_NAME=`$dummy $dummyarg` && ++ { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax +- exit 0 ;; ++ exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax +- exit 0 ;; +- Night_Hawk:*:*:PowerMAX_OS) ++ exit ;; ++ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax +- exit 0 ;; ++ exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix +- exit 0 ;; ++ exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 +- exit 0 ;; ++ exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 +- exit 0 ;; ++ exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 +- exit 0 ;; ++ exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` +@@ -479,29 +495,29 @@ + else + echo i586-dg-dgux${UNAME_RELEASE} + fi +- exit 0 ;; ++ exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 +- exit 0 ;; ++ exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 +- exit 0 ;; ++ exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 +- exit 0 ;; ++ exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd +- exit 0 ;; ++ exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` +- exit 0 ;; ++ exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. +- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id +- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' ++ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id ++ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix +- exit 0 ;; ++ exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` +@@ -509,7 +525,7 @@ + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} +- exit 0 ;; ++ exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build +@@ -524,16 +540,19 @@ + exit(0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +- rm -f $dummy.c $dummy && rmdir $tmpdir +- echo rs6000-ibm-aix3.2.5 ++ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` ++ then ++ echo "$SYSTEM_NAME" ++ else ++ echo rs6000-ibm-aix3.2.5 ++ fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi +- exit 0 ;; +- *:AIX:*:[45]) ++ exit ;; ++ *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 +@@ -546,28 +565,28 @@ + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} +- exit 0 ;; ++ exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix +- exit 0 ;; ++ exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 +- exit 0 ;; ++ exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to +- exit 0 ;; # report: romp-ibm BSD 4.3 ++ exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx +- exit 0 ;; ++ exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 +- exit 0 ;; ++ exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd +- exit 0 ;; ++ exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 +- exit 0 ;; ++ exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in +@@ -624,16 +643,36 @@ + } + EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` +- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi +- rm -f $dummy.c $dummy && rmdir $tmpdir ++ test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac ++ if [ ${HP_ARCH} = "hppa2.0w" ] ++ then ++ eval $set_cc_for_build ++ ++ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating ++ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler ++ # generating 64-bit code. GNU and HP use different nomenclature: ++ # ++ # $ CC_FOR_BUILD=cc ./config.guess ++ # => hppa2.0w-hp-hpux11.23 ++ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess ++ # => hppa64-hp-hpux11.23 ++ ++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | ++ grep -q __LP64__ ++ then ++ HP_ARCH="hppa2.0w" ++ else ++ HP_ARCH="hppa64" ++ fi ++ fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} +- exit 0 ;; ++ exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} +- exit 0 ;; ++ exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +@@ -661,186 +700,248 @@ + exit (0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +- rm -f $dummy.c $dummy && rmdir $tmpdir ++ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 +- exit 0 ;; ++ exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd +- exit 0 ;; ++ exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd +- exit 0 ;; ++ exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix +- exit 0 ;; ++ exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf +- exit 0 ;; ++ exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf +- exit 0 ;; ++ exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi +- exit 0 ;; ++ exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites +- exit 0 ;; ++ exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd +- exit 0 ;; ++ exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi +- exit 0 ;; ++ exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd +- exit 0 ;; ++ exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd +- exit 0 ;; ++ exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd +- exit 0 ;; ++ exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; +- CRAY*T3D:*:*:*) +- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; ++ *:UNICOS/mp:*:*) ++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" +- exit 0 ;; ++ exit ;; ++ 5000:UNIX_System_V:4.*:*) ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` ++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:FreeBSD:*:*) +- # Determine whether the default compiler uses glibc. +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include <features.h> +- #if __GLIBC__ >= 2 +- LIBC=gnu +- #else +- LIBC= +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` +- rm -f $dummy.c && rmdir $tmpdir +- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} +- exit 0 ;; ++ case ${UNAME_MACHINE} in ++ pc98) ++ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ amd64) ++ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ *) ++ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ esac ++ exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin +- exit 0 ;; +- i*:MINGW*:*) ++ exit ;; ++ *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 +- exit 0 ;; ++ exit ;; ++ i*:windows32*:*) ++ # uname -m includes "-pc" on this system. ++ echo ${UNAME_MACHINE}-mingw32 ++ exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 +- exit 0 ;; +- x86:Interix*:3*) +- echo i386-pc-interix3 +- exit 0 ;; ++ exit ;; ++ *:Interix*:*) ++ case ${UNAME_MACHINE} in ++ x86) ++ echo i586-pc-interix${UNAME_RELEASE} ++ exit ;; ++ authenticamd | genuineintel | EM64T) ++ echo x86_64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ IA64) ++ echo ia64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ esac ;; ++ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) ++ echo i${UNAME_MACHINE}-pc-mks ++ exit ;; ++ 8664:Windows_NT:*) ++ echo x86_64-pc-mks ++ exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? +- echo i386-pc-interix +- exit 0 ;; ++ echo i586-pc-interix ++ exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin +- exit 0 ;; ++ exit ;; ++ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) ++ echo x86_64-unknown-cygwin ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin +- exit 0 ;; ++ exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + *:GNU:*:*) ++ # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` +- exit 0 ;; ++ exit ;; ++ *:GNU/*:*:*) ++ # other systems with GNU libc and userland ++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu ++ exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix +- exit 0 ;; ++ exit ;; ++ alpha:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ EV5) UNAME_MACHINE=alphaev5 ;; ++ EV56) UNAME_MACHINE=alphaev56 ;; ++ PCA56) UNAME_MACHINE=alphapca56 ;; ++ PCA57) UNAME_MACHINE=alphapca56 ;; ++ EV6) UNAME_MACHINE=alphaev6 ;; ++ EV67) UNAME_MACHINE=alphaev67 ;; ++ EV68*) UNAME_MACHINE=alphaev68 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ++ exit ;; + arm*:Linux:*:*) ++ eval $set_cc_for_build ++ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_EABI__ ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ else ++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ fi ++ exit ;; ++ avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ cris:Linux:*:*) ++ echo cris-axis-linux-gnu ++ exit ;; ++ crisv32:Linux:*:*) ++ echo crisv32-axis-linux-gnu ++ exit ;; ++ frv:Linux:*:*) ++ echo frv-unknown-linux-gnu ++ exit ;; ++ i*86:Linux:*:*) ++ LIBC=gnu ++ eval $set_cc_for_build ++ sed 's/^ //' << EOF >$dummy.c ++ #ifdef __dietlibc__ ++ LIBC=dietlibc ++ #endif ++EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ++ echo "${UNAME_MACHINE}-pc-linux-${LIBC}" ++ exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ m32r*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; +- mips:Linux:*:*) ++ exit ;; ++ mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU +- #undef mips +- #undef mipsel ++ #undef ${UNAME_MACHINE} ++ #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mipsel ++ CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips ++ CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- rm -f $dummy.c && rmdir $tmpdir +- test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; +- ppc:Linux:*:*) +- echo powerpc-unknown-linux-gnu +- exit 0 ;; +- ppc64:Linux:*:*) +- echo powerpc64-unknown-linux-gnu +- exit 0 ;; +- alpha:Linux:*:*) +- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +- EV5) UNAME_MACHINE=alphaev5 ;; +- EV56) UNAME_MACHINE=alphaev56 ;; +- PCA56) UNAME_MACHINE=alphapca56 ;; +- PCA57) UNAME_MACHINE=alphapca56 ;; +- EV6) UNAME_MACHINE=alphaev6 ;; +- EV67) UNAME_MACHINE=alphaev67 ;; +- EV68*) UNAME_MACHINE=alphaev68 ;; +- esac +- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null +- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi +- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} +- exit 0 ;; ++ or32:Linux:*:*) ++ echo or32-unknown-linux-gnu ++ exit ;; ++ padre:Linux:*:*) ++ echo sparc-unknown-linux-gnu ++ exit ;; ++ parisc64:Linux:*:* | hppa64:Linux:*:*) ++ echo hppa64-unknown-linux-gnu ++ exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +@@ -848,82 +949,40 @@ + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac +- exit 0 ;; +- parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ ppc64:Linux:*:*) ++ echo powerpc64-unknown-linux-gnu ++ exit ;; ++ ppc:Linux:*:*) ++ echo powerpc-unknown-linux-gnu ++ exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux +- exit 0 ;; ++ exit ;; ++ sh64*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ vax:Linux:*:*) ++ echo ${UNAME_MACHINE}-dec-linux-gnu ++ exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu +- exit 0 ;; +- i*86:Linux:*:*) +- # The BFD linker knows what the default object file format is, so +- # first see if it will tell us. cd to the root directory to prevent +- # problems with other programs or directories called `ld' in the path. +- # Set LC_ALL=C to ensure ld outputs messages in English. +- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ +- | sed -ne '/supported targets:/!d +- s/[ ][ ]*/ /g +- s/.*supported targets: *// +- s/ .*// +- p'` +- case "$ld_supported_targets" in +- elf32-i386) +- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" +- ;; +- a.out-i386-linux) +- echo "${UNAME_MACHINE}-pc-linux-gnuaout" +- exit 0 ;; +- coff-i386) +- echo "${UNAME_MACHINE}-pc-linux-gnucoff" +- exit 0 ;; +- "") +- # Either a pre-BFD a.out linker (linux-gnuoldld) or +- # one that does not give us useful --help. +- echo "${UNAME_MACHINE}-pc-linux-gnuoldld" +- exit 0 ;; +- esac +- # Determine whether the default compiler is a.out or elf +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include <features.h> +- #ifdef __ELF__ +- # ifdef __GLIBC__ +- # if __GLIBC__ >= 2 +- LIBC=gnu +- # else +- LIBC=gnulibc1 +- # endif +- # else +- LIBC=gnulibc1 +- # endif +- #else +- #ifdef __INTEL_COMPILER +- LIBC=gnu +- #else +- LIBC=gnuaout +- #endif +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` +- rm -f $dummy.c && rmdir $tmpdir +- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 +- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 +- ;; ++ exit ;; ++ xtensa*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 +- exit 0 ;; ++ exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... +@@ -931,7 +990,27 @@ + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} +- exit 0 ;; ++ exit ;; ++ i*86:OS/2:*:*) ++ # If we were able to find `uname', then EMX Unix compatibility ++ # is probably installed. ++ echo ${UNAME_MACHINE}-pc-os2-emx ++ exit ;; ++ i*86:XTS-300:*:STOP) ++ echo ${UNAME_MACHINE}-unknown-stop ++ exit ;; ++ i*86:atheos:*:*) ++ echo ${UNAME_MACHINE}-unknown-atheos ++ exit ;; ++ i*86:syllable:*:*) ++ echo ${UNAME_MACHINE}-pc-syllable ++ exit ;; ++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) ++ echo i386-unknown-lynxos${UNAME_RELEASE} ++ exit ;; ++ i*86:*DOS:*:*) ++ echo ${UNAME_MACHINE}-pc-msdosdjgpp ++ exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then +@@ -939,15 +1018,16 @@ + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi +- exit 0 ;; +- i*86:*:5:[78]*) ++ exit ;; ++ i*86:*:5:[678]*) ++ # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} +- exit 0 ;; ++ exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` +@@ -965,76 +1045,86 @@ + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi +- exit 0 ;; +- i*86:*DOS:*:*) +- echo ${UNAME_MACHINE}-pc-msdosdjgpp +- exit 0 ;; ++ exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about +- # the processor, so we play safe by assuming i386. +- echo i386-pc-msdosdjgpp +- exit 0 ;; ++ # the processor, so we play safe by assuming i586. ++ # Note: whatever this is, it MUST be the same as what config.sub ++ # prints for the "djgpp" host, or else GDB configury will decide that ++ # this is a cross-build. ++ echo i586-pc-msdosdjgpp ++ exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 +- exit 0 ;; ++ exit ;; + paragon:*:*:*) + echo i860-intel-osf1 +- exit 0 ;; ++ exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi +- exit 0 ;; ++ exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv +- exit 0 ;; ++ exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv +- exit 0 ;; +- M68*:*:R3V[567]*:*) +- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; +- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) ++ exit ;; ++ M680?0:D-NIX:5.3:*) ++ echo m68k-diab-dnix ++ exit ;; ++ M68*:*:R3V[5678]*:*) ++ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; ++ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && echo i486-ncr-sysv4.3${OS_REL} && exit 0 ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ +- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && echo i486-ncr-sysv4 && exit 0 ;; ++ && { echo i486-ncr-sysv4; exit; } ;; ++ NCR*:*:4.2:* | MPRAS*:*:4.2:*) ++ OS_REL='.3' ++ test -r /etc/.relid \ ++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 +- exit 0 ;; +- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) +- echo i386-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; +- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) ++ exit ;; ++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 +- exit 0 ;; ++ exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 +- exit 0 ;; ++ exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` +@@ -1042,64 +1132,94 @@ + else + echo ns32k-sni-sysv + fi +- exit 0 ;; ++ exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 +- exit 0 ;; ++ exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 +- exit 0 ;; ++ exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 +- exit 0 ;; ++ exit ;; ++ i*86:VOS:*:*) ++ # From Paul.Green@stratus.com. ++ echo ${UNAME_MACHINE}-stratus-vos ++ exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos +- exit 0 ;; ++ exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 +- exit 0 ;; ++ exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi +- exit 0 ;; ++ exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos +- exit 0 ;; ++ exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos +- exit 0 ;; ++ exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos +- exit 0 ;; ++ exit ;; ++ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. ++ echo i586-pc-haiku ++ exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ SX-7:SUPER-UX:*:*) ++ echo sx7-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8:SUPER-UX:*:*) ++ echo sx8-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8R:SUPER-UX:*:*) ++ echo sx8r-nec-superux${UNAME_RELEASE} ++ exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Darwin:*:*) +- echo `uname -p`-apple-darwin${UNAME_RELEASE} +- exit 0 ;; ++ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown ++ case $UNAME_PROCESSOR in ++ i386) ++ eval $set_cc_for_build ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ UNAME_PROCESSOR="x86_64" ++ fi ++ fi ;; ++ unknown) UNAME_PROCESSOR=powerpc ;; ++ esac ++ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} ++ exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then +@@ -1107,22 +1227,25 @@ + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:QNX:*:4*) + echo i386-pc-qnx +- exit 0 ;; +- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) ++ exit ;; ++ NSE-?:NONSTOP_KERNEL:*:*) ++ echo nse-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux +- exit 0 ;; ++ exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv +- exit 0 ;; ++ exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 +@@ -1133,36 +1256,50 @@ + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 +- exit 0 ;; +- i*86:OS/2:*:*) +- # If we were able to find `uname', then EMX Unix compatibility +- # is probably installed. +- echo ${UNAME_MACHINE}-pc-os2-emx +- exit 0 ;; ++ exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 +- exit 0 ;; ++ exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex +- exit 0 ;; ++ exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 +- exit 0 ;; ++ exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 +- exit 0 ;; ++ exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 +- exit 0 ;; ++ exit ;; + *:ITS:*:*) + echo pdp10-unknown-its +- exit 0 ;; +- i*86:XTS-300:*:STOP) +- echo ${UNAME_MACHINE}-unknown-stop +- exit 0 ;; +- i*86:atheos:*:*) +- echo ${UNAME_MACHINE}-unknown-atheos +- exit 0 ;; ++ exit ;; ++ SEI:*:*:SEIUX) ++ echo mips-sei-seiux${UNAME_RELEASE} ++ exit ;; ++ *:DragonFly:*:*) ++ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ++ exit ;; ++ *:*VMS:*:*) ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ case "${UNAME_MACHINE}" in ++ A*) echo alpha-dec-vms ; exit ;; ++ I*) echo ia64-dec-vms ; exit ;; ++ V*) echo vax-dec-vms ; exit ;; ++ esac ;; ++ *:XENIX:*:SysV) ++ echo i386-pc-xenix ++ exit ;; ++ i*86:skyos:*:*) ++ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' ++ exit ;; ++ i*86:rdos:*:*) ++ echo ${UNAME_MACHINE}-pc-rdos ++ exit ;; ++ i*86:AROS:*:*) ++ echo ${UNAME_MACHINE}-pc-aros ++ exit ;; + esac + + #echo '(No uname command or uname output not recognized.)' 1>&2 +@@ -1194,7 +1331,7 @@ + #endif + + #if defined (__arm) && defined (__acorn) && defined (__unix) +- printf ("arm-acorn-riscix"); exit (0); ++ printf ("arm-acorn-riscix\n"); exit (0); + #endif + + #if defined (hp300) && !defined (hpux) +@@ -1283,12 +1420,12 @@ + } + EOF + +-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +-rm -f $dummy.c $dummy && rmdir $tmpdir ++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } + + # Apollos put the system type in the environment. + +-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } ++test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + + # Convex versions that predate uname can use getsysinfo(1) + +@@ -1297,22 +1434,22 @@ + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd +- exit 0 ;; ++ exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi +- exit 0 ;; ++ exit ;; + c34*) + echo c34-convex-bsd +- exit 0 ;; ++ exit ;; + c38*) + echo c38-convex-bsd +- exit 0 ;; ++ exit ;; + c4*) + echo c4-convex-bsd +- exit 0 ;; ++ exit ;; + esac + fi + +@@ -1323,7 +1460,9 @@ + the operating system you are using. It is advised that you + download the most up to date version of the config scripts from + +- ftp://ftp.gnu.org/pub/gnu/config/ ++ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD ++and ++ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + + If the version you run ($0) is already up to date, please + send the following data and any information you think might be +--- misc/libtextcat-2.2/config.sub 2010-04-15 09:20:04.000000000 +0000 ++++ misc/build/libtextcat-2.2/config.sub 2010-04-15 09:20:41.000000000 +0000 +@@ -1,9 +1,10 @@ + #! /bin/sh + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002 Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++# Free Software Foundation, Inc. + +-timestamp='2002-09-05' ++timestamp='2010-01-22' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software +@@ -21,22 +22,26 @@ + # + # 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. +- ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++# 02110-1301, USA. ++# + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + ++ + # Please send patches to <config-patches@gnu.org>. Submit a context +-# diff and a properly formatted ChangeLog entry. ++# diff and a properly formatted GNU ChangeLog entry. + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. + # Otherwise, we print the canonical config type on stdout and succeed. + ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD ++ + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases + # that are meaningful with *any* GNU software. +@@ -70,8 +75,9 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free ++Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -83,11 +89,11 @@ + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) +- echo "$timestamp" ; exit 0 ;; ++ echo "$timestamp" ; exit ;; + --version | -v ) +- echo "$version" ; exit 0 ;; ++ echo "$version" ; exit ;; + --help | --h* | -h ) +- echo "$usage"; exit 0 ;; ++ echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. +@@ -99,7 +105,7 @@ + *local*) + # First pass through any local machine types. + echo $1 +- exit 0;; ++ exit ;; + + * ) + break ;; +@@ -118,7 +124,10 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) ++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ ++ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ ++ kopensolaris*-gnu* | \ ++ storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -144,10 +153,13 @@ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis) ++ -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; ++ -bluegene*) ++ os=-cnk ++ ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 +@@ -169,6 +181,10 @@ + -hiux*) + os=-hiuxwe2 + ;; ++ -sco6) ++ os=-sco5v6 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +@@ -185,6 +201,10 @@ + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; ++ -sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +@@ -228,51 +248,71 @@ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ +- | clipper \ ++ | am33_2.0 \ ++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ ++ | bfin \ ++ | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ +- | fr30 | frv \ ++ | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ +- | ip2k \ +- | m32r | m68000 | m68k | m88k | mcore \ ++ | ip2k | iq2000 \ ++ | lm32 \ ++ | m32c | m32r | m32rle | m68000 | m68k | m88k \ ++ | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ +- | mips64vr | mips64vrel \ ++ | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ ++ | mips64r5900 | mips64r5900el \ ++ | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ ++ | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ ++ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ ++ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ ++ | moxie \ ++ | mt \ ++ | msp430 \ ++ | nios | nios2 \ + | ns16k | ns32k \ +- | openrisc | or32 \ ++ | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ +- | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ ++ | rx \ ++ | score \ ++ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ +- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ +- | strongarm \ +- | tahoe | thumb | tic80 | tron \ ++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ ++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ ++ | spu | strongarm \ ++ | tahoe | thumb | tic4x | tic80 | tron \ ++ | ubicom32 \ + | v850 | v850e \ + | we32k \ +- | x86 | xscale | xstormy16 | xtensa \ +- | z8k) ++ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ ++ | z8k | z80) + basic_machine=$basic_machine-unknown + ;; +- m6811 | m68hc11 | m6812 | m68hc12) ++ m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; ++ ms1) ++ basic_machine=mt-unknown ++ ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and +@@ -292,50 +332,69 @@ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* \ +- | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ +- | clipper-* | cydra-* \ ++ | avr-* | avr32-* \ ++ | bfin-* | bs2000-* \ ++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ ++ | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ +- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ ++ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ +- | ip2k-* \ +- | m32r-* \ ++ | ip2k-* | iq2000-* \ ++ | lm32-* \ ++ | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | mcore-* \ ++ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ +- | mips64vr-* | mips64vrel-* \ ++ | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ ++ | mips64r5900-* | mips64r5900el-* \ ++ | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ ++ | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ ++ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ ++ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ +- | mipstx39 | mipstx39el \ ++ | mipstx39-* | mipstx39el-* \ ++ | mmix-* \ ++ | mt-* \ ++ | msp430-* \ ++ | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ +- | romp-* | rs6000-* \ +- | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ ++ | romp-* | rs6000-* | rx-* \ ++ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ +- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ +- | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ ++ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ ++ | sparclite-* \ ++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ ++ | tahoe-* | thumb-* \ ++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ ++ | tile-* | tilegx-* \ ++ | tron-* \ ++ | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ +- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ +- | xtensa-* \ ++ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ ++ | xstormy16-* | xtensa*-* \ + | ymp-* \ +- | z8k-*) ++ | z8k-* | z80-*) ++ ;; ++ # Recognize the basic CPU types without company name, with glob match. ++ xtensa*) ++ basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. +@@ -353,6 +412,9 @@ + basic_machine=a29k-amd + os=-udi + ;; ++ abacus) ++ basic_machine=abacus-unknown ++ ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout +@@ -367,6 +429,12 @@ + basic_machine=a29k-none + os=-bsd + ;; ++ amd64) ++ basic_machine=x86_64-pc ++ ;; ++ amd64-*) ++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + amdahl) + basic_machine=580-amdahl + os=-sysv +@@ -390,6 +458,10 @@ + basic_machine=m68k-apollo + os=-bsd + ;; ++ aros) ++ basic_machine=i386-pc ++ os=-aros ++ ;; + aux) + basic_machine=m68k-apple + os=-aux +@@ -398,10 +470,26 @@ + basic_machine=ns32k-sequent + os=-dynix + ;; ++ blackfin) ++ basic_machine=bfin-unknown ++ os=-linux ++ ;; ++ blackfin-*) ++ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; ++ bluegene*) ++ basic_machine=powerpc-ibm ++ os=-cnk ++ ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; ++ cegcc) ++ basic_machine=arm-unknown ++ os=-cegcc ++ ;; + convex-c1) + basic_machine=c1-convex + os=-bsd +@@ -426,12 +514,27 @@ + basic_machine=j90-cray + os=-unicos + ;; ++ craynv) ++ basic_machine=craynv-cray ++ os=-unicosmp ++ ;; ++ cr16) ++ basic_machine=cr16-unknown ++ os=-elf ++ ;; + crds | unos) + basic_machine=m68k-crds + ;; ++ crisv32 | crisv32-* | etraxfs*) ++ basic_machine=crisv32-axis ++ ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; ++ crx) ++ basic_machine=crx-unknown ++ os=-elf ++ ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; +@@ -454,6 +557,14 @@ + basic_machine=m88k-motorola + os=-sysv3 + ;; ++ dicos) ++ basic_machine=i686-pc ++ os=-dicos ++ ;; ++ djgpp) ++ basic_machine=i586-pc ++ os=-msdosdjgpp ++ ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx +@@ -604,6 +715,14 @@ + basic_machine=m68k-isi + os=-sysv + ;; ++ m68knommu) ++ basic_machine=m68k-unknown ++ os=-linux ++ ;; ++ m68knommu-*) ++ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; + m88k-omron*) + basic_machine=m88k-omron + ;; +@@ -615,10 +734,17 @@ + basic_machine=ns32k-utek + os=-sysv + ;; ++ microblaze) ++ basic_machine=microblaze-xilinx ++ ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; ++ mingw32ce) ++ basic_machine=arm-unknown ++ os=-mingw32ce ++ ;; + miniframe) + basic_machine=m68000-convergent + ;; +@@ -632,10 +758,6 @@ + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; +- mmix*) +- basic_machine=mmix-knuth +- os=-mmixware +- ;; + monitor) + basic_machine=m68k-rom68k + os=-coff +@@ -648,6 +770,9 @@ + basic_machine=i386-pc + os=-msdos + ;; ++ ms1-*) ++ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ++ ;; + mvs) + basic_machine=i370-ibm + os=-mvs +@@ -723,9 +848,12 @@ + basic_machine=hppa1.1-oki + os=-proelf + ;; +- or32 | or32-*) ++ openrisc | openrisc-*) + basic_machine=or32-unknown +- os=-coff ++ ;; ++ os400) ++ basic_machine=powerpc-ibm ++ os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson +@@ -743,6 +871,14 @@ + basic_machine=i860-intel + os=-osf + ;; ++ parisc) ++ basic_machine=hppa-unknown ++ os=-linux ++ ;; ++ parisc-*) ++ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; + pbd) + basic_machine=sparc-tti + ;; +@@ -752,24 +888,36 @@ + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; ++ pc98) ++ basic_machine=i386-pc ++ ;; ++ pc98-*) ++ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; +- pentiumii | pentium2) ++ pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; ++ pentium4) ++ basic_machine=i786-pc ++ ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; +- pentiumii-* | pentium2-*) ++ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ++ pentium4-*) ++ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + pn) + basic_machine=pn-gould + ;; +@@ -802,6 +950,10 @@ + basic_machine=i586-unknown + os=-pw32 + ;; ++ rdos) ++ basic_machine=i386-pc ++ os=-rdos ++ ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff +@@ -828,6 +980,14 @@ + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; ++ sde) ++ basic_machine=mipsisa32-sde ++ os=-elf ++ ;; ++ sei) ++ basic_machine=mips-sei ++ os=-seiux ++ ;; + sequent) + basic_machine=i386-sequent + ;; +@@ -835,6 +995,12 @@ + basic_machine=sh-hitachi + os=-hms + ;; ++ sh5el) ++ basic_machine=sh5le-unknown ++ ;; ++ sh64) ++ basic_machine=sh64-unknown ++ ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks +@@ -901,10 +1067,6 @@ + basic_machine=i386-sequent + os=-dynix + ;; +- t3d) +- basic_machine=alpha-cray +- os=-unicos +- ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos +@@ -913,14 +1075,27 @@ + basic_machine=t90-cray + os=-unicos + ;; +- tic4x | c4x*) +- basic_machine=tic4x-unknown +- os=-coff +- ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; ++ tic55x | c55x*) ++ basic_machine=tic55x-unknown ++ os=-coff ++ ;; ++ tic6x | c6x*) ++ basic_machine=tic6x-unknown ++ os=-coff ++ ;; ++ # This must be matched before tile*. ++ tilegx*) ++ basic_machine=tilegx-unknown ++ os=-linux-gnu ++ ;; ++ tile*) ++ basic_machine=tile-unknown ++ os=-linux-gnu ++ ;; + tx39) + basic_machine=mipstx39-unknown + ;; +@@ -934,6 +1109,10 @@ + tower | tower-32) + basic_machine=m68k-ncr + ;; ++ tpf) ++ basic_machine=s390x-ibm ++ os=-tpf ++ ;; + udi29k) + basic_machine=a29k-amd + os=-udi +@@ -977,9 +1156,9 @@ + basic_machine=hppa1.1-winbond + os=-proelf + ;; +- windows32) +- basic_machine=i386-pc +- os=-windows32-msvcrt ++ xbox) ++ basic_machine=i686-pc ++ os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell +@@ -992,6 +1171,10 @@ + basic_machine=z8k-unknown + os=-sim + ;; ++ z80-*-coff) ++ basic_machine=z80-unknown ++ os=-sim ++ ;; + none) + basic_machine=none-none + os=-none +@@ -1011,6 +1194,9 @@ + romp) + basic_machine=romp-ibm + ;; ++ mmix) ++ basic_machine=mmix-knuth ++ ;; + rs6000) + basic_machine=rs6000-ibm + ;; +@@ -1027,13 +1213,10 @@ + we32k) + basic_machine=we32k-att + ;; +- sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) ++ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; +- sh64) +- basic_machine=sh64-unknown +- ;; +- sparc | sparcv9 | sparcv9b) ++ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) +@@ -1080,6 +1263,9 @@ + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. ++ -auroraux) ++ os=-auroraux ++ ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; +@@ -1100,24 +1286,30 @@ + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ +- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ +- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ ++ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ ++ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ ++ | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ +- | -aos* \ ++ | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ +- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ +- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ ++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ ++ | -openbsd* | -solidbsd* \ ++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ ++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ +- | -chorusos* | -chorusrdb* \ ++ | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ +- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ ++ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* \ ++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ +- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) ++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ ++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) +@@ -1129,16 +1321,21 @@ + ;; + esac + ;; ++ -nto-qnx*) ++ ;; + -nto*) +- os=-nto-qnx ++ os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ +- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ ++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; ++ -linux-dietlibc) ++ os=-linux-dietlibc ++ ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; +@@ -1151,6 +1348,9 @@ + -opened*) + os=-openedition + ;; ++ -os400*) ++ os=-os400 ++ ;; + -wince*) + os=-wince + ;; +@@ -1172,6 +1372,9 @@ + -atheos*) + os=-atheos + ;; ++ -syllable*) ++ os=-syllable ++ ;; + -386bsd) + os=-bsd + ;; +@@ -1194,6 +1397,9 @@ + -sinix*) + os=-sysv4 + ;; ++ -tpf*) ++ os=-tpf ++ ;; + -triton*) + os=-sysv3 + ;; +@@ -1224,6 +1430,20 @@ + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; ++ -aros*) ++ os=-aros ++ ;; ++ -kaos*) ++ os=-kaos ++ ;; ++ -zvmoe) ++ os=-zvmoe ++ ;; ++ -dicos*) ++ os=-dicos ++ ;; ++ -nacl*) ++ ;; + -none) + ;; + *) +@@ -1246,6 +1466,12 @@ + # system, and we'll never get to this point. + + case $basic_machine in ++ score-*) ++ os=-elf ++ ;; ++ spu-*) ++ os=-elf ++ ;; + *-acorn) + os=-riscix1.2 + ;; +@@ -1255,6 +1481,9 @@ + arm*-semi) + os=-aout + ;; ++ c4x-* | tic4x-*) ++ os=-coff ++ ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 +@@ -1280,6 +1509,9 @@ + m68*-cisco) + os=-aout + ;; ++ mep-*) ++ os=-elf ++ ;; + mips*-cisco) + os=-elf + ;; +@@ -1298,9 +1530,15 @@ + *-be) + os=-beos + ;; ++ *-haiku) ++ os=-haiku ++ ;; + *-ibm) + os=-aix + ;; ++ *-knuth) ++ os=-mmixware ++ ;; + *-wec) + os=-proelf + ;; +@@ -1403,7 +1641,7 @@ + -sunos*) + vendor=sun + ;; +- -aix*) ++ -cnk*|-aix*) + vendor=ibm + ;; + -beos*) +@@ -1433,9 +1671,15 @@ + -mvs* | -opened*) + vendor=ibm + ;; ++ -os400*) ++ vendor=ibm ++ ;; + -ptx*) + vendor=sequent + ;; ++ -tpf*) ++ vendor=ibm ++ ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; +@@ -1460,7 +1704,7 @@ + esac + + echo $basic_machine$os +-exit 0 ++exit + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/libtextcat/makefile.mk b/libtextcat/makefile.mk index 33c7604..01a2a6e 100644 --- a/libtextcat/makefile.mk +++ b/libtextcat/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,6 +37,7 @@ TARGET=libtextcat # --- Files -------------------------------------------------------- TARFILE_NAME=libtextcat-2.2 +TARFILE_MD5=128cfc86ed5953e57fe0f5ae98b62c2e TARFILE_ROOTDIR=libtextcat-2.2 PATCH_FILES=libtextcat-2.2.patch @@ -58,7 +55,7 @@ ADDITIONAL_FILES= \ #relative to CONFIGURE_DIR CONFIGURE_ACTION=configure CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS)" -CONFIGURE_FLAGS= +CONFIGURE_FLAGS=$(eq,$(OS),MACOSX CPPFLAGS="$(EXTRA_CDEFS)" $(NULL)) BUILD_ACTION=make diff --git a/libtextcat/prj/build.lst b/libtextcat/prj/build.lst index e4bc4af..da155db 100644 --- a/libtextcat/prj/build.lst +++ b/libtextcat/prj/build.lst @@ -1,3 +1,3 @@ -ltc libtextcat : solenv sal NULL +ltc libtextcat : stlport soltools solenv NULL ltc libtextcat usr1 - all ltc_mkout NULL ltc libtextcat nmake - all ltc_libtextcat NULL diff --git a/libwpd/download/libwpd-0.8.8.tar.gz b/libwpd/download/libwpd-0.8.8.tar.gz Binary files differdeleted file mode 100644 index 866bc20..0000000 --- a/libwpd/download/libwpd-0.8.8.tar.gz +++ /dev/null diff --git a/libwpd/makefile.mk b/libwpd/makefile.mk index 0d66765..abca6ff 100644 --- a/libwpd/makefile.mk +++ b/libwpd/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.16 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -46,6 +42,7 @@ TARGET=wpd .ENDIF TARFILE_NAME=libwpd-0.8.8 +TARFILE_MD5=cd5997284f4ba1e8dde5d1e5869fc342 PATCH_FILES=$(TARFILE_NAME).diff BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) BUILD_DIR=src$/lib diff --git a/libwpd/prj/build.lst b/libwpd/prj/build.lst index 1da425b..7e5ae5c 100644 --- a/libwpd/prj/build.lst +++ b/libwpd/prj/build.lst @@ -1,3 +1,3 @@ -lw libwpd : soltools NULL +lw libwpd : soltools stlport NULL lw libwpd usr1 - all lw_mkout NULL lw libwpd nmake - all lw_libwpd NULL diff --git a/libxmlsec/download/xmlsec1-1.2.6.tar.gz b/libxmlsec/download/xmlsec1-1.2.6.tar.gz Binary files differdeleted file mode 100644 index f048be2..0000000 --- a/libxmlsec/download/xmlsec1-1.2.6.tar.gz +++ /dev/null diff --git a/libxmlsec/makefile.mk b/libxmlsec/makefile.mk index 950a490..b7dff3e 100644 --- a/libxmlsec/makefile.mk +++ b/libxmlsec/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.19 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -46,25 +42,41 @@ EXTERNAL_WARNINGS_NOT_ERRORS := TRUE # --- Files -------------------------------------------------------- -XMLSEC1VERSION=1.2.6 +XMLSEC1VERSION=1.2.14 TARFILE_NAME=$(PRJNAME)-$(XMLSEC1VERSION) -PATCH_FILES=$(TARFILE_NAME).patch +TARFILE_MD5=1f24ab1d39f4a51faf22244c94a6203f + +#xmlsec1-configure.patch: Set up the build. Straightforward configuration +#xmlsec1-configure-libxml-libxslt.patch: empty "$with_libxml" prepends /bin :-( +#xmlsec1-olderlibxml2.patch: Allow build against older libxml2, for macosx +#xmlsec1-nssdisablecallbacks.patch: Disable use of smime3 so don't need to package it +#xmlsec1-customkeymanage.patch: Could we do this alternatively outside xmlsec +#xmlsec1-nssmangleciphers.patch: Dubious, do we still need this ? +#xmlsec1-noverify.patch: As per readme.txt. +#xmlsec1-mingw32.patch: Mingw32 support. +#xmlsec1-mingw-customkeymanage-addmscrypto.patch builds the custom keymanager on mingw +PATCH_FILES=\ + xmlsec1-configure.patch \ + xmlsec1-configure-libxml-libxslt.patch \ + xmlsec1-olderlibxml2.patch \ + xmlsec1-nssdisablecallbacks.patch \ + xmlsec1-customkeymanage.patch \ + xmlsec1-nssmangleciphers.patch \ + xmlsec1-noverify.patch \ + xmlsec1-mingw32.patch \ + xmlsec1-mingw-keymgr-mscrypto.patch + ADDITIONAL_FILES= \ + include$/xmlsec$/mscrypto$/akmngr.h \ + src$/mscrypto$/akmngr.c \ include$/xmlsec$/nss$/akmngr.h \ include$/xmlsec$/nss$/ciphers.h \ include$/xmlsec$/nss$/tokens.h \ - include$/xmlsec$/mscrypto$/akmngr.h \ src$/nss$/akmngr.c \ - src$/mscrypto$/akmngr.c \ - src$/nss$/keytrans.c \ src$/nss$/keywrapers.c \ - src$/nss$/tokens.c \ - xmlsec-mscrypto.pc.in \ - include$/xmlsec$/mscrypto$/Makefile.in \ - src$/mscrypto$/Makefile.in \ - libxml2-config + src$/nss$/tokens.c .IF "$(GUI)"=="WNT" CRYPTOLIB=mscrypto @@ -77,9 +89,18 @@ CRYPTOLIB=nss .IF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" +xmlsec_CC=$(CC) -mthreads +.IF "$(MINGW_SHARED_GCCLIB)"=="YES" +xmlsec_CC+=-shared-libgcc +.ENDIF +xmlsec_LIBS= +.IF "$(MINGW_SHARED_GXXLIB)"=="YES" +xmlsec_LIBS+=-lstdc++_s +.ENDIF CONFIGURE_DIR= -CONFIGURE_ACTION=chmod 777 libxml2-config && .$/configure -CONFIGURE_FLAGS=--with-libxslt=no --with-openssl=no --with-gnutls=no --with-mozilla_ver=1.7.5 --with-mscrypto --build=i586-pc-mingw32 --host=i586-pc-mingw32 CFLAGS="-D_MT" LDFLAGS="-no-undefined -L$(ILIB:s/;/ -L/)" LIBS="-lmingwthrd" LIBXML2LIB="$(LIBXML2LIB)" ZLIB3RDLIB=$(ZLIB3RDLIB) OBJDUMP="$(WRAPCMD) objdump" +CONFIGURE_ACTION=.$/configure +CONFIGURE_FLAGS=--with-libxslt=no --with-openssl=no --with-gnutls=no --with-mozilla_ver=1.7.5 --enable-mscrypto --disable-crypto-dl --build=i586-pc-mingw32 --host=i586-pc-mingw32 CC="$(xmlsec_CC)" LDFLAGS="-no-undefined -L$(ILIB:s/;/ -L/)" LIBS="$(xmlsec_LIBS)" LIBXML2LIB=$(LIBXML2LIB) ZLIB3RDLIB=$(ZLIB3RDLIB) OBJDUMP="$(WRAPCMD) objdump" + .IF "$(SYSTEM_MOZILLA)" != "YES" CONFIGURE_FLAGS+=--enable-pkgconfig=no .ENDIF @@ -110,9 +131,12 @@ xmlsec_CFLAGS+=$(C_RESTRICTIONFLAGS) .ENDIF # "$(COMNAME)"=="sunpro5" .IF "$(EXTRA_CFLAGS)"!="" xmlsec_CFLAGS+=$(EXTRA_CFLAGS) +xmlsec_CPPFLAGS+=$(EXTRA_CFLAGS) .ENDIF # "$(EXTRA_CFLAGS)"!="" xmlsec_LDFLAGS+=-L$(SYSBASE)$/usr$/lib -.ENDIF # "$(SYSBASE)"!="" +.ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!="" +xmlsec_CPPFLAGS+=$(EXTRA_CDEFS) +.ENDIF .IF "$(OS)$(COM)"=="LINUXGCC" || "$(OS)$(COM)"=="FREEBSDGCC" xmlsec_LDFLAGS+=-Wl,-rpath,'$$$$ORIGIN:$$$$ORIGIN/../ure-link/lib' @@ -130,8 +154,8 @@ LDFLAGS:=$(xmlsec_LDFLAGS) .ENDIF CONFIGURE_DIR= -CONFIGURE_ACTION=chmod 777 libxml2-config && .$/configure ADDCFLAGS="$(xmlsec_CFLAGS)" CPPFLAGS="$(xmlsec_CPPFLAGS)" -CONFIGURE_FLAGS=--with-pic --disable-shared --with-libxslt=no --with-openssl=no --with-gnutls=no LIBXML2LIB="$(LIBXML2LIB)" ZLIB3RDLIB=$(ZLIB3RDLIB) +CONFIGURE_ACTION=.$/configure ADDCFLAGS="$(xmlsec_CFLAGS)" CPPFLAGS="$(xmlsec_CPPFLAGS)" +CONFIGURE_FLAGS=--with-pic --disable-shared --disable-crypto-dl --with-libxslt=no --with-openssl=no --with-gnutls=no LIBXML2LIB="$(LIBXML2LIB)" # system-mozilla needs pkgconfig to get the information about nss # FIXME: This also will enable pkg-config usage for libxml2. It *seems* # that the internal headers still are used when they are there but.... @@ -154,7 +178,7 @@ OUTDIR2INC=include$/xmlsec .IF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" OUT2LIB+=src$/.libs$/libxmlsec1.dll.a src$/nss$/.libs$/libxmlsec1-nss.dll.a src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll.a -OUT2BIN+=src$/.libs$/libxmlsec1-1.dll src$/nss$/.libs$/libxmlsec1-nss-1.dll src$/mscrypto$/.libs$/libxmlsec1-mscrypto-1.dll +OUT2BIN+=src$/.libs$/libxmlsec1.dll src$/nss$/.libs$/libxmlsec1-nss.dll src$/mscrypto$/.libs$/libxmlsec1-mscrypto.dll .ELSE OUT2LIB+=win32$/binaries$/*.lib OUT2BIN+=win32$/binaries$/*.dll diff --git a/libxmlsec/prj/build.lst b/libxmlsec/prj/build.lst index b557aa3..a4faaa8 100644 --- a/libxmlsec/prj/build.lst +++ b/libxmlsec/prj/build.lst @@ -1,3 +1,3 @@ -ls libxmlsec : stlport soltools LIBXML2:libxml2 MOZ:moz SO:moz_prebuilt sal NULL +ls libxmlsec : stlport soltools LIBXML2:libxml2 MOZ:moz SO:moz_prebuilt NULL ls libxmlsec usr1 - all ls_mkout NULL ls libxmlsec nmake - all ls_xmlsec1 NULL diff --git a/libxmlsec/readme.txt b/libxmlsec/readme.txt index 6217aef..55c6976 100644 --- a/libxmlsec/readme.txt +++ b/libxmlsec/readme.txt @@ -1,24 +1,32 @@ -The XML Security library has been modified, so that there is NO verification -of the certificate during sign or verification operation. On Windows this was -done in the function xmlSecMSCryptoX509StoreVerify (file -src/mscrypto/x509vfy.c) and on UNIX in xmlSecNssX509StoreVerify -(file src/nss/x509vfy.c). +The XML Security library has been modified, so that there is NO verification of +the certificate during sign or verification operation. On Windows this was done +in the function xmlSecMSCryptoX509StoreVerify (file src/mscrypto/x509vfy.c) and +on UNIX in xmlSecNssX509StoreVerify (file src/nss/x509vfy.c). -This change requires that the XML Signature contains in -Signature/KeyInfo/X509Data only entries which represent the same -certificate. -The implementation creates certificates from all of the X509Data children -(X509IssuerSerial, X509Certificate) and used to iterate over all certificates, -verify them and return the first "good" certificate. Now the first one is -used. +The implementation creates certificates from all of the X509Data children, such +as X509IssuerSerial and X509Certificate and stores them in a certificate store +(see xmlsec/src/mscrypto/x509.c:xmlSecMSCryptoX509DataNodeRead). It must then +find the certificate containing the public key which is used for validation +within that store. This is done in xmlSecMSCryptoX509StoreVerify. This function +however only takes those certificates into account which can be validated. This +was changed by the patch xmlsec1-noverify.patch, which prevents this certificate +validation. + +xmlSecMSCryptoX509StoreVerify iterates over all certificates contained or +referenced in the X509Data elements and selects one which is no issuer of any of +the other certificates. This certificate is not necessarily the one which was +used for signing but it must contain the proper validation key, which is +sufficient to validate the signature. See +http://www.w3.org/TR/xmldsig-core/#sec-X509Data +for details. + +There is a flag XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS that can be set +in a xmlSecKeyInfoCtx (see function xmlSecNssKeyDataX509XmlRead, in file +src/nss/x509.c), which indicates that one can turn off the validation. However, +setting it will cause that the validation key is not found. If the flag is set, +then the key is not extracted from the certificate store which contains all the +certificates of the X509Data elements. In other words, the certificates which +are delivered within the XML signature are not used when looking for suitable +validation key. -The X509IssuerSerial information is used by XML Security Library to find the -certificate in the certificate store on the machine. The X509Certificate entry -is used to create a certificate no matter if this is already contained in the -certificate store. -Do not forget: Suggest to XML Security Library to provide a way to carry out -signature operations without verification of certificates. There is flag -XMLSEC_KEYINFO_FLAGS_X509DATA_DONT_VERIFY_CERTS that can be set in a -xmlSecKeyInfoCtx (see function xmlSecNssKeyDataX509XmlRead, in file src/nss/x509.c), -which indicates such a possibility but it does not work. diff --git a/libxmlsec/xmlsec1-1.2.6.patch b/libxmlsec/xmlsec1-1.2.6.patch deleted file mode 100644 index eb5153d..0000000 --- a/libxmlsec/xmlsec1-1.2.6.patch +++ /dev/null @@ -1,15363 +0,0 @@ ---- misc/xmlsec1-1.2.6/apps/Makefile.in 2004-08-26 08:00:30.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/apps/Makefile.in 2008-06-29 23:44:19.000000000 +0200 -@@ -370,7 +370,7 @@ - $(CRYPTO_DEPS) \ - $(NULL) - --all: all-am -+all: - - .SUFFIXES: - .SUFFIXES: .c .lo .o .obj ---- misc/xmlsec1-1.2.6/configure 2004-08-26 08:00:34.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/configure 2008-06-29 23:44:19.000000000 +0200 -@@ -463,7 +463,7 @@ - # include <unistd.h> - #endif" - --ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os XMLSEC_VERSION XMLSEC_PACKAGE XMLSEC_VERSION_SAFE XMLSEC_VERSION_MAJOR XMLSEC_VERSION_MINOR XMLSEC_VERSION_SUBMINOR XMLSEC_VERSION_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL RM CP MV TAR HELP2MAN MAN2HTML U ANSI2KNR INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL PKG_CONFIG_ENABLED PKG_CONFIG LIBXML_CFLAGS LIBXML_LIBS LIBXML262_CFLAGS LIBXML262_LIBS LIBXML_CONFIG LIBXML_MIN_VERSION LIBXSLT_CFLAGS LIBXSLT_LIBS XMLSEC_NO_LIBXSLT LIBXSLT_CONFIG LIBXSLT_MIN_VERSION OPENSSL_CFLAGS OPENSSL_LIBS OPENSSL097_CFLAGS OPENSSL097_LIBS XMLSEC_NO_OPENSSL_TRUE XMLSEC_NO_OPENSSL_FALSE XMLSEC_NO_OPENSSL OPENSSL_CRYPTO_LIB OPENSSL_MIN_VERSION GNUTLS_CFLAGS GNUTLS_LIBS XMLSEC_NO_GNUTLS_TRUE XMLSEC_NO_GNUTLS_FALSE XMLSEC_NO_GNUTLS GNUTLS_CRYPTO_LIB GNUTLS_MIN_VERSION NSS_CFLAGS NSS_LIBS XMLSEC_NO_NSS_TRUE XMLSEC_NO_NSS_FALSE XMLSEC_NO_NSS NSS_CRYPTO_LIB NSS_MIN_VERSION NSPR_MIN_VERSION MOZILLA_MIN_VERSION XMLSEC_NO_SHA1_TRUE XMLSEC_NO_SHA1_FALSE XMLSEC_NO_SHA1 XMLSEC_NO_RIPEMD160_TRUE XMLSEC_NO_RIPEMD160_FALSE XMLSEC_NO_RIPEMD160 XMLSEC_NO_HMAC_TRUE XMLSEC_NO_HMAC_FALSE XMLSEC_NO_HMAC XMLSEC_NO_DSA_TRUE XMLSEC_NO_DSA_FALSE XMLSEC_NO_DSA XMLSEC_NO_RSA_TRUE XMLSEC_NO_RSA_FALSE XMLSEC_NO_RSA XMLSEC_NO_X509_TRUE XMLSEC_NO_X509_FALSE XMLSEC_NO_X509 XMLSEC_NO_DES_TRUE XMLSEC_NO_DES_FALSE XMLSEC_NO_DES XMLSEC_NO_AES_TRUE XMLSEC_NO_AES_FALSE XMLSEC_NO_AES XMLSEC_NO_XMLDSIG_TRUE XMLSEC_NO_XMLDSIG_FALSE XMLSEC_NO_XMLDSIG XMLSEC_NO_XMLENC_TRUE XMLSEC_NO_XMLENC_FALSE XMLSEC_NO_XMLENC XMLSEC_NO_XKMS_TRUE XMLSEC_NO_XKMS_FALSE XMLSEC_NO_XKMS XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_TRUE XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_FALSE XMLSEC_NO_CRYPTO_DYNAMIC_LOADING XMLSEC_DL_INCLUDES XMLSEC_DL_LIBS XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING XMLSEC_DOCDIR XMLSEC_STATIC_BINARIES XMLSEC_CORE_CFLAGS XMLSEC_CORE_LIBS XMLSEC_LIBDIR XMLSEC_OPENSSL_CFLAGS XMLSEC_OPENSSL_LIBS XMLSEC_GNUTLS_CFLAGS XMLSEC_GNUTLS_LIBS XMLSEC_NSS_CFLAGS XMLSEC_NSS_LIBS XMLSEC_CFLAGS XMLSEC_LIBS XMLSEC_DEFINES XMLSEC_APP_DEFINES XMLSEC_CRYPTO XMLSEC_CRYPTO_LIST XMLSEC_CRYPTO_DISABLED_LIST XMLSEC_CRYPTO_LIB XMLSEC_CRYPTO_CFLAGS XMLSEC_CRYPTO_LIBS XMLSEC_CRYPTO_PC_FILES_LIST LIBOBJS LTLIBOBJS' -+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os XMLSEC_VERSION XMLSEC_PACKAGE XMLSEC_VERSION_SAFE XMLSEC_VERSION_MAJOR XMLSEC_VERSION_MINOR XMLSEC_VERSION_SUBMINOR XMLSEC_VERSION_INFO INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL RM CP MV TAR HELP2MAN MAN2HTML U ANSI2KNR INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL PKG_CONFIG_ENABLED PKG_CONFIG LIBXML_CFLAGS LIBXML_LIBS LIBXML262_CFLAGS LIBXML262_LIBS LIBXML_CONFIG LIBXML_MIN_VERSION LIBXSLT_CFLAGS LIBXSLT_LIBS XMLSEC_NO_LIBXSLT LIBXSLT_CONFIG LIBXSLT_MIN_VERSION OPENSSL_CFLAGS OPENSSL_LIBS OPENSSL097_CFLAGS OPENSSL097_LIBS XMLSEC_NO_OPENSSL_TRUE XMLSEC_NO_OPENSSL_FALSE XMLSEC_NO_OPENSSL OPENSSL_CRYPTO_LIB OPENSSL_MIN_VERSION GNUTLS_CFLAGS GNUTLS_LIBS XMLSEC_NO_GNUTLS_TRUE XMLSEC_NO_GNUTLS_FALSE XMLSEC_NO_GNUTLS GNUTLS_CRYPTO_LIB GNUTLS_MIN_VERSION NSS_CFLAGS NSS_LIBS XMLSEC_NO_NSS_TRUE XMLSEC_NO_NSS_FALSE XMLSEC_NO_NSS NSS_CRYPTO_LIB NSS_MIN_VERSION NSPR_MIN_VERSION MOZILLA_MIN_VERSION MSCRYPTO_CFLAGS MSCRYPTO_LIBS XMLSEC_NO_SHA1_TRUE XMLSEC_NO_SHA1_FALSE XMLSEC_NO_SHA1 XMLSEC_NO_RIPEMD160_TRUE XMLSEC_NO_RIPEMD160_FALSE XMLSEC_NO_RIPEMD160 XMLSEC_NO_HMAC_TRUE XMLSEC_NO_HMAC_FALSE XMLSEC_NO_HMAC XMLSEC_NO_DSA_TRUE XMLSEC_NO_DSA_FALSE XMLSEC_NO_DSA XMLSEC_NO_RSA_TRUE XMLSEC_NO_RSA_FALSE XMLSEC_NO_RSA XMLSEC_NO_X509_TRUE XMLSEC_NO_X509_FALSE XMLSEC_NO_X509 XMLSEC_NO_DES_TRUE XMLSEC_NO_DES_FALSE XMLSEC_NO_DES XMLSEC_NO_AES_TRUE XMLSEC_NO_AES_FALSE XMLSEC_NO_AES XMLSEC_NO_XMLDSIG_TRUE XMLSEC_NO_XMLDSIG_FALSE XMLSEC_NO_XMLDSIG XMLSEC_NO_XMLENC_TRUE XMLSEC_NO_XMLENC_FALSE XMLSEC_NO_XMLENC XMLSEC_NO_XKMS_TRUE XMLSEC_NO_XKMS_FALSE XMLSEC_NO_XKMS XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_TRUE XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_FALSE XMLSEC_NO_CRYPTO_DYNAMIC_LOADING XMLSEC_DL_INCLUDES XMLSEC_DL_LIBS XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING XMLSEC_DOCDIR XMLSEC_STATIC_BINARIES XMLSEC_CORE_CFLAGS XMLSEC_CORE_LIBS XMLSEC_LIBDIR XMLSEC_OPENSSL_CFLAGS XMLSEC_OPENSSL_LIBS XMLSEC_GNUTLS_CFLAGS XMLSEC_GNUTLS_LIBS XMLSEC_NSS_CFLAGS XMLSEC_NSS_LIBS XMLSEC_CFLAGS XMLSEC_LIBS XMLSEC_DEFINES XMLSEC_APP_DEFINES XMLSEC_CRYPTO XMLSEC_CRYPTO_LIST XMLSEC_CRYPTO_DISABLED_LIST XMLSEC_CRYPTO_LIB XMLSEC_CRYPTO_CFLAGS XMLSEC_CRYPTO_LIBS XMLSEC_CRYPTO_PC_FILES_LIST LIBOBJS LTLIBOBJS' - ac_subst_files='' - - # Initialize some variables set by options. -@@ -1072,6 +1072,7 @@ - --with-nss=PFX nss location - --with-nspr=PFX nspr location (needed for NSS) - --with-mozilla-ver=VER mozilla version (alt to --with-nss, --with-nspr) -+ --with-mscrypto try to use mscrypto - --with-html-dir=PATH path to installed docs - - Some influential environment variables: -@@ -2045,8 +2046,8 @@ - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' --ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' --ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compile='$CC -c $ADDCFLAGS $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $ADDCFLAGS $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -@@ -2698,15 +2699,15 @@ - CFLAGS=$ac_save_CFLAGS - elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then -- CFLAGS="-g -O2" -+ CFLAGS="$ADDCFLAGS -g -O2" - else -- CFLAGS="-g" -+ CFLAGS="$ADDCFLAGS -g" - fi - else - if test "$GCC" = yes; then -- CFLAGS="-O2" -+ CFLAGS="$ADDCFLAGS -O2" - else -- CFLAGS= -+ CFLAGS="$ADDCFLAGS" - fi - fi - echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -@@ -6350,11 +6351,11 @@ - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - -- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ beos* | cygwin* | mingw* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - -- mingw* | pw32* | os2*) -+ pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' -@@ -6409,7 +6410,7 @@ - fi - ;; - -- mingw* | pw32* | os2*) -+ pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' -@@ -6752,7 +6753,7 @@ - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--exclude-libs,ALL ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -@@ -7778,7 +7779,7 @@ - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -9046,7 +9047,7 @@ - ;; - esac - output_verbose_link_cmd='echo' -- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring' -+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name @executable_path/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' -@@ -10088,7 +10089,7 @@ - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -- archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--exclude-libs,ALL ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -@@ -10816,10 +10817,10 @@ - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; -- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ beos* | cygwin* | mingw* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; -- mingw* | os2* | pw32*) -+ os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' -@@ -11497,7 +11498,7 @@ - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -13259,11 +13260,11 @@ - lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' - ;; - -- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ beos* | cygwin* | mingw* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - -- mingw* | pw32* | os2*) -+ pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' -@@ -13661,7 +13662,7 @@ - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -- archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--exclude-libs,ALL ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -@@ -14667,7 +14668,7 @@ - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -15607,11 +15608,11 @@ - lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; - -- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) -+ beos* | cygwin* | mingw* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - -- mingw* | pw32* | os2*) -+ pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' -@@ -15666,7 +15667,7 @@ - fi - ;; - -- mingw* | pw32* | os2*) -+ pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' -@@ -16009,7 +16010,7 @@ - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then -- archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' -+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--exclude-libs,ALL ${wl}--out-implib,$lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then -@@ -17035,7 +17036,7 @@ - ;; - - freebsd*) -- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` -+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) -@@ -24598,7 +24599,7 @@ - fi - - LIBXML_MIN_VERSION="2.4.2" --LIBXML_CONFIG="xml2-config" -+LIBXML_CONFIG="./libxml2-config" - LIBXML_CFLAGS="" - LIBXML_LIBS="" - LIBXML_FOUND="no" -@@ -25678,12 +25679,26 @@ - - XMLSEC_NO_NSS="1" - MOZILLA_MIN_VERSION="1.4" -+if test "z$MOZ_FLAVOUR" = "zfirefox" ; then -+ MOZILLA_MIN_VERSION="1.0" -+fi - NSS_MIN_VERSION="3.2" - NSPR_MIN_VERSION="4.0" - NSS_CFLAGS="" - NSS_LIBS="" --NSS_LIBS_LIST="-lnss3 -lsmime3" --NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" -+ -+case $host_os in -+cygwin* | mingw* | pw32*) -+ NSS_LIBS_LIST="-lnss3 -lsmime3" -+ NSPR_LIBS_LIST="-lnspr4" -+ ;; -+ -+*) -+ NSS_LIBS_LIST="-lnss3 -lsoftokn3 -lsmime3" -+ NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" -+ ;; -+esac -+ - NSS_CRYPTO_LIB="$PACKAGE-nss" - NSS_FOUND="no" - -@@ -25766,23 +25781,122 @@ - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then -- echo "$as_me:$LINENO: checking for mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION" >&5 --echo $ECHO_N "checking for mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION... $ECHO_C" >&6 -+ echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION" >&5 -+echo $ECHO_N "checking for $MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION... $ECHO_C" >&6 -+ -+ if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION" ; then -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+ succeeded=yes -+ -+ echo "$as_me:$LINENO: checking NSS_CFLAGS" >&5 -+echo $ECHO_N "checking NSS_CFLAGS... $ECHO_C" >&6 -+ NSS_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION"` -+ echo "$as_me:$LINENO: result: $NSS_CFLAGS" >&5 -+echo "${ECHO_T}$NSS_CFLAGS" >&6 -+ -+ echo "$as_me:$LINENO: checking NSS_LIBS" >&5 -+echo $ECHO_N "checking NSS_LIBS... $ECHO_C" >&6 -+ NSS_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION"` -+ echo "$as_me:$LINENO: result: $NSS_LIBS" >&5 -+echo "${ECHO_T}$NSS_LIBS" >&6 -+ else -+ NSS_CFLAGS="" -+ NSS_LIBS="" -+ ## If we have a custom action on failure, don't print errors, but -+ ## do set a variable so people can do so. -+ NSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION"` -+ -+ fi -+ -+ -+ -+ else -+ echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." -+ echo "*** See http://www.freedesktop.org/software/pkgconfig" -+ fi -+ fi -+ -+ if test $succeeded = yes; then -+ NSS_FOUND=yes -+ else -+ NSS_FOUND=no -+ fi -+ -+ echo "$as_me:$LINENO: result: $NSS_FOUND" >&5 -+echo "${ECHO_T}$NSS_FOUND" >&6 -+ if test "z$NSS_FOUND" = "zno" ; then -+ -+ succeeded=no -+ -+ if test -z "$PKG_CONFIG"; then -+ # Extract the first word of "pkg-config", so it can be a program name with args. -+set dummy pkg-config; ac_word=$2 -+echo "$as_me:$LINENO: checking for $ac_word" >&5 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ case $PKG_CONFIG in -+ [\\/]* | ?:[\\/]*) -+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+done -+ -+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" -+ ;; -+esac -+fi -+PKG_CONFIG=$ac_cv_path_PKG_CONFIG -+ -+if test -n "$PKG_CONFIG"; then -+ echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -+echo "${ECHO_T}$PKG_CONFIG" >&6 -+else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+fi -+ -+ fi -+ -+ if test "$PKG_CONFIG" = "no" ; then -+ echo "*** The pkg-config script could not be found. Make sure it is" -+ echo "*** in your path, or set the PKG_CONFIG environment variable" -+ echo "*** to the full path to pkg-config." -+ echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." -+ else -+ PKG_CONFIG_MIN_VERSION=0.9.0 -+ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then -+ echo "$as_me:$LINENO: checking for nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION" >&5 -+echo $ECHO_N "checking for nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION... $ECHO_C" >&6 - -- if $PKG_CONFIG --exists "mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION" ; then -+ if $PKG_CONFIG --exists "nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION" ; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - succeeded=yes - - echo "$as_me:$LINENO: checking NSS_CFLAGS" >&5 - echo $ECHO_N "checking NSS_CFLAGS... $ECHO_C" >&6 -- NSS_CFLAGS=`$PKG_CONFIG --cflags "mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION"` -+ NSS_CFLAGS=`$PKG_CONFIG --cflags "nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION"` - echo "$as_me:$LINENO: result: $NSS_CFLAGS" >&5 - echo "${ECHO_T}$NSS_CFLAGS" >&6 - - echo "$as_me:$LINENO: checking NSS_LIBS" >&5 - echo $ECHO_N "checking NSS_LIBS... $ECHO_C" >&6 -- NSS_LIBS=`$PKG_CONFIG --libs "mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION"` -+ NSS_LIBS=`$PKG_CONFIG --libs "nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION"` - echo "$as_me:$LINENO: result: $NSS_LIBS" >&5 - echo "${ECHO_T}$NSS_LIBS" >&6 - else -@@ -25790,7 +25904,7 @@ - NSS_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. -- NSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION"` -+ NSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION"` - - fi - -@@ -25808,6 +25922,9 @@ - NSS_FOUND=no - fi - -+ echo "$as_me:$LINENO: result: $NSS_FOUND" >&5 -+echo "${ECHO_T}$NSS_FOUND" >&6 -+ fi - fi - - if test "z$NSS_FOUND" = "zno" ; then -@@ -25817,8 +25934,8 @@ - ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION - fi - -- ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name" -- ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name" -+ ac_nss_lib_dir="${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT}" -+ ac_nss_inc_dir="${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/mozilla" - - echo "$as_me:$LINENO: checking for nspr libraries >= $NSPR_MIN_VERSION" >&5 - echo $ECHO_N "checking for nspr libraries >= $NSPR_MIN_VERSION... $ECHO_C" >&6 -@@ -25853,8 +25970,11 @@ - done - - for dir in $ac_nss_lib_dir ; do -- if test -f $dir/libnspr4.so ; then -- if test "z$dir" = "z/usr/lib" ; then -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib -o -f $dir/libnspr4.a ; then -+ # do not add -L/usr/lib because compiler does it anyway -+ if test "z$dir" = "z/usr/lib" ; then - NSPR_LIBS="$NSPR_LIBS_LIST" - else - if test "z$with_gnu_ld" = "zyes" ; then -@@ -25865,7 +25985,26 @@ - fi - NSPR_LIBS_FOUND="yes" - break -- fi -+ fi -+ ;; -+ -+ *) -+ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then -+ # do not add -L/usr/lib because compiler does it anyway -+ if test "z$dir" = "z/usr/lib" ; then -+ NSPR_LIBS="$NSPR_LIBS_LIST" -+ else -+ if test "z$with_gnu_ld" = "zyes" ; then -+ NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST" -+ else -+ NSPR_LIBS="-L$dir $NSPR_LIBS_LIST" -+ fi -+ fi -+ NSPR_LIBS_FOUND="yes" -+ break -+ fi -+ ;; -+ esac - done - fi - -@@ -25939,8 +26078,11 @@ - done - - for dir in $ac_nss_lib_dir ; do -- if test -f $dir/libnss3.so ; then -- if test "z$dir" = "z/usr/lib" ; then -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib -o -f $dir/libnss3.a ; then -+ # do not add -L/usr/lib because compiler does it anyway -+ if test "z$dir" = "z/usr/lib" ; then - NSS_LIBS="$NSS_LIBS_LIST" - else - if test "z$with_gnu_ld" = "zyes" ; then -@@ -25951,7 +26093,26 @@ - fi - NSS_LIBS_FOUND="yes" - break -- fi -+ fi -+ ;; -+ -+ *) -+ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then -+ # do not add -L/usr/lib because compiler does it anyway -+ if test "z$dir" = "z/usr/lib" ; then -+ NSS_LIBS="$NSS_LIBS_LIST" -+ else -+ if test "z$with_gnu_ld" = "zyes" ; then -+ NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST" -+ else -+ NSS_LIBS="-L$dir $NSS_LIBS_LIST" -+ fi -+ fi -+ NSS_LIBS_FOUND="yes" -+ break -+ fi -+ ;; -+ esac - done - fi - -@@ -26004,6 +26165,12 @@ - fi - fi - -+case $host_os in -+darwin*) -+ NSS_LIBS="$NSS_LIBS "`"$PERL" "$SOLARENV/bin/macosx-dylib-link-list.pl" $NSS_LIBS` -+ ;; -+esac -+ - if test "z$NSS_FOUND" = "zyes" ; then - XMLSEC_NO_NSS="0" - NSS_CFLAGS="$NSS_CFLAGS -DXMLSEC_CRYPTO_NSS=1" -@@ -26037,6 +26204,109 @@ - - - -+MSCRYPTO_CFLAGS="" -+MSCRYPTO_LIBS="" -+MSCRYPTO_FOUND="no" -+ -+ -+# Check whether --with-mscrypto or --without-mscrypto was given. -+if test "${with_mscrypto+set}" = set; then -+ withval="$with_mscrypto" -+ -+fi; -+if test "z$with_mscrypto" = "zno" ; then -+ echo "$as_me:$LINENO: checking for MSCRYPTO libraries" >&5 -+echo $ECHO_N "checking for MSCRYPTO libraries... $ECHO_C" >&6 -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+ MSCRYPTO_FOUND="without" -+else -+ ac_mscrypto_lib_dir="${PSDK_HOME}/lib" -+ ac_mscrypto_inc_dir="${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/external/mingw/include ${COMPATH}/include ${COMPATH}/include/w32api" -+ echo "$as_me:$LINENO: checking for mscrypto libraries" >&5 -+echo $ECHO_N "checking for mscrypto libraries... $ECHO_C" >&6 -+ MSCRYPTO_INCLUDES_FOUND="no" -+ MSCRYPTO_LIBS_FOUND="no" -+ WINCRYPT_H="" -+ -+ for dir in $ac_mscrypto_inc_dir ; do -+ if test -f $dir/wincrypt.h ; then -+ MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -I$dir" -+ MSCRYPTO_INCLUDES_FOUND="yes" -+ WINCRYPT_H="$dir/wincrypt.h" -+ break -+ fi -+ done -+ -+ for dir in $ac_mscrypto_lib_dir ; do -+ if test -f $dir/crypt32.lib ; then -+ if test "z$with_gnu_ld" = "zyes" ; then -+ MSCRYPTO_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $dir/crypt32.lib" -+ else -+ MSCRYPTO_LIBS="-L$dir $dir/crypt32.lib" -+ fi -+ MSCRYPTO_LIBS_FOUND="yes" -+ break -+ fi -+ done -+ -+ if test "z$MSCRYPTO_INCLUDES_FOUND" = "zyes" -a "z$MSCRYPTO_LIBS_FOUND" = "zyes" ; then -+ OLD_CPPFLAGS=$CPPFLAGS -+ CPPFLAGS="$MSCRYPTO_CFLAGS" -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+ -+ #include <wincrypt.h> -+ #if defined(_WINCRYPT_H) || defined(__WINCRYPT_H__) -+ yes -+ #endif -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "yes" >/dev/null 2>&1; then -+ -+ MSCRYPTO_FOUND=yes -+ -+else -+ -+ MSCRYPTO_FOUND=no -+ -+fi -+rm -f conftest* -+ -+ CPPFLAGS="$OLD_CPPFLAGS" -+ fi -+ -+ if test "z$MSCRYPTO_FOUND" = "zyes" ; then -+ echo "$as_me:$LINENO: result: yes" >&5 -+echo "${ECHO_T}yes" >&6 -+ else -+ echo "$as_me:$LINENO: result: no" >&5 -+echo "${ECHO_T}no" >&6 -+ fi -+ -+fi -+ -+if test "z$MSCRYPTO_FOUND" = "zyes" ; then -+ MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1" -+ -+ if test "z$XMLSEC_CRYPTO" = "z" ; then -+ XMLSEC_CRYPTO="mscrypto" -+ XMLSEC_CRYPTO_LIB="$PACKAGE-mscrypto" -+ XMLSEC_CRYPTO_CFLAGS="$MSCRYPTO_CFLAGS" -+ XMLSEC_CRYPTO_LIBS="$MSCRYPTO_LIBS" -+ fi -+ XMLSEC_CRYPTO_LIST="$XMLSEC_CRYPTO_LIST mscrypto" -+else -+ XMLSEC_CRYPTO_DISABLED_LIST="$XMLSEC_CRYPTO_DISABLED_LIST mscrypto" -+fi -+ -+ -+ - echo "$as_me:$LINENO: checking for crypto library" >&5 - echo $ECHO_N "checking for crypto library... $ECHO_C" >&6 - if test "z$XMLSEC_CRYPTO" = "z" ; then -@@ -26604,7 +26874,7 @@ - done - - -- ac_config_files="$ac_config_files include/xmlsec/version.h Makefile include/Makefile include/xmlsec/Makefile include/xmlsec/private/Makefile src/Makefile apps/Makefile docs/Makefile docs/api/Makefile man/Makefile xmlsec1Conf.sh:xmlsecConf.sh.in xmlsec1-config:xmlsec-config.in xmlsec1-openssl.pc:xmlsec-openssl.pc.in xmlsec1-gnutls.pc:xmlsec-gnutls.pc.in xmlsec1-nss.pc:xmlsec-nss.pc.in xmlsec1.spec:xmlsec.spec.in" -+ ac_config_files="$ac_config_files include/xmlsec/version.h Makefile include/Makefile include/xmlsec/Makefile include/xmlsec/private/Makefile src/Makefile apps/Makefile docs/Makefile docs/api/Makefile man/Makefile xmlsec1Conf.sh:xmlsecConf.sh.in xmlsec1-config:xmlsec-config.in xmlsec1-openssl.pc:xmlsec-openssl.pc.in xmlsec1-gnutls.pc:xmlsec-gnutls.pc.in xmlsec1-nss.pc:xmlsec-nss.pc.in xmlsec1-mscrypto.pc:xmlsec-mscrypto.pc.in xmlsec1.spec:xmlsec.spec.in" - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure - # tests run on this system so they can be shared between configure -@@ -27521,6 +27791,8 @@ - s,@NSS_MIN_VERSION@,$NSS_MIN_VERSION,;t t - s,@NSPR_MIN_VERSION@,$NSPR_MIN_VERSION,;t t - s,@MOZILLA_MIN_VERSION@,$MOZILLA_MIN_VERSION,;t t -+s,@MSCRYPTO_CFLAGS@,$MSCRYPTO_CFLAGS,;t t -+s,@MSCRYPTO_LIBS@,$MSCRYPTO_LIBS,;t t - s,@XMLSEC_NO_SHA1_TRUE@,$XMLSEC_NO_SHA1_TRUE,;t t - s,@XMLSEC_NO_SHA1_FALSE@,$XMLSEC_NO_SHA1_FALSE,;t t - s,@XMLSEC_NO_SHA1@,$XMLSEC_NO_SHA1,;t t -@@ -29231,6 +29503,8 @@ - s,@NSS_MIN_VERSION@,$NSS_MIN_VERSION,;t t - s,@NSPR_MIN_VERSION@,$NSPR_MIN_VERSION,;t t - s,@MOZILLA_MIN_VERSION@,$MOZILLA_MIN_VERSION,;t t -+s,@MSCRYPTO_CFLAGS@,$MSCRYPTO_CFLAGS,;t t -+s,@MSCRYPTO_LIBS@,$MSCRYPTO_LIBS,;t t - s,@XMLSEC_NO_SHA1_TRUE@,$XMLSEC_NO_SHA1_TRUE,;t t - s,@XMLSEC_NO_SHA1_FALSE@,$XMLSEC_NO_SHA1_FALSE,;t t - s,@XMLSEC_NO_SHA1@,$XMLSEC_NO_SHA1,;t t -@@ -30941,6 +31215,8 @@ - s,@NSS_MIN_VERSION@,$NSS_MIN_VERSION,;t t - s,@NSPR_MIN_VERSION@,$NSPR_MIN_VERSION,;t t - s,@MOZILLA_MIN_VERSION@,$MOZILLA_MIN_VERSION,;t t -+s,@MSCRYPTO_CFLAGS@,$MSCRYPTO_CFLAGS,;t t -+s,@MSCRYPTO_LIBS@,$MSCRYPTO_LIBS,;t t - s,@XMLSEC_NO_SHA1_TRUE@,$XMLSEC_NO_SHA1_TRUE,;t t - s,@XMLSEC_NO_SHA1_FALSE@,$XMLSEC_NO_SHA1_FALSE,;t t - s,@XMLSEC_NO_SHA1@,$XMLSEC_NO_SHA1,;t t -@@ -32653,6 +32929,1724 @@ - s,@NSS_MIN_VERSION@,$NSS_MIN_VERSION,;t t - s,@NSPR_MIN_VERSION@,$NSPR_MIN_VERSION,;t t - s,@MOZILLA_MIN_VERSION@,$MOZILLA_MIN_VERSION,;t t -+s,@MSCRYPTO_CFLAGS@,$MSCRYPTO_CFLAGS,;t t -+s,@MSCRYPTO_LIBS@,$MSCRYPTO_LIBS,;t t -+s,@XMLSEC_NO_SHA1_TRUE@,$XMLSEC_NO_SHA1_TRUE,;t t -+s,@XMLSEC_NO_SHA1_FALSE@,$XMLSEC_NO_SHA1_FALSE,;t t -+s,@XMLSEC_NO_SHA1@,$XMLSEC_NO_SHA1,;t t -+s,@XMLSEC_NO_RIPEMD160_TRUE@,$XMLSEC_NO_RIPEMD160_TRUE,;t t -+s,@XMLSEC_NO_RIPEMD160_FALSE@,$XMLSEC_NO_RIPEMD160_FALSE,;t t -+s,@XMLSEC_NO_RIPEMD160@,$XMLSEC_NO_RIPEMD160,;t t -+s,@XMLSEC_NO_HMAC_TRUE@,$XMLSEC_NO_HMAC_TRUE,;t t -+s,@XMLSEC_NO_HMAC_FALSE@,$XMLSEC_NO_HMAC_FALSE,;t t -+s,@XMLSEC_NO_HMAC@,$XMLSEC_NO_HMAC,;t t -+s,@XMLSEC_NO_DSA_TRUE@,$XMLSEC_NO_DSA_TRUE,;t t -+s,@XMLSEC_NO_DSA_FALSE@,$XMLSEC_NO_DSA_FALSE,;t t -+s,@XMLSEC_NO_DSA@,$XMLSEC_NO_DSA,;t t -+s,@XMLSEC_NO_RSA_TRUE@,$XMLSEC_NO_RSA_TRUE,;t t -+s,@XMLSEC_NO_RSA_FALSE@,$XMLSEC_NO_RSA_FALSE,;t t -+s,@XMLSEC_NO_RSA@,$XMLSEC_NO_RSA,;t t -+s,@XMLSEC_NO_X509_TRUE@,$XMLSEC_NO_X509_TRUE,;t t -+s,@XMLSEC_NO_X509_FALSE@,$XMLSEC_NO_X509_FALSE,;t t -+s,@XMLSEC_NO_X509@,$XMLSEC_NO_X509,;t t -+s,@XMLSEC_NO_DES_TRUE@,$XMLSEC_NO_DES_TRUE,;t t -+s,@XMLSEC_NO_DES_FALSE@,$XMLSEC_NO_DES_FALSE,;t t -+s,@XMLSEC_NO_DES@,$XMLSEC_NO_DES,;t t -+s,@XMLSEC_NO_AES_TRUE@,$XMLSEC_NO_AES_TRUE,;t t -+s,@XMLSEC_NO_AES_FALSE@,$XMLSEC_NO_AES_FALSE,;t t -+s,@XMLSEC_NO_AES@,$XMLSEC_NO_AES,;t t -+s,@XMLSEC_NO_XMLDSIG_TRUE@,$XMLSEC_NO_XMLDSIG_TRUE,;t t -+s,@XMLSEC_NO_XMLDSIG_FALSE@,$XMLSEC_NO_XMLDSIG_FALSE,;t t -+s,@XMLSEC_NO_XMLDSIG@,$XMLSEC_NO_XMLDSIG,;t t -+s,@XMLSEC_NO_XMLENC_TRUE@,$XMLSEC_NO_XMLENC_TRUE,;t t -+s,@XMLSEC_NO_XMLENC_FALSE@,$XMLSEC_NO_XMLENC_FALSE,;t t -+s,@XMLSEC_NO_XMLENC@,$XMLSEC_NO_XMLENC,;t t -+s,@XMLSEC_NO_XKMS_TRUE@,$XMLSEC_NO_XKMS_TRUE,;t t -+s,@XMLSEC_NO_XKMS_FALSE@,$XMLSEC_NO_XKMS_FALSE,;t t -+s,@XMLSEC_NO_XKMS@,$XMLSEC_NO_XKMS,;t t -+s,@XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_TRUE@,$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_TRUE,;t t -+s,@XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_FALSE@,$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_FALSE,;t t -+s,@XMLSEC_NO_CRYPTO_DYNAMIC_LOADING@,$XMLSEC_NO_CRYPTO_DYNAMIC_LOADING,;t t -+s,@XMLSEC_DL_INCLUDES@,$XMLSEC_DL_INCLUDES,;t t -+s,@XMLSEC_DL_LIBS@,$XMLSEC_DL_LIBS,;t t -+s,@XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE@,$XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE,;t t -+s,@XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE@,$XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE,;t t -+s,@XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING@,$XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING,;t t -+s,@XMLSEC_DOCDIR@,$XMLSEC_DOCDIR,;t t -+s,@XMLSEC_STATIC_BINARIES@,$XMLSEC_STATIC_BINARIES,;t t -+s,@XMLSEC_CORE_CFLAGS@,$XMLSEC_CORE_CFLAGS,;t t -+s,@XMLSEC_CORE_LIBS@,$XMLSEC_CORE_LIBS,;t t -+s,@XMLSEC_LIBDIR@,$XMLSEC_LIBDIR,;t t -+s,@XMLSEC_OPENSSL_CFLAGS@,$XMLSEC_OPENSSL_CFLAGS,;t t -+s,@XMLSEC_OPENSSL_LIBS@,$XMLSEC_OPENSSL_LIBS,;t t -+s,@XMLSEC_GNUTLS_CFLAGS@,$XMLSEC_GNUTLS_CFLAGS,;t t -+s,@XMLSEC_GNUTLS_LIBS@,$XMLSEC_GNUTLS_LIBS,;t t -+s,@XMLSEC_NSS_CFLAGS@,$XMLSEC_NSS_CFLAGS,;t t -+s,@XMLSEC_NSS_LIBS@,$XMLSEC_NSS_LIBS,;t t -+s,@XMLSEC_CFLAGS@,$XMLSEC_CFLAGS,;t t -+s,@XMLSEC_LIBS@,$XMLSEC_LIBS,;t t -+s,@XMLSEC_DEFINES@,$XMLSEC_DEFINES,;t t -+s,@XMLSEC_APP_DEFINES@,$XMLSEC_APP_DEFINES,;t t -+s,@XMLSEC_CRYPTO@,$XMLSEC_CRYPTO,;t t -+s,@XMLSEC_CRYPTO_LIST@,$XMLSEC_CRYPTO_LIST,;t t -+s,@XMLSEC_CRYPTO_DISABLED_LIST@,$XMLSEC_CRYPTO_DISABLED_LIST,;t t -+s,@XMLSEC_CRYPTO_LIB@,$XMLSEC_CRYPTO_LIB,;t t -+s,@XMLSEC_CRYPTO_CFLAGS@,$XMLSEC_CRYPTO_CFLAGS,;t t -+s,@XMLSEC_CRYPTO_LIBS@,$XMLSEC_CRYPTO_LIBS,;t t -+s,@XMLSEC_CRYPTO_PC_FILES_LIST@,$XMLSEC_CRYPTO_PC_FILES_LIST,;t t -+s,@LIBOBJS@,$LIBOBJS,;t t -+s,@LTLIBOBJS@,$LTLIBOBJS,;t t -+CEOF -+ -+_ACEOF -+ -+ cat >>$CONFIG_STATUS <<\_ACEOF -+ # Split the substitutions into bite-sized pieces for seds with -+ # small command number limits, like on Digital OSF/1 and HP-UX. -+ ac_max_sed_lines=48 -+ ac_sed_frag=1 # Number of current file. -+ ac_beg=1 # First line for current file. -+ ac_end=$ac_max_sed_lines # Line after last line for current file. -+ ac_more_lines=: -+ ac_sed_cmds= -+ while $ac_more_lines; do -+ if test $ac_beg -gt 1; then -+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag -+ else -+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag -+ fi -+ if test ! -s $tmp/subs.frag; then -+ ac_more_lines=false -+ else -+ # The purpose of the label and of the branching condition is to -+ # speed up the sed processing (if there are no `@' at all, there -+ # is no need to browse any of the substitutions). -+ # These are the two extra sed commands mentioned above. -+ (echo ':t -+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed -+ if test -z "$ac_sed_cmds"; then -+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" -+ else -+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" -+ fi -+ ac_sed_frag=`expr $ac_sed_frag + 1` -+ ac_beg=$ac_end -+ ac_end=`expr $ac_end + $ac_max_sed_lines` -+ fi -+ done -+ if test -z "$ac_sed_cmds"; then -+ ac_sed_cmds=cat -+ fi -+fi # test -n "$CONFIG_FILES" -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF -+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue -+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". -+ case $ac_file in -+ - | *:- | *:-:* ) # input from stdin -+ cat >$tmp/stdin -+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ * ) ac_file_in=$ac_file.in ;; -+ esac -+ -+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. -+ ac_dir=`(dirname "$ac_file") 2>/dev/null || -+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$ac_file" : 'X\(//\)[^/]' \| \ -+ X"$ac_file" : 'X\(//\)$' \| \ -+ X"$ac_file" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$ac_file" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ { if $as_mkdir_p; then -+ mkdir -p "$ac_dir" -+ else -+ as_dir="$ac_dir" -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} -+ { (exit 1); exit 1; }; }; } -+ -+ ac_builddir=. -+ -+if test "$ac_dir" != .; then -+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` -+ # A "../" for each directory in $ac_dir_suffix. -+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -+else -+ ac_dir_suffix= ac_top_builddir= -+fi -+ -+case $srcdir in -+ .) # No --srcdir option. We are building in place. -+ ac_srcdir=. -+ if test -z "$ac_top_builddir"; then -+ ac_top_srcdir=. -+ else -+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` -+ fi ;; -+ [\\/]* | ?:[\\/]* ) # Absolute path. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir ;; -+ *) # Relative path. -+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_builddir$srcdir ;; -+esac -+ -+# Do not use `cd foo && pwd` to compute absolute paths, because -+# the directories may not exist. -+case `pwd` in -+.) ac_abs_builddir="$ac_dir";; -+*) -+ case "$ac_dir" in -+ .) ac_abs_builddir=`pwd`;; -+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; -+ *) ac_abs_builddir=`pwd`/"$ac_dir";; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_builddir=${ac_top_builddir}.;; -+*) -+ case ${ac_top_builddir}. in -+ .) ac_abs_top_builddir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; -+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_srcdir=$ac_srcdir;; -+*) -+ case $ac_srcdir in -+ .) ac_abs_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; -+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_srcdir=$ac_top_srcdir;; -+*) -+ case $ac_top_srcdir in -+ .) ac_abs_top_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; -+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; -+ esac;; -+esac -+ -+ -+ case $INSTALL in -+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; -+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; -+ esac -+ -+ if test x"$ac_file" != x-; then -+ { echo "$as_me:$LINENO: creating $ac_file" >&5 -+echo "$as_me: creating $ac_file" >&6;} -+ rm -f "$ac_file" -+ fi -+ # Let's still pretend it is `configure' which instantiates (i.e., don't -+ # use $as_me), people would be surprised to read: -+ # /* config.h. Generated by config.status. */ -+ if test x"$ac_file" = x-; then -+ configure_input= -+ else -+ configure_input="$ac_file. " -+ fi -+ configure_input=$configure_input"Generated from `echo $ac_file_in | -+ sed 's,.*/,,'` by configure." -+ -+ # First look for the input files in the build tree, otherwise in the -+ # src tree. -+ ac_file_inputs=`IFS=: -+ for f in $ac_file_in; do -+ case $f in -+ -) echo $tmp/stdin ;; -+ [\\/$]*) -+ # Absolute (can't be DOS-style, as IFS=:) -+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+echo "$as_me: error: cannot find input file: $f" >&2;} -+ { (exit 1); exit 1; }; } -+ echo "$f";; -+ *) # Relative -+ if test -f "$f"; then -+ # Build tree -+ echo "$f" -+ elif test -f "$srcdir/$f"; then -+ # Source tree -+ echo "$srcdir/$f" -+ else -+ # /dev/null tree -+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+echo "$as_me: error: cannot find input file: $f" >&2;} -+ { (exit 1); exit 1; }; } -+ fi;; -+ esac -+ done` || { (exit 1); exit 1; } -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF -+ sed "$ac_vpsub -+$extrasub -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF -+:t -+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -+s,@configure_input@,$configure_input,;t t -+s,@srcdir@,$ac_srcdir,;t t -+s,@abs_srcdir@,$ac_abs_srcdir,;t t -+s,@top_srcdir@,$ac_top_srcdir,;t t -+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -+s,@builddir@,$ac_builddir,;t t -+s,@abs_builddir@,$ac_abs_builddir,;t t -+s,@top_builddir@,$ac_top_builddir,;t t -+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -+s,@INSTALL@,$ac_INSTALL,;t t -+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out -+ rm -f $tmp/stdin -+ if test x"$ac_file" != x-; then -+ mv $tmp/out $ac_file -+ else -+ cat $tmp/out -+ rm -f $tmp/out -+ fi -+ -+done -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF -+ -+# -+# CONFIG_HEADER section. -+# -+ -+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -+# NAME is the cpp macro being defined and VALUE is the value it is being given. -+# -+# ac_d sets the value in "#define NAME VALUE" lines. -+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -+ac_dB='[ ].*$,\1#\2' -+ac_dC=' ' -+ac_dD=',;t' -+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -+ac_uB='$,\1#\2define\3' -+ac_uC=' ' -+ac_uD=',;t' -+ -+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue -+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". -+ case $ac_file in -+ - | *:- | *:-:* ) # input from stdin -+ cat >$tmp/stdin -+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; -+ * ) ac_file_in=$ac_file.in ;; -+ esac -+ -+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -+echo "$as_me: creating $ac_file" >&6;} -+ -+ # First look for the input files in the build tree, otherwise in the -+ # src tree. -+ ac_file_inputs=`IFS=: -+ for f in $ac_file_in; do -+ case $f in -+ -) echo $tmp/stdin ;; -+ [\\/$]*) -+ # Absolute (can't be DOS-style, as IFS=:) -+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+echo "$as_me: error: cannot find input file: $f" >&2;} -+ { (exit 1); exit 1; }; } -+ # Do quote $f, to prevent DOS paths from being IFS'd. -+ echo "$f";; -+ *) # Relative -+ if test -f "$f"; then -+ # Build tree -+ echo "$f" -+ elif test -f "$srcdir/$f"; then -+ # Source tree -+ echo "$srcdir/$f" -+ else -+ # /dev/null tree -+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -+echo "$as_me: error: cannot find input file: $f" >&2;} -+ { (exit 1); exit 1; }; } -+ fi;; -+ esac -+ done` || { (exit 1); exit 1; } -+ # Remove the trailing spaces. -+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in -+ -+_ACEOF -+ -+# Transform confdefs.h into two sed scripts, `conftest.defines' and -+# `conftest.undefs', that substitutes the proper values into -+# config.h.in to produce config.h. The first handles `#define' -+# templates, and the second `#undef' templates. -+# And first: Protect against being on the right side of a sed subst in -+# config.status. Protect against being in an unquoted here document -+# in config.status. -+rm -f conftest.defines conftest.undefs -+# Using a here document instead of a string reduces the quoting nightmare. -+# Putting comments in sed scripts is not portable. -+# -+# `end' is used to avoid that the second main sed command (meant for -+# 0-ary CPP macros) applies to n-ary macro definitions. -+# See the Autoconf documentation for `clear'. -+cat >confdef2sed.sed <<\_ACEOF -+s/[\\&,]/\\&/g -+s,[\\$`],\\&,g -+t clear -+: clear -+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -+t end -+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -+: end -+_ACEOF -+# If some macros were called several times there might be several times -+# the same #defines, which is useless. Nevertheless, we may not want to -+# sort them, since we want the *last* AC-DEFINE to be honored. -+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -+rm -f confdef2sed.sed -+ -+# This sed command replaces #undef with comments. This is necessary, for -+# example, in the case of _POSIX_SOURCE, which is predefined and required -+# on some systems where configure will not decide to define it. -+cat >>conftest.undefs <<\_ACEOF -+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -+_ACEOF -+ -+# Break up conftest.defines because some shells have a limit on the size -+# of here documents, and old seds have small limits too (100 cmds). -+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -+echo ' :' >>$CONFIG_STATUS -+rm -f conftest.tail -+while grep . conftest.defines >/dev/null -+do -+ # Write a limited-size here document to $tmp/defines.sed. -+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS -+ # Speed up: don't consider the non `#define' lines. -+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS -+ # Work around the forget-to-reset-the-flag bug. -+ echo 't clr' >>$CONFIG_STATUS -+ echo ': clr' >>$CONFIG_STATUS -+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS -+ echo 'CEOF -+ sed -f $tmp/defines.sed $tmp/in >$tmp/out -+ rm -f $tmp/in -+ mv $tmp/out $tmp/in -+' >>$CONFIG_STATUS -+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail -+ rm -f conftest.defines -+ mv conftest.tail conftest.defines -+done -+rm -f conftest.defines -+echo ' fi # grep' >>$CONFIG_STATUS -+echo >>$CONFIG_STATUS -+ -+# Break up conftest.undefs because some shells have a limit on the size -+# of here documents, and old seds have small limits too (100 cmds). -+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -+rm -f conftest.tail -+while grep . conftest.undefs >/dev/null -+do -+ # Write a limited-size here document to $tmp/undefs.sed. -+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS -+ # Speed up: don't consider the non `#undef' -+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS -+ # Work around the forget-to-reset-the-flag bug. -+ echo 't clr' >>$CONFIG_STATUS -+ echo ': clr' >>$CONFIG_STATUS -+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS -+ echo 'CEOF -+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out -+ rm -f $tmp/in -+ mv $tmp/out $tmp/in -+' >>$CONFIG_STATUS -+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail -+ rm -f conftest.undefs -+ mv conftest.tail conftest.undefs -+done -+rm -f conftest.undefs -+ -+cat >>$CONFIG_STATUS <<\_ACEOF -+ # Let's still pretend it is `configure' which instantiates (i.e., don't -+ # use $as_me), people would be surprised to read: -+ # /* config.h. Generated by config.status. */ -+ if test x"$ac_file" = x-; then -+ echo "/* Generated by configure. */" >$tmp/config.h -+ else -+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h -+ fi -+ cat $tmp/in >>$tmp/config.h -+ rm -f $tmp/in -+ if test x"$ac_file" != x-; then -+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then -+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -+echo "$as_me: $ac_file is unchanged" >&6;} -+ else -+ ac_dir=`(dirname "$ac_file") 2>/dev/null || -+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$ac_file" : 'X\(//\)[^/]' \| \ -+ X"$ac_file" : 'X\(//\)$' \| \ -+ X"$ac_file" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$ac_file" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ { if $as_mkdir_p; then -+ mkdir -p "$ac_dir" -+ else -+ as_dir="$ac_dir" -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} -+ { (exit 1); exit 1; }; }; } -+ -+ rm -f $ac_file -+ mv $tmp/config.h $ac_file -+ fi -+ else -+ cat $tmp/config.h -+ rm -f $tmp/config.h -+ fi -+# Compute $ac_file's index in $config_headers. -+_am_stamp_count=1 -+for _am_header in $config_headers :; do -+ case $_am_header in -+ $ac_file | $ac_file:* ) -+ break ;; -+ * ) -+ _am_stamp_count=`expr $_am_stamp_count + 1` ;; -+ esac -+done -+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || -+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X$ac_file : 'X\(//\)[^/]' \| \ -+ X$ac_file : 'X\(//\)$' \| \ -+ X$ac_file : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X$ac_file | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'`/stamp-h$_am_stamp_count -+done -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF -+ -+# -+# CONFIG_COMMANDS section. -+# -+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue -+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'` -+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` -+ ac_dir=`(dirname "$ac_dest") 2>/dev/null || -+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$ac_dest" : 'X\(//\)[^/]' \| \ -+ X"$ac_dest" : 'X\(//\)$' \| \ -+ X"$ac_dest" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$ac_dest" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ { if $as_mkdir_p; then -+ mkdir -p "$ac_dir" -+ else -+ as_dir="$ac_dir" -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} -+ { (exit 1); exit 1; }; }; } -+ -+ ac_builddir=. -+ -+if test "$ac_dir" != .; then -+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` -+ # A "../" for each directory in $ac_dir_suffix. -+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -+else -+ ac_dir_suffix= ac_top_builddir= -+fi -+ -+case $srcdir in -+ .) # No --srcdir option. We are building in place. -+ ac_srcdir=. -+ if test -z "$ac_top_builddir"; then -+ ac_top_srcdir=. -+ else -+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` -+ fi ;; -+ [\\/]* | ?:[\\/]* ) # Absolute path. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir ;; -+ *) # Relative path. -+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_builddir$srcdir ;; -+esac -+ -+# Do not use `cd foo && pwd` to compute absolute paths, because -+# the directories may not exist. -+case `pwd` in -+.) ac_abs_builddir="$ac_dir";; -+*) -+ case "$ac_dir" in -+ .) ac_abs_builddir=`pwd`;; -+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; -+ *) ac_abs_builddir=`pwd`/"$ac_dir";; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_builddir=${ac_top_builddir}.;; -+*) -+ case ${ac_top_builddir}. in -+ .) ac_abs_top_builddir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; -+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_srcdir=$ac_srcdir;; -+*) -+ case $ac_srcdir in -+ .) ac_abs_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; -+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; -+ esac;; -+esac -+case $ac_abs_builddir in -+.) ac_abs_top_srcdir=$ac_top_srcdir;; -+*) -+ case $ac_top_srcdir in -+ .) ac_abs_top_srcdir=$ac_abs_builddir;; -+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; -+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; -+ esac;; -+esac -+ -+ -+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -+echo "$as_me: executing $ac_dest commands" >&6;} -+ case $ac_dest in -+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do -+ # Strip MF so we end up with the name of the file. -+ mf=`echo "$mf" | sed -e 's/:.*$//'` -+ # Check whether this is an Automake generated Makefile or not. -+ # We used to match only the files named `Makefile.in', but -+ # some people rename them; so instead we look at the file content. -+ # Grep'ing the first line is not enough: some people post-process -+ # each Makefile.in and add a new line on top of each file to say so. -+ # So let's grep whole file. -+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then -+ dirpart=`(dirname "$mf") 2>/dev/null || -+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$mf" : 'X\(//\)[^/]' \| \ -+ X"$mf" : 'X\(//\)$' \| \ -+ X"$mf" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$mf" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ else -+ continue -+ fi -+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue -+ # Extract the definition of DEP_FILES from the Makefile without -+ # running `make'. -+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` -+ test -z "$DEPDIR" && continue -+ # When using ansi2knr, U may be empty or an underscore; expand it -+ U=`sed -n 's/^U = //p' < "$mf"` -+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" -+ # We invoke sed twice because it is the simplest approach to -+ # changing $(DEPDIR) to its actual value in the expansion. -+ for file in `sed -n ' -+ /^DEP_FILES = .*\\\\$/ { -+ s/^DEP_FILES = // -+ :loop -+ s/\\\\$// -+ p -+ n -+ /\\\\$/ b loop -+ p -+ } -+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ -+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do -+ # Make sure the directory exists. -+ test -f "$dirpart/$file" && continue -+ fdir=`(dirname "$file") 2>/dev/null || -+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$file" : 'X\(//\)[^/]' \| \ -+ X"$file" : 'X\(//\)$' \| \ -+ X"$file" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$file" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ { if $as_mkdir_p; then -+ mkdir -p $dirpart/$fdir -+ else -+ as_dir=$dirpart/$fdir -+ as_dirs= -+ while test ! -d "$as_dir"; do -+ as_dirs="$as_dir $as_dirs" -+ as_dir=`(dirname "$as_dir") 2>/dev/null || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } -+ /^X\(\/\/\)[^/].*/{ s//\1/; q; } -+ /^X\(\/\/\)$/{ s//\1/; q; } -+ /^X\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ done -+ test ! -n "$as_dirs" || mkdir $as_dirs -+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} -+ { (exit 1); exit 1; }; }; } -+ -+ # echo "creating $dirpart/$file" -+ echo '# dummy' > "$dirpart/$file" -+ done -+done -+ ;; -+ esac -+done -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF -+ -+{ (exit 0); exit 0; } -+_ACEOF -+chmod +x $CONFIG_STATUS -+ac_clean_files=$ac_clean_files_save -+ -+ -+# configure is writing to config.log, and then calls config.status. -+# config.status does its own redirection, appending to config.log. -+# Unfortunately, on DOS this fails, as config.log is still kept open -+# by configure, so config.status won't be able to write to it; its -+# output is simply discarded. So we exec the FD to /dev/null, -+# effectively closing config.log, so it can be properly (re)opened and -+# appended to by config.status. When coming back to configure, we -+# need to make the FD available again. -+if test "$no_create" != yes; then -+ ac_cs_success=: -+ ac_config_status_args= -+ test "$silent" = yes && -+ ac_config_status_args="$ac_config_status_args --quiet" -+ exec 5>/dev/null -+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false -+ exec 5>>config.log -+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which -+ # would make configure fail if this is the last instruction. -+ $ac_cs_success || { (exit 1); exit 1; } -+fi -+ -+fi -+ -+if test "z$MSCRYPTO_FOUND" = "zyes" ; then -+ ac_config_files="$ac_config_files include/xmlsec/mscrypto/Makefile src/mscrypto/Makefile" -+cat >confcache <<\_ACEOF -+# This file is a shell script that caches the results of configure -+# tests run on this system so they can be shared between configure -+# scripts and configure runs, see configure's option --config-cache. -+# It is not useful on other systems. If it contains results you don't -+# want to keep, you may remove or edit it. -+# -+# config.status only pays attention to the cache file if you give it -+# the --recheck option to rerun configure. -+# -+# `ac_cv_env_foo' variables (set or unset) will be overridden when -+# loading this file, other *unset* `ac_cv_foo' will be assigned the -+# following values. -+ -+_ACEOF -+ -+# The following way of writing the cache mishandles newlines in values, -+# but we know of no workaround that is simple, portable, and efficient. -+# So, don't put newlines in cache variables' values. -+# Ultrix sh set writes to stderr and can't be redirected directly, -+# and sets the high bit in the cache file unless we assign to the vars. -+{ -+ (set) 2>&1 | -+ case `(ac_space=' '; set | grep ac_space) 2>&1` in -+ *ac_space=\ *) -+ # `set' does not quote correctly, so add quotes (double-quote -+ # substitution turns \\\\ into \\, and sed turns \\ into \). -+ sed -n \ -+ "s/'/'\\\\''/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" -+ ;; -+ *) -+ # `set' quotes correctly as required by POSIX, so do not add quotes. -+ sed -n \ -+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" -+ ;; -+ esac; -+} | -+ sed ' -+ t clear -+ : clear -+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ -+ t end -+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ -+ : end' >>confcache -+if diff $cache_file confcache >/dev/null 2>&1; then :; else -+ if test -w $cache_file; then -+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" -+ cat confcache >$cache_file -+ else -+ echo "not updating unwritable cache $cache_file" -+ fi -+fi -+rm -f confcache -+ -+test "x$prefix" = xNONE && prefix=$ac_default_prefix -+# Let make expand exec_prefix. -+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ -+# VPATH may cause trouble with some makes, so we remove $(srcdir), -+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -+# trailing colons and then remove the whole line if VPATH becomes empty -+# (actually we leave an empty line to preserve line numbers). -+if test "x$srcdir" = x.; then -+ ac_vpsub='/^[ ]*VPATH[ ]*=/{ -+s/:*\$(srcdir):*/:/; -+s/:*\${srcdir}:*/:/; -+s/:*@srcdir@:*/:/; -+s/^\([^=]*=[ ]*\):*/\1/; -+s/:*$//; -+s/^[^=]*=[ ]*$//; -+}' -+fi -+ -+DEFS=-DHAVE_CONFIG_H -+ -+ac_libobjs= -+ac_ltlibobjs= -+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue -+ # 1. Remove the extension, and $U if already installed. -+ ac_i=`echo "$ac_i" | -+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'` -+ # 2. Add them. -+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" -+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' -+done -+LIBOBJS=$ac_libobjs -+ -+LTLIBOBJS=$ac_ltlibobjs -+ -+ -+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"AMDEP\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_OPENSSL_TRUE}" && test -z "${XMLSEC_NO_OPENSSL_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_OPENSSL\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_OPENSSL\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_GNUTLS_TRUE}" && test -z "${XMLSEC_NO_GNUTLS_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_GNUTLS\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_GNUTLS\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_NSS_TRUE}" && test -z "${XMLSEC_NO_NSS_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_NSS\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_NSS\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_SHA1_TRUE}" && test -z "${XMLSEC_NO_SHA1_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_SHA1\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_SHA1\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_RIPEMD160_TRUE}" && test -z "${XMLSEC_NO_RIPEMD160_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_RIPEMD160\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_RIPEMD160\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_HMAC_TRUE}" && test -z "${XMLSEC_NO_HMAC_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_HMAC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_HMAC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_DSA_TRUE}" && test -z "${XMLSEC_NO_DSA_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_DSA\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_DSA\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_RSA_TRUE}" && test -z "${XMLSEC_NO_RSA_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_RSA\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_RSA\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_X509_TRUE}" && test -z "${XMLSEC_NO_X509_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_X509\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_X509\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_DES_TRUE}" && test -z "${XMLSEC_NO_DES_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_DES\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_DES\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_AES_TRUE}" && test -z "${XMLSEC_NO_AES_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_AES\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_AES\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_XMLDSIG_TRUE}" && test -z "${XMLSEC_NO_XMLDSIG_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_XMLDSIG\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_XMLDSIG\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_XMLENC_TRUE}" && test -z "${XMLSEC_NO_XMLENC_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_XMLENC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_XMLENC\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_XKMS_TRUE}" && test -z "${XMLSEC_NO_XKMS_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_XKMS\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_XKMS\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_TRUE}" && test -z "${XMLSEC_NO_CRYPTO_DYNAMIC_LOADING_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_CRYPTO_DYNAMIC_LOADING\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_CRYPTO_DYNAMIC_LOADING\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+if test -z "${XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_TRUE}" && test -z "${XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING_FALSE}"; then -+ { { echo "$as_me:$LINENO: error: conditional \"XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING\" was never defined. -+Usually this means the macro was only invoked conditionally." >&5 -+echo "$as_me: error: conditional \"XMLSEC_NO_APPS_CRYPTO_DYNAMIC_LOADING\" was never defined. -+Usually this means the macro was only invoked conditionally." >&2;} -+ { (exit 1); exit 1; }; } -+fi -+ -+: ${CONFIG_STATUS=./config.status} -+ac_clean_files_save=$ac_clean_files -+ac_clean_files="$ac_clean_files $CONFIG_STATUS" -+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -+echo "$as_me: creating $CONFIG_STATUS" >&6;} -+cat >$CONFIG_STATUS <<_ACEOF -+#! $SHELL -+# Generated by $as_me. -+# Run this file to recreate the current configuration. -+# Compiler output produced by configure, useful for debugging -+# configure, is in config.log if it exists. -+ -+debug=false -+ac_cs_recheck=false -+ac_cs_silent=false -+SHELL=\${CONFIG_SHELL-$SHELL} -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF -+## --------------------- ## -+## M4sh Initialization. ## -+## --------------------- ## -+ -+# Be Bourne compatible -+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then -+ emulate sh -+ NULLCMD=: -+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' -+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then -+ set -o posix -+fi -+DUALCASE=1; export DUALCASE # for MKS sh -+ -+# Support unset when possible. -+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then -+ as_unset=unset -+else -+ as_unset=false -+fi -+ -+ -+# Work around bugs in pre-3.0 UWIN ksh. -+$as_unset ENV MAIL MAILPATH -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+for as_var in \ -+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ -+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ -+ LC_TELEPHONE LC_TIME -+do -+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then -+ eval $as_var=C; export $as_var -+ else -+ $as_unset $as_var -+ fi -+done -+ -+# Required to use basename. -+if expr a : '\(a\)' >/dev/null 2>&1; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi -+ -+ -+# Name of the executable. -+as_me=`$as_basename "$0" || -+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ -+ X"$0" : 'X\(//\)$' \| \ -+ X"$0" : 'X\(/\)$' \| \ -+ . : '\(.\)' 2>/dev/null || -+echo X/"$0" | -+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } -+ /^X\/\(\/\/\)$/{ s//\1/; q; } -+ /^X\/\(\/\).*/{ s//\1/; q; } -+ s/.*/./; q'` -+ -+ -+# PATH needs CR, and LINENO needs CR and PATH. -+# Avoid depending upon Character Ranges. -+as_cr_letters='abcdefghijklmnopqrstuvwxyz' -+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -+as_cr_Letters=$as_cr_letters$as_cr_LETTERS -+as_cr_digits='0123456789' -+as_cr_alnum=$as_cr_Letters$as_cr_digits -+ -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ echo "#! /bin/sh" >conf$$.sh -+ echo "exit 0" >>conf$$.sh -+ chmod +x conf$$.sh -+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then -+ PATH_SEPARATOR=';' -+ else -+ PATH_SEPARATOR=: -+ fi -+ rm -f conf$$.sh -+fi -+ -+ -+ as_lineno_1=$LINENO -+ as_lineno_2=$LINENO -+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` -+ test "x$as_lineno_1" != "x$as_lineno_2" && -+ test "x$as_lineno_3" = "x$as_lineno_2" || { -+ # Find who we are. Look in the path if we contain no path at all -+ # relative or not. -+ case $0 in -+ *[\\/]* ) as_myself=$0 ;; -+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -+done -+ -+ ;; -+ esac -+ # We did not find ourselves, most probably we were run as `sh COMMAND' -+ # in which case we are not to be found in the path. -+ if test "x$as_myself" = x; then -+ as_myself=$0 -+ fi -+ if test ! -f "$as_myself"; then -+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} -+ { (exit 1); exit 1; }; } -+ fi -+ case $CONFIG_SHELL in -+ '') -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for as_base in sh bash ksh sh5; do -+ case $as_dir in -+ /*) -+ if ("$as_dir/$as_base" -c ' -+ as_lineno_1=$LINENO -+ as_lineno_2=$LINENO -+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` -+ test "x$as_lineno_1" != "x$as_lineno_2" && -+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then -+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } -+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } -+ CONFIG_SHELL=$as_dir/$as_base -+ export CONFIG_SHELL -+ exec "$CONFIG_SHELL" "$0" ${1+"$@"} -+ fi;; -+ esac -+ done -+done -+;; -+ esac -+ -+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO -+ # uniformly replaced by the line number. The first 'sed' inserts a -+ # line-number line before each line; the second 'sed' does the real -+ # work. The second script uses 'N' to pair each line-number line -+ # with the numbered line, and appends trailing '-' during -+ # substitution so that $LINENO is not a special case at line end. -+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the -+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) -+ sed '=' <$as_myself | -+ sed ' -+ N -+ s,$,-, -+ : loop -+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, -+ t loop -+ s,-$,, -+ s,^['$as_cr_digits']*\n,, -+ ' >$as_me.lineno && -+ chmod +x $as_me.lineno || -+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} -+ { (exit 1); exit 1; }; } -+ -+ # Don't try to exec as it changes $[0], causing all sort of problems -+ # (the dirname of $[0] is not the place where we might find the -+ # original and so on. Autoconf is especially sensible to this). -+ . ./$as_me.lineno -+ # Exit status is that of the last command. -+ exit -+} -+ -+ -+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in -+ *c*,-n*) ECHO_N= ECHO_C=' -+' ECHO_T=' ' ;; -+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; -+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -+esac -+ -+if expr a : '\(a\)' >/dev/null 2>&1; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+rm -f conf$$ conf$$.exe conf$$.file -+echo >conf$$.file -+if ln -s conf$$.file conf$$ 2>/dev/null; then -+ # We could just check for DJGPP; but this test a) works b) is more generic -+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). -+ if test -f conf$$.exe; then -+ # Don't use ln at all; we don't have any links -+ as_ln_s='cp -p' -+ else -+ as_ln_s='ln -s' -+ fi -+elif ln conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s=ln -+else -+ as_ln_s='cp -p' -+fi -+rm -f conf$$ conf$$.exe conf$$.file -+ -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p=: -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ -+as_executable_p="test -f" -+ -+# Sed expression to map a string onto a valid CPP name. -+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -+ -+# Sed expression to map a string onto a valid variable name. -+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -+ -+ -+# IFS -+# We need space, tab and new line, in precisely that order. -+as_nl=' -+' -+IFS=" $as_nl" -+ -+# CDPATH. -+$as_unset CDPATH -+ -+exec 6>&1 -+ -+# Open the log real soon, to keep \$[0] and so on meaningful, and to -+# report actual input values of CONFIG_FILES etc. instead of their -+# values after options handling. Logging --version etc. is OK. -+exec 5>>config.log -+{ -+ echo -+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -+## Running $as_me. ## -+_ASBOX -+} >&5 -+cat >&5 <<_CSEOF -+ -+This file was extended by $as_me, which was -+generated by GNU Autoconf 2.59. Invocation command line was -+ -+ CONFIG_FILES = $CONFIG_FILES -+ CONFIG_HEADERS = $CONFIG_HEADERS -+ CONFIG_LINKS = $CONFIG_LINKS -+ CONFIG_COMMANDS = $CONFIG_COMMANDS -+ $ $0 $@ -+ -+_CSEOF -+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -+echo >&5 -+_ACEOF -+ -+# Files that config.status was made for. -+if test -n "$ac_config_files"; then -+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -+fi -+ -+if test -n "$ac_config_headers"; then -+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -+fi -+ -+if test -n "$ac_config_links"; then -+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -+fi -+ -+if test -n "$ac_config_commands"; then -+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -+fi -+ -+cat >>$CONFIG_STATUS <<\_ACEOF -+ -+ac_cs_usage="\ -+\`$as_me' instantiates files from templates according to the -+current configuration. -+ -+Usage: $0 [OPTIONS] [FILE]... -+ -+ -h, --help print this help, then exit -+ -V, --version print version number, then exit -+ -q, --quiet do not print progress messages -+ -d, --debug don't remove temporary files -+ --recheck update $as_me by reconfiguring in the same conditions -+ --file=FILE[:TEMPLATE] -+ instantiate the configuration file FILE -+ --header=FILE[:TEMPLATE] -+ instantiate the configuration header FILE -+ -+Configuration files: -+$config_files -+ -+Configuration headers: -+$config_headers -+ -+Configuration commands: -+$config_commands -+ -+Report bugs to <bug-autoconf@gnu.org>." -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<_ACEOF -+ac_cs_version="\\ -+config.status -+configured by $0, generated by GNU Autoconf 2.59, -+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -+ -+Copyright (C) 2003 Free Software Foundation, Inc. -+This config.status script is free software; the Free Software Foundation -+gives unlimited permission to copy, distribute and modify it." -+srcdir=$srcdir -+INSTALL="$INSTALL" -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF -+# If no file are specified by the user, then we need to provide default -+# value. By we need to know if files were specified by the user. -+ac_need_defaults=: -+while test $# != 0 -+do -+ case $1 in -+ --*=*) -+ ac_option=`expr "x$1" : 'x\([^=]*\)='` -+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` -+ ac_shift=: -+ ;; -+ -*) -+ ac_option=$1 -+ ac_optarg=$2 -+ ac_shift=shift -+ ;; -+ *) # This is not an option, so the user has probably given explicit -+ # arguments. -+ ac_option=$1 -+ ac_need_defaults=false;; -+ esac -+ -+ case $ac_option in -+ # Handling of the options. -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF -+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -+ ac_cs_recheck=: ;; -+ --version | --vers* | -V ) -+ echo "$ac_cs_version"; exit 0 ;; -+ --he | --h) -+ # Conflict between --help and --header -+ { { echo "$as_me:$LINENO: error: ambiguous option: $1 -+Try \`$0 --help' for more information." >&5 -+echo "$as_me: error: ambiguous option: $1 -+Try \`$0 --help' for more information." >&2;} -+ { (exit 1); exit 1; }; };; -+ --help | --hel | -h ) -+ echo "$ac_cs_usage"; exit 0 ;; -+ --debug | --d* | -d ) -+ debug=: ;; -+ --file | --fil | --fi | --f ) -+ $ac_shift -+ CONFIG_FILES="$CONFIG_FILES $ac_optarg" -+ ac_need_defaults=false;; -+ --header | --heade | --head | --hea ) -+ $ac_shift -+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" -+ ac_need_defaults=false;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil | --si | --s) -+ ac_cs_silent=: ;; -+ -+ # This is an error. -+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -+Try \`$0 --help' for more information." >&5 -+echo "$as_me: error: unrecognized option: $1 -+Try \`$0 --help' for more information." >&2;} -+ { (exit 1); exit 1; }; } ;; -+ -+ *) ac_config_targets="$ac_config_targets $1" ;; -+ -+ esac -+ shift -+done -+ -+ac_configure_extra_args= -+ -+if $ac_cs_silent; then -+ exec 6>/dev/null -+ ac_configure_extra_args="$ac_configure_extra_args --silent" -+fi -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF -+if \$ac_cs_recheck; then -+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 -+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -+fi -+ -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<_ACEOF -+# -+# INIT-COMMANDS section. -+# -+ -+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -+ -+_ACEOF -+ -+ -+ -+cat >>$CONFIG_STATUS <<\_ACEOF -+for ac_config_target in $ac_config_targets -+do -+ case "$ac_config_target" in -+ # Handling of arguments. -+ "include/xmlsec/version.h" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/version.h" ;; -+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; -+ "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; -+ "include/xmlsec/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/Makefile" ;; -+ "include/xmlsec/private/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/private/Makefile" ;; -+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; -+ "apps/Makefile" ) CONFIG_FILES="$CONFIG_FILES apps/Makefile" ;; -+ "docs/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; -+ "docs/api/Makefile" ) CONFIG_FILES="$CONFIG_FILES docs/api/Makefile" ;; -+ "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; -+ "xmlsec1Conf.sh" ) CONFIG_FILES="$CONFIG_FILES xmlsec1Conf.sh:xmlsecConf.sh.in" ;; -+ "xmlsec1-config" ) CONFIG_FILES="$CONFIG_FILES xmlsec1-config:xmlsec-config.in" ;; -+ "xmlsec1-openssl.pc" ) CONFIG_FILES="$CONFIG_FILES xmlsec1-openssl.pc:xmlsec-openssl.pc.in" ;; -+ "xmlsec1-gnutls.pc" ) CONFIG_FILES="$CONFIG_FILES xmlsec1-gnutls.pc:xmlsec-gnutls.pc.in" ;; -+ "xmlsec1-nss.pc" ) CONFIG_FILES="$CONFIG_FILES xmlsec1-nss.pc:xmlsec-nss.pc.in" ;; -+ "xmlsec1.spec" ) CONFIG_FILES="$CONFIG_FILES xmlsec1.spec:xmlsec.spec.in" ;; -+ "include/xmlsec/openssl/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/openssl/Makefile" ;; -+ "src/openssl/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/openssl/Makefile" ;; -+ "include/xmlsec/gnutls/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/gnutls/Makefile" ;; -+ "src/gnutls/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/gnutls/Makefile" ;; -+ "include/xmlsec/nss/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/nss/Makefile" ;; -+ "src/nss/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/nss/Makefile" ;; -+ "include/xmlsec/mscrypto/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/xmlsec/mscrypto/Makefile" ;; -+ "src/mscrypto/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/mscrypto/Makefile" ;; -+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; -+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; -+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -+echo "$as_me: error: invalid argument: $ac_config_target" >&2;} -+ { (exit 1); exit 1; }; };; -+ esac -+done -+ -+# If the user did not use the arguments to specify the items to instantiate, -+# then the envvar interface is used. Set only those that are not. -+# We use the long form for the default assignment because of an extremely -+# bizarre bug on SunOS 4.1.3. -+if $ac_need_defaults; then -+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -+fi -+ -+# Have a temporary directory for convenience. Make it in the build tree -+# simply because there is no reason to put it here, and in addition, -+# creating and moving files from /tmp can sometimes cause problems. -+# Create a temporary directory, and hook for its removal unless debugging. -+$debug || -+{ -+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 -+ trap '{ (exit 1); exit 1; }' 1 2 13 15 -+} -+ -+# Create a (secure) tmp directory for tmp files. -+ -+{ -+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && -+ test -n "$tmp" && test -d "$tmp" -+} || -+{ -+ tmp=./confstat$$-$RANDOM -+ (umask 077 && mkdir $tmp) -+} || -+{ -+ echo "$me: cannot create a temporary directory in ." >&2 -+ { (exit 1); exit 1; } -+} -+ -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<_ACEOF -+ -+# -+# CONFIG_FILES section. -+# -+ -+# No need to generate the scripts if there are no CONFIG_FILES. -+# This happens for instance when ./config.status config.h -+if test -n "\$CONFIG_FILES"; then -+ # Protect against being on the right side of a sed subst in config.status. -+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; -+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -+s,@SHELL@,$SHELL,;t t -+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -+s,@exec_prefix@,$exec_prefix,;t t -+s,@prefix@,$prefix,;t t -+s,@program_transform_name@,$program_transform_name,;t t -+s,@bindir@,$bindir,;t t -+s,@sbindir@,$sbindir,;t t -+s,@libexecdir@,$libexecdir,;t t -+s,@datadir@,$datadir,;t t -+s,@sysconfdir@,$sysconfdir,;t t -+s,@sharedstatedir@,$sharedstatedir,;t t -+s,@localstatedir@,$localstatedir,;t t -+s,@libdir@,$libdir,;t t -+s,@includedir@,$includedir,;t t -+s,@oldincludedir@,$oldincludedir,;t t -+s,@infodir@,$infodir,;t t -+s,@mandir@,$mandir,;t t -+s,@build_alias@,$build_alias,;t t -+s,@host_alias@,$host_alias,;t t -+s,@target_alias@,$target_alias,;t t -+s,@DEFS@,$DEFS,;t t -+s,@ECHO_C@,$ECHO_C,;t t -+s,@ECHO_N@,$ECHO_N,;t t -+s,@ECHO_T@,$ECHO_T,;t t -+s,@LIBS@,$LIBS,;t t -+s,@build@,$build,;t t -+s,@build_cpu@,$build_cpu,;t t -+s,@build_vendor@,$build_vendor,;t t -+s,@build_os@,$build_os,;t t -+s,@host@,$host,;t t -+s,@host_cpu@,$host_cpu,;t t -+s,@host_vendor@,$host_vendor,;t t -+s,@host_os@,$host_os,;t t -+s,@XMLSEC_VERSION@,$XMLSEC_VERSION,;t t -+s,@XMLSEC_PACKAGE@,$XMLSEC_PACKAGE,;t t -+s,@XMLSEC_VERSION_SAFE@,$XMLSEC_VERSION_SAFE,;t t -+s,@XMLSEC_VERSION_MAJOR@,$XMLSEC_VERSION_MAJOR,;t t -+s,@XMLSEC_VERSION_MINOR@,$XMLSEC_VERSION_MINOR,;t t -+s,@XMLSEC_VERSION_SUBMINOR@,$XMLSEC_VERSION_SUBMINOR,;t t -+s,@XMLSEC_VERSION_INFO@,$XMLSEC_VERSION_INFO,;t t -+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -+s,@INSTALL_DATA@,$INSTALL_DATA,;t t -+s,@CYGPATH_W@,$CYGPATH_W,;t t -+s,@PACKAGE@,$PACKAGE,;t t -+s,@VERSION@,$VERSION,;t t -+s,@ACLOCAL@,$ACLOCAL,;t t -+s,@AUTOCONF@,$AUTOCONF,;t t -+s,@AUTOMAKE@,$AUTOMAKE,;t t -+s,@AUTOHEADER@,$AUTOHEADER,;t t -+s,@MAKEINFO@,$MAKEINFO,;t t -+s,@AMTAR@,$AMTAR,;t t -+s,@install_sh@,$install_sh,;t t -+s,@STRIP@,$STRIP,;t t -+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -+s,@mkdir_p@,$mkdir_p,;t t -+s,@AWK@,$AWK,;t t -+s,@SET_MAKE@,$SET_MAKE,;t t -+s,@am__leading_dot@,$am__leading_dot,;t t -+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t -+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t -+s,@MAINT@,$MAINT,;t t -+s,@CC@,$CC,;t t -+s,@CFLAGS@,$CFLAGS,;t t -+s,@LDFLAGS@,$LDFLAGS,;t t -+s,@CPPFLAGS@,$CPPFLAGS,;t t -+s,@ac_ct_CC@,$ac_ct_CC,;t t -+s,@EXEEXT@,$EXEEXT,;t t -+s,@OBJEXT@,$OBJEXT,;t t -+s,@DEPDIR@,$DEPDIR,;t t -+s,@am__include@,$am__include,;t t -+s,@am__quote@,$am__quote,;t t -+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -+s,@CCDEPMODE@,$CCDEPMODE,;t t -+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t -+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t -+s,@EGREP@,$EGREP,;t t -+s,@LN_S@,$LN_S,;t t -+s,@ECHO@,$ECHO,;t t -+s,@AR@,$AR,;t t -+s,@ac_ct_AR@,$ac_ct_AR,;t t -+s,@RANLIB@,$RANLIB,;t t -+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -+s,@CPP@,$CPP,;t t -+s,@CXX@,$CXX,;t t -+s,@CXXFLAGS@,$CXXFLAGS,;t t -+s,@ac_ct_CXX@,$ac_ct_CXX,;t t -+s,@CXXDEPMODE@,$CXXDEPMODE,;t t -+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t -+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t -+s,@CXXCPP@,$CXXCPP,;t t -+s,@F77@,$F77,;t t -+s,@FFLAGS@,$FFLAGS,;t t -+s,@ac_ct_F77@,$ac_ct_F77,;t t -+s,@LIBTOOL@,$LIBTOOL,;t t -+s,@RM@,$RM,;t t -+s,@CP@,$CP,;t t -+s,@MV@,$MV,;t t -+s,@TAR@,$TAR,;t t -+s,@HELP2MAN@,$HELP2MAN,;t t -+s,@MAN2HTML@,$MAN2HTML,;t t -+s,@U@,$U,;t t -+s,@ANSI2KNR@,$ANSI2KNR,;t t -+s,@INSTALL_LTDL_TRUE@,$INSTALL_LTDL_TRUE,;t t -+s,@INSTALL_LTDL_FALSE@,$INSTALL_LTDL_FALSE,;t t -+s,@CONVENIENCE_LTDL_TRUE@,$CONVENIENCE_LTDL_TRUE,;t t -+s,@CONVENIENCE_LTDL_FALSE@,$CONVENIENCE_LTDL_FALSE,;t t -+s,@LIBADD_DL@,$LIBADD_DL,;t t -+s,@PKG_CONFIG_ENABLED@,$PKG_CONFIG_ENABLED,;t t -+s,@PKG_CONFIG@,$PKG_CONFIG,;t t -+s,@LIBXML_CFLAGS@,$LIBXML_CFLAGS,;t t -+s,@LIBXML_LIBS@,$LIBXML_LIBS,;t t -+s,@LIBXML262_CFLAGS@,$LIBXML262_CFLAGS,;t t -+s,@LIBXML262_LIBS@,$LIBXML262_LIBS,;t t -+s,@LIBXML_CONFIG@,$LIBXML_CONFIG,;t t -+s,@LIBXML_MIN_VERSION@,$LIBXML_MIN_VERSION,;t t -+s,@LIBXSLT_CFLAGS@,$LIBXSLT_CFLAGS,;t t -+s,@LIBXSLT_LIBS@,$LIBXSLT_LIBS,;t t -+s,@XMLSEC_NO_LIBXSLT@,$XMLSEC_NO_LIBXSLT,;t t -+s,@LIBXSLT_CONFIG@,$LIBXSLT_CONFIG,;t t -+s,@LIBXSLT_MIN_VERSION@,$LIBXSLT_MIN_VERSION,;t t -+s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t -+s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t -+s,@OPENSSL097_CFLAGS@,$OPENSSL097_CFLAGS,;t t -+s,@OPENSSL097_LIBS@,$OPENSSL097_LIBS,;t t -+s,@XMLSEC_NO_OPENSSL_TRUE@,$XMLSEC_NO_OPENSSL_TRUE,;t t -+s,@XMLSEC_NO_OPENSSL_FALSE@,$XMLSEC_NO_OPENSSL_FALSE,;t t -+s,@XMLSEC_NO_OPENSSL@,$XMLSEC_NO_OPENSSL,;t t -+s,@OPENSSL_CRYPTO_LIB@,$OPENSSL_CRYPTO_LIB,;t t -+s,@OPENSSL_MIN_VERSION@,$OPENSSL_MIN_VERSION,;t t -+s,@GNUTLS_CFLAGS@,$GNUTLS_CFLAGS,;t t -+s,@GNUTLS_LIBS@,$GNUTLS_LIBS,;t t -+s,@XMLSEC_NO_GNUTLS_TRUE@,$XMLSEC_NO_GNUTLS_TRUE,;t t -+s,@XMLSEC_NO_GNUTLS_FALSE@,$XMLSEC_NO_GNUTLS_FALSE,;t t -+s,@XMLSEC_NO_GNUTLS@,$XMLSEC_NO_GNUTLS,;t t -+s,@GNUTLS_CRYPTO_LIB@,$GNUTLS_CRYPTO_LIB,;t t -+s,@GNUTLS_MIN_VERSION@,$GNUTLS_MIN_VERSION,;t t -+s,@NSS_CFLAGS@,$NSS_CFLAGS,;t t -+s,@NSS_LIBS@,$NSS_LIBS,;t t -+s,@XMLSEC_NO_NSS_TRUE@,$XMLSEC_NO_NSS_TRUE,;t t -+s,@XMLSEC_NO_NSS_FALSE@,$XMLSEC_NO_NSS_FALSE,;t t -+s,@XMLSEC_NO_NSS@,$XMLSEC_NO_NSS,;t t -+s,@NSS_CRYPTO_LIB@,$NSS_CRYPTO_LIB,;t t -+s,@NSS_MIN_VERSION@,$NSS_MIN_VERSION,;t t -+s,@NSPR_MIN_VERSION@,$NSPR_MIN_VERSION,;t t -+s,@MOZILLA_MIN_VERSION@,$MOZILLA_MIN_VERSION,;t t -+s,@MSCRYPTO_CFLAGS@,$MSCRYPTO_CFLAGS,;t t -+s,@MSCRYPTO_LIBS@,$MSCRYPTO_LIBS,;t t - s,@XMLSEC_NO_SHA1_TRUE@,$XMLSEC_NO_SHA1_TRUE,;t t - s,@XMLSEC_NO_SHA1_FALSE@,$XMLSEC_NO_SHA1_FALSE,;t t - s,@XMLSEC_NO_SHA1@,$XMLSEC_NO_SHA1,;t t -@@ -34368,6 +36362,8 @@ - s,@NSS_MIN_VERSION@,$NSS_MIN_VERSION,;t t - s,@NSPR_MIN_VERSION@,$NSPR_MIN_VERSION,;t t - s,@MOZILLA_MIN_VERSION@,$MOZILLA_MIN_VERSION,;t t -+s,@MSCRYPTO_CFLAGS@,$MSCRYPTO_CFLAGS,;t t -+s,@MSCRYPTO_LIBS@,$MSCRYPTO_LIBS,;t t - s,@XMLSEC_NO_SHA1_TRUE@,$XMLSEC_NO_SHA1_TRUE,;t t - s,@XMLSEC_NO_SHA1_FALSE@,$XMLSEC_NO_SHA1_FALSE,;t t - s,@XMLSEC_NO_SHA1@,$XMLSEC_NO_SHA1,;t t ---- misc/xmlsec1-1.2.6/configure.in 2004-08-26 04:49:24.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/configure.in 2008-06-29 23:44:19.000000000 +0200 -@@ -143,7 +143,7 @@ - dnl find libxml - dnl ========================================================================== - LIBXML_MIN_VERSION="2.4.2" --LIBXML_CONFIG="xml2-config" -+LIBXML_CONFIG="./libxml2-config" - LIBXML_CFLAGS="" - LIBXML_LIBS="" - LIBXML_FOUND="no" -@@ -503,12 +503,26 @@ - - XMLSEC_NO_NSS="1" - MOZILLA_MIN_VERSION="1.4" -+if test "z$MOZ_FLAVOUR" = "zfirefox" ; then -+ MOZILLA_MIN_VERSION="1.0" -+fi - NSS_MIN_VERSION="3.2" - NSPR_MIN_VERSION="4.0" - NSS_CFLAGS="" - NSS_LIBS="" --NSS_LIBS_LIST="-lnss3 -lsmime3" --NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" -+ -+case $host_os in -+cygwin* | mingw* | pw32*) -+ NSS_LIBS_LIST="-lnss3 -lsmime3" -+ NSPR_LIBS_LIST="-lnspr4" -+ ;; -+ -+*) -+ NSS_LIBS_LIST="-lnss3 -lsoftokn3 -lsmime3" -+ NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" -+ ;; -+esac -+ - NSS_CRYPTO_LIB="$PACKAGE-nss" - NSS_FOUND="no" - -@@ -521,9 +535,16 @@ - AC_MSG_RESULT(no) - NSS_FOUND="without" - elif test "z$with_nss" = "z" -a "z$with_nspr" = "z" -a "z$with_mozilla_ver" = "z" -a "z$PKG_CONFIG_ENABLED" = "zyes" ; then -- PKG_CHECK_MODULES(NSS, mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION, -+ PKG_CHECK_MODULES(NSS, $MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR-nss >= $MOZILLA_MIN_VERSION, - [NSS_FOUND=yes], - [NSS_FOUND=no]) -+ AC_MSG_RESULT($NSS_FOUND) -+ if test "z$NSS_FOUND" = "zno" ; then -+ PKG_CHECK_MODULES(NSS, nspr >= $NSPR_MIN_VERSION nss >= $NSS_MIN_VERSION, -+ [NSS_FOUND=yes], -+ [NSS_FOUND=no]) -+ AC_MSG_RESULT($NSS_FOUND) -+ fi - fi - - if test "z$NSS_FOUND" = "zno" ; then -@@ -534,8 +555,8 @@ - ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION - fi - -- ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name" -- ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name" -+ ac_nss_lib_dir="${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT}" -+ ac_nss_inc_dir="${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/mozilla" - - AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION) - NSPR_INCLUDES_FOUND="no" -@@ -570,7 +591,9 @@ - done - - for dir in $ac_nss_lib_dir ; do -- if test -f $dir/libnspr4.so ; then -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib -o -f $dir/libnspr4.a ; then - dnl do not add -L/usr/lib because compiler does it anyway - if test "z$dir" = "z/usr/lib" ; then - NSPR_LIBS="$NSPR_LIBS_LIST" -@@ -583,7 +606,26 @@ - fi - NSPR_LIBS_FOUND="yes" - break -- fi -+ fi -+ ;; -+ -+ *) -+ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then -+ dnl do not add -L/usr/lib because compiler does it anyway -+ if test "z$dir" = "z/usr/lib" ; then -+ NSPR_LIBS="$NSPR_LIBS_LIST" -+ else -+ if test "z$with_gnu_ld" = "zyes" ; then -+ NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST" -+ else -+ NSPR_LIBS="-L$dir $NSPR_LIBS_LIST" -+ fi -+ fi -+ NSPR_LIBS_FOUND="yes" -+ break -+ fi -+ ;; -+ esac - done - fi - -@@ -641,7 +683,9 @@ - done - - for dir in $ac_nss_lib_dir ; do -- if test -f $dir/libnss3.so ; then -+ case $host_os in -+ cygwin* | mingw* | pw32*) -+ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib -o -f $dir/libnss3.a ; then - dnl do not add -L/usr/lib because compiler does it anyway - if test "z$dir" = "z/usr/lib" ; then - NSS_LIBS="$NSS_LIBS_LIST" -@@ -654,7 +698,26 @@ - fi - NSS_LIBS_FOUND="yes" - break -- fi -+ fi -+ ;; -+ -+ *) -+ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then -+ dnl do not add -L/usr/lib because compiler does it anyway -+ if test "z$dir" = "z/usr/lib" ; then -+ NSS_LIBS="$NSS_LIBS_LIST" -+ else -+ if test "z$with_gnu_ld" = "zyes" ; then -+ NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST" -+ else -+ NSS_LIBS="-L$dir $NSS_LIBS_LIST" -+ fi -+ fi -+ NSS_LIBS_FOUND="yes" -+ break -+ fi -+ ;; -+ esac - done - fi - ---- misc/xmlsec1-1.2.6/include/xmlsec/mscrypto/Makefile.in 2008-06-29 23:44:40.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/mscrypto/Makefile.in 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,58 @@ --dummy -+# Makefile.in generated by automake 1.8.3 from Makefile.am. -+# @configure_input@ -+ -+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -+# 2003, 2004 Free Software Foundation, Inc. -+# This Makefile.in is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -+# PARTICULAR PURPOSE. -+ -+@SET_MAKE@ -+ -+HEADERS = $(xmlsecmscryptoinc_HEADERS) -+NULL = -+xmlsecmscryptoinc_HEADERS = \ -+akmngr.h \ -+app.h \ -+crypto.h \ -+symbols.h \ -+certkeys.h \ -+keysstore.h \ -+x509.h \ -+$(NULL) -+ -+all: all-am -+ -+mostlyclean-libtool: -+ -rm -f *.lo -+ -+clean-libtool: -+ -rm -rf .libs _libs -+ -+all-am: Makefile $(HEADERS) -+ -+mostlyclean-generic: -+ -+clean-generic: -+ -+clean: clean-am -+ -+clean-am: clean-generic clean-libtool mostlyclean-am -+ -+mostlyclean: mostlyclean-am -+ -+mostlyclean-am: mostlyclean-generic mostlyclean-libtool -+ -+.PHONY: all all-am clean clean-generic \ -+ clean-libtool \ -+ mostlyclean mostlyclean-generic mostlyclean-libtool -+ -+ -+# Tell versions [3.59,3.63) of GNU make to not export all variables. -+# Otherwise a system limit (for SysV at least) may be exceeded. -+.NOEXPORT: ---- misc/xmlsec1-1.2.6/include/xmlsec/mscrypto/akmngr.h 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/mscrypto/akmngr.h 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,71 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright .......................... -+ */ -+#ifndef __XMLSEC_MSCRYPTO_AKMNGR_H__ -+#define __XMLSEC_MSCRYPTO_AKMNGR_H__ -+ -+#include <windows.h> -+#include <wincrypt.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif /* __cplusplus */ -+ -+XMLSEC_CRYPTO_EXPORT xmlSecKeysMngrPtr -+xmlSecMSCryptoAppliedKeysMngrCreate( -+ HCERTSTORE keyStore , -+ HCERTSTORE certStore -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ HCRYPTKEY symKey -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ HCRYPTKEY pubKey -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ HCRYPTKEY priKey -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore ( -+ xmlSecKeysMngrPtr mngr , -+ HCERTSTORE keyStore -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore ( -+ xmlSecKeysMngrPtr mngr , -+ HCERTSTORE trustedStore -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore ( -+ xmlSecKeysMngrPtr mngr , -+ HCERTSTORE untrustedStore -+) ; -+ -+#ifdef __cplusplus -+} -+#endif /* __cplusplus */ -+ -+#endif /* __XMLSEC_MSCRYPTO_AKMNGR_H__ */ -+ -+ ---- misc/xmlsec1-1.2.6/include/xmlsec/mscrypto/x509.h 2003-09-26 08:12:46.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/mscrypto/x509.h 2008-06-29 23:44:19.000000000 +0200 -@@ -77,6 +77,21 @@ - PCCERT_CONTEXT cert, - xmlSecKeyDataType type); - -+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptKeyStore ( -+ xmlSecKeyDataStorePtr store, -+ HCERTSTORE keyStore -+ ) ; -+ -+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptTrustedStore ( -+ xmlSecKeyDataStorePtr store, -+ HCERTSTORE trustedStore -+ ) ; -+ -+XMLSEC_CRYPTO_EXPORT int xmlSecMSCryptoX509StoreAdoptUntrustedStore ( -+ xmlSecKeyDataStorePtr store, -+ HCERTSTORE untrustedStore -+ ) ; -+ - - #endif /* XMLSEC_NO_X509 */ - ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/Makefile.am 2003-07-30 04:46:35.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/Makefile.am 2008-06-29 23:44:19.000000000 +0200 -@@ -3,6 +3,7 @@ - xmlsecnssincdir = $(includedir)/xmlsec1/xmlsec/nss - - xmlsecnssinc_HEADERS = \ -+akmngr.h \ - app.h \ - crypto.h \ - symbols.h \ -@@ -10,6 +11,8 @@ - keysstore.h \ - pkikeys.h \ - x509.h \ -+tokens.h \ -+ciphers.h \ - $(NULL) - - install-exec-hook: ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/Makefile.in 2004-08-26 08:00:31.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/Makefile.in 2008-06-29 23:44:19.000000000 +0200 -@@ -273,6 +273,7 @@ - NULL = - xmlsecnssincdir = $(includedir)/xmlsec1/xmlsec/nss - xmlsecnssinc_HEADERS = \ -+akmngr.h \ - app.h \ - crypto.h \ - symbols.h \ -@@ -280,6 +281,8 @@ - keysstore.h \ - pkikeys.h \ - x509.h \ -+tokens.h \ -+ciphers.h \ - $(NULL) - - all: all-am ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/akmngr.h 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/akmngr.h 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,56 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright .......................... -+ */ -+#ifndef __XMLSEC_NSS_AKMNGR_H__ -+#define __XMLSEC_NSS_AKMNGR_H__ -+ -+#include <nss.h> -+#include <nspr.h> -+#include <pk11func.h> -+#include <cert.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif /* __cplusplus */ -+ -+XMLSEC_CRYPTO_EXPORT xmlSecKeysMngrPtr -+xmlSecNssAppliedKeysMngrCreate( -+ PK11SlotInfo** slots, -+ int cSlots, -+ CERTCertDBHandle* handler -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssAppliedKeysMngrSymKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ PK11SymKey* symKey -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssAppliedKeysMngrPubKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ SECKEYPublicKey* pubKey -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssAppliedKeysMngrPriKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ SECKEYPrivateKey* priKey -+) ; -+ -+#ifdef __cplusplus -+} -+#endif /* __cplusplus */ -+ -+#endif /* __XMLSEC_NSS_AKMNGR_H__ */ -+ -+ ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/app.h 2004-01-12 22:06:14.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/app.h 2008-06-29 23:44:19.000000000 +0200 -@@ -22,6 +22,9 @@ - #include <xmlsec/keysmngr.h> - #include <xmlsec/transforms.h> - -+#include <xmlsec/nss/tokens.h> -+#include <xmlsec/nss/akmngr.h> -+ - /** - * Init/shutdown - */ -@@ -34,6 +37,8 @@ - XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrInit (xmlSecKeysMngrPtr mngr); - XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrAdoptKey(xmlSecKeysMngrPtr mngr, - xmlSecKeyPtr key); -+XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrAdoptKeySlot(xmlSecKeysMngrPtr mngr, -+ xmlSecNssKeySlotPtr keySlot); - XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, - const char* uri); - XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/ciphers.h 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/ciphers.h 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,35 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright .......................... -+ */ -+#ifndef __XMLSEC_NSS_CIPHERS_H__ -+#define __XMLSEC_NSS_CIPHERS_H__ -+ -+#ifdef __cplusplus -+extern "C" { -+#endif /* __cplusplus */ -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+ -+ -+XMLSEC_CRYPTO_EXPORT int xmlSecNssSymKeyDataAdoptKey( xmlSecKeyDataPtr data, -+ PK11SymKey* symkey ) ; -+ -+XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssSymKeyDataKeyAdopt( PK11SymKey* symKey ) ; -+ -+XMLSEC_CRYPTO_EXPORT PK11SymKey* xmlSecNssSymKeyDataGetKey(xmlSecKeyDataPtr data); -+ -+ -+#ifdef __cplusplus -+} -+#endif /* __cplusplus */ -+ -+#endif /* __XMLSEC_NSS_CIPHERS_H__ */ -+ -+ ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/crypto.h 2004-01-12 22:06:14.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/crypto.h 2008-06-29 23:44:19.000000000 +0200 -@@ -264,6 +264,15 @@ - xmlSecNssTransformRsaPkcs1GetKlass() - XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaPkcs1GetKlass(void); - -+/** -+ * xmlSecNssTransformRsaOaepId: -+ * -+ * The RSA OAEP key transport transform klass. -+ */ -+#define xmlSecNssTransformRsaOaepId \ -+ xmlSecNssTransformRsaOaepGetKlass() -+XMLSEC_CRYPTO_EXPORT xmlSecTransformId xmlSecNssTransformRsaOaepGetKlass(void); -+ - #endif /* XMLSEC_NO_RSA */ - - ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/keysstore.h 2003-07-30 04:46:35.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/keysstore.h 2008-06-29 23:44:19.000000000 +0200 -@@ -16,6 +16,8 @@ - #endif /* __cplusplus */ - - #include <xmlsec/xmlsec.h> -+#include <xmlsec/keysmngr.h> -+#include <xmlsec/nss/tokens.h> - - /**************************************************************************** - * -@@ -31,6 +33,8 @@ - XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecNssKeysStoreGetKlass (void); - XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKey (xmlSecKeyStorePtr store, - xmlSecKeyPtr key); -+XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKeySlot(xmlSecKeyStorePtr store, -+ xmlSecNssKeySlotPtr keySlot); - XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreLoad (xmlSecKeyStorePtr store, - const char *uri, - xmlSecKeysMngrPtr keysMngr); ---- misc/xmlsec1-1.2.6/include/xmlsec/nss/tokens.h 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/include/xmlsec/nss/tokens.h 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,182 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright (c) 2003 Sun Microsystems, Inc. All rights reserved. -+ * -+ * Contributor(s): _____________________________ -+ * -+ */ -+#ifndef __XMLSEC_NSS_TOKENS_H__ -+#define __XMLSEC_NSS_TOKENS_H__ -+ -+#include <string.h> -+ -+#include <nss.h> -+#include <pk11func.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/list.h> -+ -+#ifdef __cplusplus -+extern "C" { -+#endif /* __cplusplus */ -+ -+/** -+ * xmlSecNssKeySlotListId -+ * -+ * The crypto mechanism list klass -+ */ -+#define xmlSecNssKeySlotListId xmlSecNssKeySlotListGetKlass() -+XMLSEC_CRYPTO_EXPORT xmlSecPtrListId xmlSecNssKeySlotListGetKlass( void ) ; -+ -+/******************************************* -+ * KeySlot interfaces -+ *******************************************/ -+/** -+ * Internal NSS key slot data -+ * @mechanismList: the mechanisms that the slot bound with. -+ * @slot: the pkcs slot -+ * -+ * This context is located after xmlSecPtrList -+ */ -+typedef struct _xmlSecNssKeySlot xmlSecNssKeySlot ; -+typedef struct _xmlSecNssKeySlot* xmlSecNssKeySlotPtr ; -+ -+struct _xmlSecNssKeySlot { -+ CK_MECHANISM_TYPE_PTR mechanismList ; /* mech. array, NULL ternimated */ -+ PK11SlotInfo* slot ; -+} ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotSetMechList( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE_PTR mechanismList -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotEnableMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE mechanism -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotDisableMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE mechanism -+) ; -+ -+XMLSEC_CRYPTO_EXPORT CK_MECHANISM_TYPE_PTR -+xmlSecNssKeySlotGetMechList( -+ xmlSecNssKeySlotPtr keySlot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotSetSlot( -+ xmlSecNssKeySlotPtr keySlot , -+ PK11SlotInfo* slot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotInitialize( -+ xmlSecNssKeySlotPtr keySlot , -+ PK11SlotInfo* slot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT void -+xmlSecNssKeySlotFinalize( -+ xmlSecNssKeySlotPtr keySlot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT PK11SlotInfo* -+xmlSecNssKeySlotGetSlot( -+ xmlSecNssKeySlotPtr keySlot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT xmlSecNssKeySlotPtr -+xmlSecNssKeySlotCreate() ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotCopy( -+ xmlSecNssKeySlotPtr newKeySlot , -+ xmlSecNssKeySlotPtr keySlot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT xmlSecNssKeySlotPtr -+xmlSecNssKeySlotDuplicate( -+ xmlSecNssKeySlotPtr keySlot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT void -+xmlSecNssKeySlotDestroy( -+ xmlSecNssKeySlotPtr keySlot -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotBindMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE type -+) ; -+ -+XMLSEC_CRYPTO_EXPORT int -+xmlSecNssKeySlotSupportMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE type -+) ; -+ -+ -+/************************************************************************ -+ * PKCS#11 crypto token interfaces -+ * -+ * A PKCS#11 slot repository will be defined internally. From the -+ * repository, a user can specify a particular slot for a certain crypto -+ * mechanism. -+ * -+ * In some situation, some cryptographic operation should act in a user -+ * designated devices. The interfaces defined here provide the way. If -+ * the user do not initialize the repository distinctly, the interfaces -+ * use the default functions provided by NSS itself. -+ * -+ ************************************************************************/ -+/** -+ * Initialize NSS pkcs#11 slot repository -+ * -+ * Returns 0 if success or -1 if an error occurs. -+ */ -+XMLSEC_CRYPTO_EXPORT int xmlSecNssSlotInitialize( void ) ; -+ -+/** -+ * Shutdown and destroy NSS pkcs#11 slot repository -+ */ -+XMLSEC_CRYPTO_EXPORT void xmlSecNssSlotShutdown() ; -+ -+/** -+ * Get PKCS#11 slot handler -+ * @type the mechanism that the slot must support. -+ * -+ * Returns a pointer to PKCS#11 slot or NULL if an error occurs. -+ * -+ * Notes: The returned handler must be destroied distinctly. -+ */ -+XMLSEC_CRYPTO_EXPORT PK11SlotInfo* xmlSecNssSlotGet( CK_MECHANISM_TYPE type ) ; -+ -+/** -+ * Adopt a pkcs#11 slot with a mechanism into the repository -+ * @slot: the pkcs#11 slot. -+ * @mech: the mechanism. -+ * -+ * If @mech is available( @mech != CKM_INVALID_MECHANISM ), every operation with -+ * this mechanism only can perform on the @slot. -+ * -+ * Returns 0 if success or -1 if an error occurs. -+ */ -+XMLSEC_CRYPTO_EXPORT int xmlSecNssSlotAdopt( PK11SlotInfo* slot, CK_MECHANISM_TYPE mech ) ; -+ -+#ifdef __cplusplus -+} -+#endif /* __cplusplus */ -+ -+#endif /* __XMLSEC_NSS_TOKENS_H__ */ -+ ---- misc/xmlsec1-1.2.6/libxml2-config 2008-06-29 23:44:40.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/libxml2-config 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,48 @@ --dummy -+#! /bin/sh -+ -+if test "$SYSTEM_LIBXML" = "YES" -+then xml2-config "$@"; exit 0 -+fi -+ -+prefix=${SOLARVERSION}/${INPATH} -+includedir=${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/external -+libdir=${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT} -+ -+while test $# -gt 0; do -+ case "$1" in -+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; -+ *) optarg= ;; -+ esac -+ -+ case "$1" in -+ --prefix=*) -+ prefix=$optarg -+ includedir=$prefix/include -+ libdir=$prefix/lib -+ ;; -+ -+ --prefix) -+ echo $prefix -+ ;; -+ -+ --version) -+ echo 2.5.4 -+ exit 0 -+ ;; -+ -+ --cflags) -+ echo -I${includedir} -+ ;; -+ -+ --libs) -+ echo -L${libdir} ${LIBXML2LIB} ${ZLIB3RDLIB} -lm -+ ;; -+ -+ *) -+ exit 1 -+ ;; -+ esac -+ shift -+done -+ -+exit 0 ---- misc/xmlsec1-1.2.6/ltmain.sh 2004-08-26 08:00:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/ltmain.sh 2008-06-29 23:44:19.000000000 +0200 -@@ -1661,6 +1661,11 @@ - fi - ;; - -+ *.lib) -+ deplibs="$deplibs $arg" -+ continue -+ ;; -+ - *.$libext) - # An archive. - deplibs="$deplibs $arg" -@@ -1974,6 +1979,10 @@ - continue - ;; - *.la) lib="$deplib" ;; -+ *.lib) -+ deplibs="$deplib $deplibs" -+ continue -+ ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" -@@ -2994,13 +3003,13 @@ - ;; - - freebsd-aout) -- major=".$current" -- versuffix=".$current.$revision"; -+ major=.`expr $current - $age` -+ versuffix="$major.$age.$revision" - ;; - - freebsd-elf) -- major=".$current" -- versuffix=".$current"; -+ major=.`expr $current - $age` -+ versuffix="$major.$age.$revision" - ;; - - irix | nonstopux) -@@ -3564,7 +3573,8 @@ - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" -- dep_rpath="$dep_rpath $flag" -+# what the ... -+# dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in ---- misc/xmlsec1-1.2.6/src/bn.c 2004-06-21 20:33:27.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/bn.c 2008-06-29 23:44:19.000000000 +0200 -@@ -170,8 +170,10 @@ - */ - int - xmlSecBnFromString(xmlSecBnPtr bn, const xmlChar* str, xmlSecSize base) { -- xmlSecSize i, len; -+ xmlSecSize i, len, size; - xmlSecByte ch; -+ xmlSecByte* data; -+ int positive; - int nn; - int ret; - -@@ -183,7 +185,7 @@ - /* trivial case */ - len = xmlStrlen(str); - if(len == 0) { -- return(0); -+ return(0); - } - - /* The result size could not exceed the input string length -@@ -191,54 +193,131 @@ - * In truth, it would be likely less than 1/2 input string length - * because each byte is represented by 2 chars. If needed, - * buffer size would be increased by Mul/Add functions. -+ * Finally, we can add one byte for 00 or 10 prefix. - */ -- ret = xmlSecBufferSetMaxSize(bn, xmlSecBufferGetSize(bn) + len / 2 + 1); -+ ret = xmlSecBufferSetMaxSize(bn, xmlSecBufferGetSize(bn) + len / 2 + 1 + 1); - if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBnRevLookupTable", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", len / 2 + 1); -- return (-1); -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnRevLookupTable", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "size=%d", len / 2 + 1); -+ return (-1); -+ } -+ -+ /* figure out if it is positive or negative number */ -+ positive = 1; -+ i = 0; -+ while(i < len) { -+ ch = str[i++]; -+ -+ /* skip spaces */ -+ if(isspace(ch)) { -+ continue; -+ } -+ -+ /* check if it is + or - */ -+ if(ch == '+') { -+ positive = 1; -+ break; -+ } else if(ch == '-') { -+ positive = 0; -+ break; -+ } -+ -+ /* otherwise, it must be start of the number */ -+ nn = xmlSecBnLookupTable[ch]; -+ if((nn >= 0) && ((xmlSecSize)nn < base)) { -+ xmlSecAssert2(i > 0, -1); -+ -+ /* no sign, positive by default */ -+ positive = 1; -+ --i; /* make sure that we will look at this character in next loop */ -+ break; -+ } else { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ NULL, -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ "char=%c;base=%d", -+ ch, base); -+ return (-1); -+ } -+ } -+ -+ /* now parse the number itself */ -+ while(i < len) { -+ ch = str[i++]; -+ if(isspace(ch)) { -+ continue; -+ } -+ -+ xmlSecAssert2(ch <= sizeof(xmlSecBnLookupTable), -1); -+ nn = xmlSecBnLookupTable[ch]; -+ if((nn < 0) || ((xmlSecSize)nn > base)) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ NULL, -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ "char=%c;base=%d", -+ ch, base); -+ return (-1); -+ } -+ -+ ret = xmlSecBnMul(bn, base); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnMul", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "base=%d", base); -+ return (-1); -+ } -+ -+ ret = xmlSecBnAdd(bn, nn); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnAdd", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "base=%d", base); -+ return (-1); -+} - } - -- for(i = 0; i < len; i++) { -- ch = str[i]; -- if(isspace(ch)) { -- continue; -- } -- -- xmlSecAssert2(ch <= sizeof(xmlSecBnLookupTable), -1); -- nn = xmlSecBnLookupTable[ch]; -- if((nn < 0) || ((xmlSecSize)nn > base)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "char=%c;base=%d", -- ch, base); -- return (-1); -- } -- -- ret = xmlSecBnMul(bn, base); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBnMul", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "base=%d", base); -- return (-1); -- } -- -- ret = xmlSecBnAdd(bn, nn); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBnAdd", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "base=%d", base); -- return (-1); -- } -+ /* check if we need to add 00 prefix */ -+ data = xmlSecBufferGetData(bn); -+ size = xmlSecBufferGetSize(bn); -+ if((size > 0 && data[0] > 127)||(size==0)) { -+ ch = 0; -+ ret = xmlSecBufferPrepend(bn, &ch, 1); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBufferPrepend", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "base=%d", base); -+ return (-1); -+ } -+ } -+ -+ /* do 2's compliment and add 1 to represent negative value */ -+ if(positive == 0) { -+ data = xmlSecBufferGetData(bn); -+ size = xmlSecBufferGetSize(bn); -+ for(i = 0; i < size; ++i) { -+ data[i] ^= 0xFF; -+ } -+ -+ ret = xmlSecBnAdd(bn, 1); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnAdd", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "base=%d", base); -+ return (-1); -+ } - } - - return(0); -@@ -256,8 +335,12 @@ - */ - xmlChar* - xmlSecBnToString(xmlSecBnPtr bn, xmlSecSize base) { -+ xmlSecBn bn2; -+ int positive = 1; - xmlChar* res; -- xmlSecSize i, len; -+ xmlSecSize i, len, size; -+ xmlSecByte* data; -+ int ret; - int nn; - xmlChar ch; - -@@ -265,35 +348,86 @@ - xmlSecAssert2(base > 1, NULL); - xmlSecAssert2(base <= sizeof(xmlSecBnRevLookupTable), NULL); - -+ -+ /* copy bn */ -+ data = xmlSecBufferGetData(bn); -+ size = xmlSecBufferGetSize(bn); -+ ret = xmlSecBnInitialize(&bn2, size); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnCreate", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "size=%d", size); -+ return (NULL); -+ } -+ -+ ret = xmlSecBnSetData(&bn2, data, size); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnSetData", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "size=%d", size); -+ xmlSecBnFinalize(&bn2); -+ return (NULL); -+ } -+ -+ /* check if it is a negative number or not */ -+ data = xmlSecBufferGetData(&bn2); -+ size = xmlSecBufferGetSize(&bn2); -+ if((size > 0) && (data[0] > 127)) { -+ /* subtract 1 and do 2's compliment */ -+ ret = xmlSecBnAdd(&bn2, -1); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnAdd", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "size=%d", size); -+ xmlSecBnFinalize(&bn2); -+ return (NULL); -+ } -+ for(i = 0; i < size; ++i) { -+ data[i] ^= 0xFF; -+ } -+ -+ positive = 0; -+ } else { -+ positive = 1; -+ } -+ - /* Result string len is - * len = log base (256) * <bn size> - * Since the smallest base == 2 then we can get away with - * len = 8 * <bn size> - */ -- len = 8 * xmlSecBufferGetSize(bn) + 1; -+ len = 8 * size + 1 + 1; - res = (xmlChar*)xmlMalloc(len + 1); - if(res == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_MALLOC_FAILED, -- "len=%d", len); -- return (NULL); -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ NULL, -+ XMLSEC_ERRORS_R_MALLOC_FAILED, -+ "len=%d", len); -+ xmlSecBnFinalize(&bn2); -+ return (NULL); - } - memset(res, 0, len + 1); - -- for(i = 0; (xmlSecBufferGetSize(bn) > 0) && (i < len); i++) { -- if(xmlSecBnDiv(bn, base, &nn) < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBnDiv", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "base=%d", base); -- xmlFree(res); -- return (NULL); -- } -- xmlSecAssert2((size_t)nn < sizeof(xmlSecBnRevLookupTable), NULL); -- res[i] = xmlSecBnRevLookupTable[nn]; -+ for(i = 0; (xmlSecBufferGetSize(&bn2) > 0) && (i < len); i++) { -+ if(xmlSecBnDiv(&bn2, base, &nn) < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnDiv", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "base=%d", base); -+ xmlFree(res); -+ xmlSecBnFinalize(&bn2); -+ return (NULL); -+ } -+ xmlSecAssert2((size_t)nn < sizeof(xmlSecBnRevLookupTable), NULL); -+ res[i] = xmlSecBnRevLookupTable[nn]; - } - xmlSecAssert2(i < len, NULL); - -@@ -301,13 +435,20 @@ - for(len = i; (len > 1) && (res[len - 1] == '0'); len--); - res[len] = '\0'; - -+ /* add "-" for negative numbers */ -+ if(positive == 0) { -+ res[len] = '-'; -+ res[++len] = '\0'; -+ } -+ - /* swap the string because we wrote it in reverse order */ - for(i = 0; i < len / 2; i++) { -- ch = res[i]; -- res[i] = res[len - i - 1]; -- res[len - i - 1] = ch; -+ ch = res[i]; -+ res[i] = res[len - i - 1]; -+ res[len - i - 1] = ch; - } - -+ xmlSecBnFinalize(&bn2); - return(res); - } - -@@ -392,7 +533,9 @@ - } - - data = xmlSecBufferGetData(bn); -- for(over = 0, i = xmlSecBufferGetSize(bn); i > 0;) { -+ i = xmlSecBufferGetSize(bn); -+ over = 0; -+ while(i > 0) { - xmlSecAssert2(data != NULL, -1); - - over = over + multiplier * data[--i]; -@@ -487,43 +630,57 @@ - */ - int - xmlSecBnAdd(xmlSecBnPtr bn, int delta) { -- int over; -+ int over, tmp; - xmlSecByte* data; - xmlSecSize i; - xmlSecByte ch; - int ret; - - xmlSecAssert2(bn != NULL, -1); -- xmlSecAssert2(delta >= 0, -1); - - if(delta == 0) { -- return(0); -+ return(0); - } - - data = xmlSecBufferGetData(bn); -- for(over = delta, i = xmlSecBufferGetSize(bn); i > 0;) { -- xmlSecAssert2(data != NULL, -1); -+ if(delta > 0) { -+ for(over = delta, i = xmlSecBufferGetSize(bn); (i > 0) && (over > 0) ;) { -+ xmlSecAssert2(data != NULL, -1); - -- over += data[--i]; -- data[i] = over % 256; -- over = over / 256; -- } -+ tmp = data[--i]; -+ over += tmp; -+ data[i] = over % 256; -+ over = over / 256; -+ } - -- while(over > 0) { -- ch = over % 256; -- over = over / 256; -+ while(over > 0) { -+ ch = over % 256; -+ over = over / 256; - -- ret = xmlSecBufferPrepend(bn, &ch, 1); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBufferPrepend", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=1"); -- return (-1); -- } -+ ret = xmlSecBufferPrepend(bn, &ch, 1); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBufferPrepend", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "size=1"); -+ return (-1); -+ } -+ } -+ } else { -+ for(over = -delta, i = xmlSecBufferGetSize(bn); (i > 0) && (over > 0);) { -+ xmlSecAssert2(data != NULL, -1); -+ -+ tmp = data[--i]; -+ if(tmp < over) { -+ data[i] = 0; -+ over = (over - tmp) / 256; -+ } else { -+ data[i] = tmp - over; -+ over = 0; -+ } -+ } - } -- - return(0); - } - -@@ -787,7 +944,7 @@ - } - - if(addLineBreaks) { -- xmlNodeAddContent(cur, BAD_CAST "\n"); -+ xmlNodeAddContent(cur, xmlSecStringCR); - } - - switch(format) { -@@ -833,7 +990,7 @@ - } - - if(addLineBreaks) { -- xmlNodeAddContent(cur, BAD_CAST "\n"); -+ xmlNodeAddContent(cur, xmlSecStringCR); - } - - return(0); ---- misc/xmlsec1-1.2.6/src/dl.c 2003-10-29 16:57:20.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/src/dl.c 2008-06-29 23:44:19.000000000 +0200 -@@ -329,6 +329,10 @@ - xmlSecCryptoDLInit(void) { - int ret; - -+ /* use xmlMalloc/xmlFree */ -+ xmlsec_lt_dlmalloc = xmlSecCryptoDLMalloc; -+ xmlsec_lt_dlfree = xmlSecCryptoDLFree; -+ - ret = xmlSecPtrListInitialize(&gXmlSecCryptoDLLibraries, xmlSecCryptoDLLibrariesListGetKlass()); - if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, -@@ -350,9 +354,6 @@ - } - /* TODO: LTDL_SET_PRELOADED_SYMBOLS(); */ - -- /* use xmlMalloc/xmlFree */ -- xmlsec_lt_dlmalloc = xmlSecCryptoDLMalloc; -- xmlsec_lt_dlfree = xmlSecCryptoDLFree; - return(0); - } - ---- misc/xmlsec1-1.2.6/src/mscrypto/Makefile.in 2008-06-29 23:44:40.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/Makefile.in 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,178 @@ --dummy -+# Makefile.in generated by automake 1.8.3 from Makefile.am. -+# @configure_input@ -+ -+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -+# 2003, 2004 Free Software Foundation, Inc. -+# This Makefile.in is free software; the Free Software Foundation -+# gives unlimited permission to copy and/or distribute it, -+# with or without modifications, as long as this notice is preserved. -+ -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -+# PARTICULAR PURPOSE. -+ -+@SET_MAKE@ -+ -+srcdir = @srcdir@ -+top_srcdir = @top_srcdir@ -+top_builddir = ../.. -+LTLIBRARIES = $(lib_LTLIBRARIES) -+am__DEPENDENCIES_1 = -+libxmlsec1_mscrypto_la_DEPENDENCIES = ../libxmlsec1.la \ -+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ -+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -+am__objects_1 = -+am_libxmlsec1_mscrypto_la_OBJECTS = akmngr.lo app.lo certkeys.lo ciphers.lo crypto.lo \ -+ digests.lo keysstore.lo kt_rsa.lo signatures.lo symkeys.lo \ -+ x509.lo x509vfy.lo $(am__objects_1) -+libxmlsec1_mscrypto_la_OBJECTS = $(am_libxmlsec1_mscrypto_la_OBJECTS) -+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -+depcomp = $(SHELL) $(top_srcdir)/depcomp -+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/app.Plo ./$(DEPDIR)/certkeys.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/ciphers.Plo ./$(DEPDIR)/crypto.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/digests.Plo ./$(DEPDIR)/keysstore.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/kt_rsa.Plo ./$(DEPDIR)/signatures.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/symkeys.Plo ./$(DEPDIR)/x509.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/x509vfy.Plo ./$(DEPDIR)/akmngr.Plo -+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ -+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ -+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ -+ $(AM_CFLAGS) $(CFLAGS) -+CCLD = $(CC) -+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ -+ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -+CC = @CC@ -+CCDEPMODE = @CCDEPMODE@ -+CFLAGS = @CFLAGS@ -+CPPFLAGS = @CPPFLAGS@ -+CYGPATH_W = @CYGPATH_W@ -+DEFS = @DEFS@ -+DEPDIR = @DEPDIR@ -+LDFLAGS = @LDFLAGS@ -+LIBS = @LIBS@ -+LIBTOOL = @LIBTOOL@ -+LIBXML_CFLAGS = @LIBXML_CFLAGS@ -+LIBXML_LIBS = @LIBXML_LIBS@ -+MSCRYPTO_CFLAGS = @MSCRYPTO_CFLAGS@ -+MSCRYPTO_LIBS = @MSCRYPTO_LIBS@ -+OBJEXT = @OBJEXT@ -+SHELL = @SHELL@ -+XMLSEC_DEFINES = @XMLSEC_DEFINES@ -+exec_prefix = @exec_prefix@ -+libdir = @libdir@ -+prefix = @prefix@ -+NULL = -+ -+INCLUDES = \ -+ -DPACKAGE=\"@PACKAGE@\" \ -+ -I$(top_srcdir) \ -+ -I$(top_srcdir)/include \ -+ $(XMLSEC_DEFINES) \ -+ $(MSCRYPTO_CFLAGS) \ -+ $(LIBXSLT_CFLAGS) \ -+ $(LIBXML_CFLAGS) \ -+ $(NULL) -+ -+lib_LTLIBRARIES = \ -+ libxmlsec1-mscrypto.la \ -+ $(NULL) -+ -+libxmlsec1_mscrypto_la_LIBADD = \ -+ ../libxmlsec1.la \ -+ $(MSCRYPTO_LIBS) \ -+ $(LIBXSLT_LIBS) \ -+ $(LIBXML_LIBS) \ -+ $(NULL) -+ -+libxmlsec1_mscrypto_la_LDFLAGS = \ -+ -version-info @XMLSEC_VERSION_INFO@ \ -+ $(NULL) -+ -+all: all-am -+ -+.SUFFIXES: -+.SUFFIXES: .c .lo .o .obj -+ -+clean-libLTLIBRARIES: -+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) -+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ -+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ -+ test "$$dir" = "$$p" && dir=.; \ -+ echo "rm -f \"$${dir}/so_locations\""; \ -+ rm -f "$${dir}/so_locations"; \ -+ done -+libxmlsec1-mscrypto.la: $(libxmlsec1_mscrypto_la_OBJECTS) $(libxmlsec1_mscrypto_la_DEPENDENCIES) -+ $(LINK) -rpath $(libdir) $(libxmlsec1_mscrypto_la_LDFLAGS) $(libxmlsec1_mscrypto_la_OBJECTS) $(libxmlsec1_mscrypto_la_LIBADD) $(LIBS) -+ -+mostlyclean-compile: -+ -rm -f *.$(OBJEXT) -+ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/akmngr.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/app.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/certkeys.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ciphers.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digests.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keysstore.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kt_rsa.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signatures.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symkeys.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x509.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/x509vfy.Plo@am__quote@ -+ -+.c.o: -+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(COMPILE) -c $< -+ -+.c.obj: -+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` -+ -+.c.lo: -+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ -+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ -+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< -+ -+mostlyclean-libtool: -+ -rm -f *.lo -+ -+clean-libtool: -+ -rm -rf .libs _libs -+ -+all-am: Makefile $(LTLIBRARIES) -+ -+mostlyclean-generic: -+ -+clean-generic: -+ -+clean: clean-am -+ -+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ -+ mostlyclean-am -+ -+mostlyclean: mostlyclean-am -+ -+mostlyclean-am: mostlyclean-compile mostlyclean-generic \ -+ mostlyclean-libtool -+ -+.PHONY: all all-am clean clean-generic \ -+ clean-libLTLIBRARIES clean-libtool \ -+ maintainer-clean-generic mostlyclean mostlyclean-compile \ -+ mostlyclean-generic mostlyclean-libtool -+ -+# Tell versions [3.59,3.63) of GNU make to not export all variables. -+# Otherwise a system limit (for SysV at least) may be exceeded. -+.NOEXPORT: ---- misc/xmlsec1-1.2.6/src/mscrypto/akmngr.c 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/akmngr.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,235 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright......................... -+ */ -+#include "globals.h" -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+#include <xmlsec/errors.h> -+ -+#include <xmlsec/mscrypto/crypto.h> -+#include <xmlsec/mscrypto/keysstore.h> -+#include <xmlsec/mscrypto/akmngr.h> -+#include <xmlsec/mscrypto/x509.h> -+ -+/** -+ * xmlSecMSCryptoAppliedKeysMngrCreate: -+ * @hKeyStore: the pointer to key store. -+ * @hCertStore: the pointer to certificate database. -+ * -+ * Create and load key store and certificate database into keys manager -+ * -+ * Returns keys manager pointer on success or NULL otherwise. -+ */ -+xmlSecKeysMngrPtr -+xmlSecMSCryptoAppliedKeysMngrCreate( -+ HCERTSTORE hKeyStore , -+ HCERTSTORE hCertStore -+) { -+ xmlSecKeyDataStorePtr certStore = NULL ; -+ xmlSecKeysMngrPtr keyMngr = NULL ; -+ xmlSecKeyStorePtr keyStore = NULL ; -+ -+ keyStore = xmlSecKeyStoreCreate( xmlSecMSCryptoKeysStoreId ) ; -+ if( keyStore == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeyStoreCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * At present, MS Crypto engine do not provide a way to setup a key store. -+ */ -+ if( keyStore != NULL ) { -+ /*TODO: binding key store.*/ -+ } -+ -+ keyMngr = xmlSecKeysMngrCreate() ; -+ if( keyMngr == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Add key store to manager, from now on keys manager destroys the store if -+ * needed -+ */ -+ if( xmlSecKeysMngrAdoptKeysStore( keyMngr, keyStore ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecKeysMngrAdoptKeyStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ xmlSecKeysMngrDestroy( keyMngr ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Initialize crypto library specific data in keys manager -+ */ -+ if( xmlSecMSCryptoKeysMngrInit( keyMngr ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecMSCryptoKeysMngrInit" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeysMngrDestroy( keyMngr ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Set certificate databse to X509 key data store -+ */ -+ /*- -+ * At present, MS Crypto engine do not provide a way to setup a cert store. -+ */ -+ -+ /*- -+ * Set the getKey callback -+ */ -+ keyMngr->getKey = xmlSecKeysMngrGetKey ; -+ -+ return keyMngr ; -+} -+ -+int -+xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ HCRYPTKEY symKey -+) { -+ /*TODO: import the key into keys manager.*/ -+ return(0) ; -+} -+ -+int -+xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ HCRYPTKEY pubKey -+) { -+ /*TODO: import the key into keys manager.*/ -+ return(0) ; -+} -+ -+int -+xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ HCRYPTKEY priKey -+) { -+ /*TODO: import the key into keys manager.*/ -+ return(0) ; -+} -+ -+int -+xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore ( -+ xmlSecKeysMngrPtr mngr , -+ HCERTSTORE keyStore -+) { -+ xmlSecKeyDataStorePtr x509Store ; -+ -+ xmlSecAssert2( mngr != NULL, -1 ) ; -+ xmlSecAssert2( keyStore != NULL, -1 ) ; -+ -+ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ; -+ if( x509Store == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrGetDataStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ) ; -+ } -+ -+ if( xmlSecMSCryptoX509StoreAdoptKeyStore( x509Store, keyStore ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) , -+ "xmlSecMSCryptoX509StoreAdoptKeyStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ) ; -+ } -+ -+ return( 0 ) ; -+} -+ -+int -+xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore ( -+ xmlSecKeysMngrPtr mngr , -+ HCERTSTORE trustedStore -+) { -+ xmlSecKeyDataStorePtr x509Store ; -+ -+ xmlSecAssert2( mngr != NULL, -1 ) ; -+ xmlSecAssert2( trustedStore != NULL, -1 ) ; -+ -+ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ; -+ if( x509Store == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrGetDataStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ) ; -+ } -+ -+ if( xmlSecMSCryptoX509StoreAdoptTrustedStore( x509Store, trustedStore ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) , -+ "xmlSecMSCryptoX509StoreAdoptKeyStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ) ; -+ } -+ -+ return( 0 ) ; -+} -+ -+int -+xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore ( -+ xmlSecKeysMngrPtr mngr , -+ HCERTSTORE untrustedStore -+) { -+ xmlSecKeyDataStorePtr x509Store ; -+ -+ xmlSecAssert2( mngr != NULL, -1 ) ; -+ xmlSecAssert2( untrustedStore != NULL, -1 ) ; -+ -+ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ; -+ if( x509Store == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrGetDataStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ) ; -+ } -+ -+ if( xmlSecMSCryptoX509StoreAdoptUntrustedStore( x509Store, untrustedStore ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) , -+ "xmlSecMSCryptoX509StoreAdoptKeyStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ) ; -+ } -+ -+ return( 0 ) ; -+} -+ ---- misc/xmlsec1-1.2.6/src/mscrypto/certkeys.c 2004-03-17 06:06:43.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/certkeys.c 2008-06-29 23:44:19.000000000 +0200 -@@ -41,6 +41,7 @@ - * a public key from xml document is provided, we need HCRYPTKEY.... The focus - * now is however directed to certificates. Wouter - */ -+/** replaced by a wrapper style for WINNT 4.0 - struct _xmlSecMSCryptoKeyDataCtx { - HCRYPTPROV hProv; - BOOL fCallerFreeProv; -@@ -51,6 +52,124 @@ - HCRYPTKEY hKey; - xmlSecKeyDataType type; - }; -+*/ -+/*- -+ * A wrapper of HCRYPTKEY, a reference countor is introduced, the function is -+ * the same as CryptDuplicateKey. Because the CryptDuplicateKey is not support -+ * by WINNT 4.0, the wrapper will enable the library work on WINNT 4.0 -+ */ -+struct _mscrypt_key { -+ HCRYPTKEY hKey ; -+ int refcnt ; -+} ; -+ -+/*- -+ * A wrapper of HCRYPTPROV, a reference countor is introduced, the function is -+ * the same as CryptContextAddRef. Because the CryptContextAddRef is not support -+ * by WINNT 4.0, the wrapper will enable the library work on WINNT 4.0 -+ */ -+struct _mscrypt_prov { -+ HCRYPTPROV hProv ; -+ BOOL freeprov ; -+ int refcnt ; -+} ; -+ -+struct _xmlSecMSCryptoKeyDataCtx { -+ struct _mscrypt_prov* p_prov ; -+ LPCTSTR providerName; -+ DWORD providerType; -+ PCCERT_CONTEXT pCert; -+ DWORD dwKeySpec; -+ struct _mscrypt_key* p_key ; -+ xmlSecKeyDataType type; -+}; -+ -+struct _mscrypt_key* mscrypt_create_key( HCRYPTKEY key ) { -+ struct _mscrypt_key* pkey ; -+ -+ pkey = ( struct _mscrypt_key* )xmlMalloc( sizeof( struct _mscrypt_key ) ) ; -+ if( pkey == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ "mscrypt_create_key" , -+ NULL , -+ XMLSEC_ERRORS_R_MALLOC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE -+ ) ; -+ } -+ -+ pkey->hKey = key ; -+ pkey->refcnt = 1 ; -+ -+ return pkey ; -+} -+ -+struct _mscrypt_key* mscrypt_acquire_key( struct _mscrypt_key* key ) { -+ if( key ) -+ key->refcnt ++ ; -+ -+ return key ; -+} -+ -+int mscrypt_release_key( struct _mscrypt_key* key ) { -+ if( key ) { -+ key->refcnt -- ; -+ if( !key->refcnt ) { -+ if( key->hKey ) { -+ CryptDestroyKey( key->hKey ) ; -+ key->hKey = 0 ; -+ } -+ xmlFree( key ) ; -+ } else { -+ return key->refcnt ; -+ } -+ } -+ -+ return 0 ; -+} -+ -+struct _mscrypt_prov* mscrypt_create_prov( HCRYPTPROV prov, BOOL callerFree ) { -+ struct _mscrypt_prov* pprov ; -+ -+ pprov = ( struct _mscrypt_prov* )xmlMalloc( sizeof( struct _mscrypt_prov ) ) ; -+ if( pprov == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ "mscrypt_create_prov" , -+ NULL , -+ XMLSEC_ERRORS_R_MALLOC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE -+ ) ; -+ } -+ -+ pprov->hProv = prov ; -+ pprov->freeprov = callerFree ; -+ pprov->refcnt = 1 ; -+ -+ return pprov ; -+} -+ -+struct _mscrypt_prov* mscrypt_acquire_prov( struct _mscrypt_prov* prov ) { -+ if( prov ) -+ prov->refcnt ++ ; -+ -+ return prov ; -+} -+ -+int mscrypt_release_prov( struct _mscrypt_prov* prov ) { -+ if( prov ) { -+ prov->refcnt -- ; -+ if( !prov->refcnt ) { -+ if( prov->hProv && prov->freeprov ) { -+ CryptReleaseContext( prov->hProv, 0 ) ; -+ prov->hProv = 0 ; -+ } -+ xmlFree( prov ) ; -+ } else { -+ return prov->refcnt ; -+ } -+ } -+ -+ return 0 ; -+} - - /****************************************************************************** - * -@@ -88,24 +207,20 @@ - ctx = xmlSecMSCryptoKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); - -- if (ctx->hKey != 0) { -- CryptDestroyKey(ctx->hKey); -- ctx->hKey = 0; -- } -+ if( ctx->p_key != 0 ) { -+ mscrypt_release_key( ctx->p_key ) ; -+ } -+ ctx->p_key = mscrypt_create_key( 0 ) ; - - if(ctx->pCert != NULL) { - CertFreeCertificateContext(ctx->pCert); - ctx->pCert = NULL; - } - -- if ((ctx->hProv != 0) && (ctx->fCallerFreeProv)) { -- CryptReleaseContext(ctx->hProv, 0); -- ctx->hProv = 0; -- ctx->fCallerFreeProv = FALSE; -- } else { -- ctx->hProv = 0; -- ctx->fCallerFreeProv = FALSE; -- } -+ if( ( ctx->p_prov ) ) { -+ mscrypt_release_prov( ctx->p_prov ) ; -+ } -+ ctx->p_prov = mscrypt_create_prov( 0, FALSE ) ; - - ctx->type = type; - -@@ -116,9 +231,9 @@ - if (!CryptAcquireCertificatePrivateKey(pCert, - CRYPT_ACQUIRE_USE_PROV_INFO_FLAG, - NULL, -- &(ctx->hProv), -+ &(ctx->p_prov->hProv), - &(ctx->dwKeySpec), -- &(ctx->fCallerFreeProv))) { -+ &(ctx->p_prov->freeprov))) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "CryptAcquireCertificatePrivateKey", -@@ -127,46 +242,39 @@ - return(-1); - } - } else if((type & xmlSecKeyDataTypePublic) != 0){ -- if (!CryptAcquireContext(&(ctx->hProv), -+ if (!CryptAcquireContext(&(ctx->p_prov->hProv), - NULL, -- ctx->providerName, -+ NULL, /*AF: replaces "ctx->providerName" with "NULL" */ - ctx->providerType, - CRYPT_VERIFYCONTEXT)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CryptAcquireContext", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- ctx->dwKeySpec = 0; -- ctx->fCallerFreeProv = TRUE; -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "CryptAcquireContext", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ ctx->dwKeySpec = 0; -+ ctx->p_prov->freeprov = TRUE; -+ -+ if( !CryptImportPublicKeyInfo( ctx->p_prov->hProv, -+ X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, -+ &(pCert->pCertInfo->SubjectPublicKeyInfo), -+ &(ctx->p_key->hKey) ) ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "CryptImportPublicKeyInfo", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } - } else { -- xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - NULL, - XMLSEC_ERRORS_R_XMLSEC_FAILED, - "Unsupported keytype"); -- return(-1); -- } -- -- /* CryptImportPublicKeyInfo is only needed when a real key handle -- * is needed. The key handle is needed for de/encrypting and for -- * verifying of a signature, *not* for signing. We could call -- * CryptImportPublicKeyInfo in xmlSecMSCryptoKeyDataGetKey instead -- * so no unnessecary calls to CryptImportPublicKeyInfo are being -- * made. WK -- */ -- if(!CryptImportPublicKeyInfo(ctx->hProv, -- X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, -- &(pCert->pCertInfo->SubjectPublicKeyInfo), -- &(ctx->hKey))) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CryptImportPublicKeyInfo", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -+ return(-1); - } - ctx->pCert = pCert; - -@@ -190,29 +298,26 @@ - ctx = xmlSecMSCryptoKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); - -- if(ctx->hKey != 0) { -- CryptDestroyKey(ctx->hKey); -- ctx->hKey = 0; -- } -+ if( ctx->p_key != 0 ) { -+ mscrypt_release_key( ctx->p_key ) ; -+ ctx->p_key = NULL ; -+ } - - if(ctx->pCert != NULL) { - CertFreeCertificateContext(ctx->pCert); - ctx->pCert = NULL; - } - -- if((ctx->hProv != 0) && ctx->fCallerFreeProv) { -- CryptReleaseContext(ctx->hProv, 0); -- ctx->hProv = 0; -- ctx->fCallerFreeProv = FALSE; -- } else { -- ctx->hProv = 0; -- ctx->fCallerFreeProv = FALSE; -- } -+ if( ( ctx->p_prov ) ) { -+ mscrypt_release_prov( ctx->p_prov ) ; -+ ctx->p_prov = NULL ; -+ } else { -+ ctx->p_prov = NULL ; -+ } - -- ctx->hProv = hProv; -- ctx->fCallerFreeProv = fCallerFreeProv; -+ ctx->p_prov = mscrypt_create_prov( hProv, FALSE ) ; - ctx->dwKeySpec = dwKeySpec; -- ctx->hKey = hKey; -+ ctx->p_key = mscrypt_create_key( hKey ) ; - ctx->type = type; - - return(0); -@@ -238,7 +343,7 @@ - ctx = xmlSecMSCryptoKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, 0); - -- return(ctx->hKey); -+ return( ctx->p_key ? ctx->p_key->hKey : 0 ); - } - - /** -@@ -273,7 +378,7 @@ - ctx = xmlSecMSCryptoKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, 0); - -- return(ctx->hProv); -+ return( ctx->p_prov ? ctx->p_prov->hProv : 0 ); - } - - DWORD -@@ -316,25 +421,36 @@ - XMLSEC_ERRORS_NO_MESSAGE); - return(-1); - } -- } -- -- if (ctxSrc->hKey != 0) { -- if (!CryptDuplicateKey(ctxSrc->hKey, NULL, 0, &(ctxDst->hKey))) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)), -- "CryptDuplicateKey", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } - } -- if(ctxSrc->hProv != 0) { -- CryptContextAddRef(ctxSrc->hProv, NULL, 0); -- ctxDst->hProv = ctxSrc->hProv; -- ctxDst->fCallerFreeProv = TRUE; -- } else { -- ctxDst->hProv = 0; -- ctxDst->fCallerFreeProv = FALSE; -+ -+ if( ctxSrc->p_key ) { -+ if( ctxDst->p_key ) -+ mscrypt_release_key( ctxDst->p_key ) ; -+ -+ ctxDst->p_key = mscrypt_acquire_key( ctxSrc->p_key ) ; -+ if( !ctxDst->p_key ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)), -+ "mscrypt_acquire_key", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ } -+ -+ if( ctxSrc->p_prov ) { -+ if( ctxDst->p_prov ) -+ mscrypt_release_prov( ctxDst->p_prov ) ; -+ -+ ctxDst->p_prov = mscrypt_acquire_prov( ctxSrc->p_prov ) ; -+ if( !ctxDst->p_prov ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)), -+ "mscrypt_acquire_prov", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } - } - - ctxDst->dwKeySpec = ctxSrc->dwKeySpec; -@@ -355,16 +471,16 @@ - ctx = xmlSecMSCryptoKeyDataGetCtx(data); - xmlSecAssert(ctx != NULL); - -- if (ctx->hKey != 0) { -- CryptDestroyKey(ctx->hKey); -+ if( ctx->p_key ) { -+ mscrypt_release_key( ctx->p_key ) ; - } - - if(ctx->pCert != NULL) { - CertFreeCertificateContext(ctx->pCert); - } - -- if ((ctx->hProv != 0) && ctx->fCallerFreeProv) { -- CryptReleaseContext(ctx->hProv, 0); -+ if( ctx->p_prov ) { -+ mscrypt_release_prov( ctx->p_prov ) ; - } - - memset(ctx, 0, sizeof(xmlSecMSCryptoKeyDataCtx)); -@@ -384,14 +500,14 @@ - xmlSecAssert2(ctx->pCert->pCertInfo != NULL, 0); - return (CertGetPublicKeyLength(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, - &(ctx->pCert->pCertInfo->SubjectPublicKeyInfo))); -- } else if (ctx->hKey != 0) { -+ } else if (ctx->p_key != 0 && ctx->p_key->hKey != 0 ) { - DWORD length = 0; - DWORD lenlen = sizeof(DWORD); -- -- if (!CryptGetKeyParam(ctx->hKey, KP_KEYLEN, (BYTE *)&length, &lenlen, 0)) { -+ -+ if (!CryptGetKeyParam(ctx->p_key->hKey, KP_KEYLEN, (BYTE *)&length, &lenlen, 0)) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, -- "CertDuplicateCertificateContext", -+ "CryptGetKeyParam", - XMLSEC_ERRORS_R_CRYPTO_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); - return(0); -@@ -581,7 +697,11 @@ - static void xmlSecMSCryptoKeyDataRsaDebugDump(xmlSecKeyDataPtr data, FILE* output); - static void xmlSecMSCryptoKeyDataRsaDebugXmlDump(xmlSecKeyDataPtr data, FILE* output); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecMSCryptoKeyDataRsaKlass = { -+#else - static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataRsaKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecMSCryptoKeyDataSize, - -@@ -938,9 +1058,10 @@ - - ctx = xmlSecMSCryptoKeyDataGetCtx(xmlSecKeyGetValue(key)); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->hKey != 0, -1); -+ xmlSecAssert2(ctx->p_key != 0, -1); -+ xmlSecAssert2(ctx->p_key->hKey != 0, -1); - -- if (!CryptExportKey(ctx->hKey, 0, PUBLICKEYBLOB, 0, NULL, &dwBlobLen)) { -+ if (!CryptExportKey(ctx->p_key->hKey, 0, PUBLICKEYBLOB, 0, NULL, &dwBlobLen)) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "CryptExportKey", -@@ -960,7 +1081,7 @@ - } - - blob = xmlSecBufferGetData(&buf); -- if (!CryptExportKey(ctx->hKey, 0, PUBLICKEYBLOB, 0, blob, &dwBlobLen)) { -+ if (!CryptExportKey(ctx->p_key->hKey, 0, PUBLICKEYBLOB, 0, blob, &dwBlobLen)) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "CryptExportKey", -@@ -1295,7 +1416,11 @@ - static void xmlSecMSCryptoKeyDataDsaDebugXmlDump(xmlSecKeyDataPtr data, - FILE* output); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecMSCryptoKeyDataDsaKlass = { -+#else - static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataDsaKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecMSCryptoKeyDataSize, - -@@ -1797,9 +1922,10 @@ - - ctx = xmlSecMSCryptoKeyDataGetCtx(xmlSecKeyGetValue(key)); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->hKey != 0, -1); -+ xmlSecAssert2(ctx->p_key != 0, -1); -+ xmlSecAssert2(ctx->p_key->hKey != 0, -1); - -- if (!CryptExportKey(ctx->hKey, 0, PUBLICKEYBLOB, 0, NULL, &dwBlobLen)) { -+ if (!CryptExportKey(ctx->p_key->hKey, 0, PUBLICKEYBLOB, 0, NULL, &dwBlobLen)) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "CryptExportKey", -@@ -1819,7 +1945,7 @@ - } - - blob = xmlSecBufferGetData(&buf); -- if (!CryptExportKey(ctx->hKey, 0, PUBLICKEYBLOB, 0, blob, &dwBlobLen)) { -+ if (!CryptExportKey(ctx->p_key->hKey, 0, PUBLICKEYBLOB, 0, blob, &dwBlobLen)) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "CryptExportKey", -@@ -2010,7 +2136,6 @@ - HCRYPTKEY hKey = 0; - DWORD dwKeySpec; - DWORD dwSize; -- int res = -1; - int ret; - - xmlSecAssert2(xmlSecKeyDataIsValid(data), xmlSecKeyDataTypeUnknown); -@@ -2043,12 +2168,14 @@ - dwKeySpec = AT_SIGNATURE; - dwSize = ((sizeBits << 16) | CRYPT_EXPORTABLE); - if (!CryptGenKey(hProv, CALG_DSS_SIGN, dwSize, &hKey)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "CryptGenKey", - XMLSEC_ERRORS_R_CRYPTO_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -+ if (hProv != 0) -+ CryptReleaseContext(hProv, 0); -+ return -1 ; - } - - ret = xmlSecMSCryptoKeyDataAdoptKey(data, hProv, TRUE, hKey, dwKeySpec, -@@ -2059,24 +2186,17 @@ - "xmlSecMSCryptoKeyDataAdoptKey", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- hProv = 0; -- hKey = 0; -+ if( hKey != 0 ) -+ CryptDestroyKey( hKey ) ; -+ if( hProv != 0 ) -+ CryptReleaseContext( hProv, 0 ) ; - -- /* success */ -- res = 0; -- --done: -- if (hProv != 0) { -- CryptReleaseContext(ctx->hProv, 0); -+ return -1 ; - } -+ hProv = 0 ; -+ hKey = 0 ; - -- if (hKey != 0) { -- CryptDestroyKey(hKey); -- } -- -- return(res); -+ return 0 ; - } - - static xmlSecKeyDataType ---- misc/xmlsec1-1.2.6/src/mscrypto/ciphers.c 2003-09-26 08:12:51.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/ciphers.c 2008-06-29 23:44:19.000000000 +0200 -@@ -785,7 +785,11 @@ - * AES CBC cipher transforms - * - ********************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoAes128CbcKlass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoAes128CbcKlass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecMSCryptoBlockCipherSize, /* xmlSecSize objSize */ -@@ -824,7 +828,11 @@ - return(&xmlSecMSCryptoAes128CbcKlass); - } - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoAes192CbcKlass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoAes192CbcKlass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecMSCryptoBlockCipherSize, /* xmlSecSize objSize */ -@@ -863,7 +871,11 @@ - return(&xmlSecMSCryptoAes192CbcKlass); - } - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoAes256CbcKlass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoAes256CbcKlass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecMSCryptoBlockCipherSize, /* xmlSecSize objSize */ -@@ -906,7 +918,11 @@ - - - #ifndef XMLSEC_NO_DES -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoDes3CbcKlass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoDes3CbcKlass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* size_t klassSize */ - xmlSecMSCryptoBlockCipherSize, /* size_t objSize */ ---- misc/xmlsec1-1.2.6/src/mscrypto/crypto.c 2003-11-12 03:38:51.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/crypto.c 2008-06-29 23:44:19.000000000 +0200 -@@ -330,13 +330,15 @@ - BYTE* - xmlSecMSCryptoCertStrToName(DWORD dwCertEncodingType, LPCTSTR pszX500, DWORD dwStrType, DWORD* len) { - BYTE* str = NULL; -- -+ LPCTSTR ppszError = NULL; -+ - xmlSecAssert2(pszX500 != NULL, NULL); - xmlSecAssert2(len != NULL, NULL); - - if (!CertStrToName(dwCertEncodingType, pszX500, dwStrType, -- NULL, NULL, len, NULL)) { -+ NULL, NULL, len, &ppszError)) { - /* this might not be an error, string might just not exist */ -+ DWORD dw = GetLastError(); - return(NULL); - } - ---- misc/xmlsec1-1.2.6/src/mscrypto/digests.c 2003-09-30 04:09:51.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/digests.c 2008-06-29 23:44:19.000000000 +0200 -@@ -96,12 +96,15 @@ - - /* TODO: Check what provider is best suited here.... */ - if (!CryptAcquireContext(&ctx->provider, NULL, MS_STRONG_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- NULL, -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -+ //#i57942# This is also committed in rev 1.4 of this file in the xmlsec project -+ if (!CryptAcquireContext(&ctx->provider, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -+ NULL, -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ } -+ return(0); - } - - return(0); -@@ -298,7 +301,11 @@ - * SHA1 - * - *****************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* size_t klassSize */ - xmlSecMSCryptoDigestSize, /* size_t objSize */ ---- misc/xmlsec1-1.2.6/src/mscrypto/keysstore.c 2003-09-27 05:12:22.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/keysstore.c 2008-06-29 23:44:19.000000000 +0200 -@@ -62,7 +62,11 @@ - const xmlChar* name, - xmlSecKeyInfoCtxPtr keyInfoCtx); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyStoreKlass xmlSecMSCryptoKeysStoreKlass = { -+#else - static xmlSecKeyStoreKlass xmlSecMSCryptoKeysStoreKlass = { -+#endif - sizeof(xmlSecKeyStoreKlass), - xmlSecMSCryptoKeysStoreSize, - ---- misc/xmlsec1-1.2.6/src/mscrypto/kt_rsa.c 2003-09-26 22:29:25.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/kt_rsa.c 2008-06-29 23:44:19.000000000 +0200 -@@ -66,7 +66,11 @@ - static int xmlSecMSCryptoRsaPkcs1Process (xmlSecTransformPtr transform, - xmlSecTransformCtxPtr transformCtx); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoRsaPkcs1Klass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoRsaPkcs1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecMSCryptoRsaPkcs1Size, /* xmlSecSize objSize */ ---- misc/xmlsec1-1.2.6/src/mscrypto/signatures.c 2003-09-26 22:29:25.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/signatures.c 2008-06-29 23:44:19.000000000 +0200 -@@ -483,7 +483,11 @@ - * RSA-SHA1 signature transform - * - ***************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoRsaSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoRsaSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecMSCryptoSignatureSize, /* xmlSecSize objSize */ -@@ -531,7 +535,11 @@ - * - ***************************************************************************/ - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecMSCryptoDsaSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecMSCryptoDsaSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecMSCryptoSignatureSize, /* xmlSecSize objSize */ ---- misc/xmlsec1-1.2.6/src/mscrypto/symkeys.c 2003-09-26 02:58:13.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/symkeys.c 2008-06-29 23:44:19.000000000 +0200 -@@ -72,7 +72,11 @@ - * <xmlsec:AESKeyValue> processing - * - *************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecMSCryptoKeyDataAesKlass = { -+#else - static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataAesKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecKeyDataBinarySize, - -@@ -153,7 +157,11 @@ - * <xmlsec:DESKeyValue> processing - * - *************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecMSCryptoKeyDataDesKlass = { -+#else - static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataDesKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecKeyDataBinarySize, - ---- misc/xmlsec1-1.2.6/src/mscrypto/x509.c 2003-09-26 02:58:13.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/x509.c 2008-06-29 23:44:19.000000000 +0200 -@@ -240,7 +240,11 @@ - - - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecMSCryptoKeyDataX509Klass = { -+#else - static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataX509Klass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecMSCryptoX509DataSize, - -@@ -1572,6 +1576,7 @@ - xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlSecMSCryptoX509DataCtxPtr ctx; - xmlSecKeyDataStorePtr x509Store; -+ PCCERT_CONTEXT pCert ; - int ret; - - xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecMSCryptoKeyDataX509Id), -1); -@@ -1610,6 +1615,53 @@ - return(-1); - } - -+ /* -+ * I'll search key according to KeyReq. -+ */ -+ pCert = CertDuplicateCertificateContext( ctx->keyCert ) ; -+ if( pCert == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "CertDuplicateCertificateContext", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ -+ return(-1); -+ } -+ -+ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) { -+ keyValue = xmlSecMSCryptoCertAdopt( pCert, xmlSecKeyDataTypePrivate ) ; -+ if(keyValue == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "xmlSecMSCryptoCertAdopt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ -+ CertFreeCertificateContext( pCert ) ; -+ return(-1); -+ } -+ pCert = NULL ; -+ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) { -+ keyValue = xmlSecMSCryptoCertAdopt( pCert, xmlSecKeyDataTypePublic ) ; -+ if(keyValue == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "xmlSecMSCryptoCertAdopt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ -+ CertFreeCertificateContext( pCert ) ; -+ return(-1); -+ } -+ pCert = NULL ; -+ } -+ -+ -+ -+ /*- -+ * Get Public key from cert, which does not always work for sign action. -+ * - keyValue = xmlSecMSCryptoX509CertGetKey(ctx->keyCert); - if(keyValue == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, -@@ -1619,6 +1671,51 @@ - XMLSEC_ERRORS_NO_MESSAGE); - return(-1); - } -+ */ -+ -+ /*- -+ * I'll search key according to KeyReq. -+ */ -+ pCert = CertDuplicateCertificateContext( ctx->keyCert ) ; -+ if( pCert == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "CertDuplicateCertificateContext", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ -+ return(-1); -+ } -+ -+ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) { -+ keyValue = xmlSecMSCryptoCertAdopt( pCert, xmlSecKeyDataTypePrivate ) ; -+ if(keyValue == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "xmlSecMSCryptoCertAdopt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ -+ CertFreeCertificateContext( pCert ) ; -+ return(-1); -+ } -+ pCert = NULL ; -+ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) { -+ keyValue = xmlSecMSCryptoCertAdopt( pCert, xmlSecKeyDataTypePublic ) ; -+ if(keyValue == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "xmlSecMSCryptoCertAdopt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ -+ CertFreeCertificateContext( pCert ) ; -+ return(-1); -+ } -+ pCert = NULL ; -+ } -+ -+ - - /* verify that the key matches our expectations */ - if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), keyValue) != 1) { -@@ -1882,7 +1979,7 @@ - xmlSecAssert2(nm->pbData != NULL, NULL); - xmlSecAssert2(nm->cbData > 0, NULL); - -- csz = CertNameToStr(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, nm, CERT_X500_NAME_STR, NULL, 0); -+ csz = CertNameToStr(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, nm, CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG, NULL, 0); - str = (char *)xmlMalloc(csz); - if (NULL == str) { - xmlSecError(XMLSEC_ERRORS_HERE, -@@ -1893,7 +1990,7 @@ - return (NULL); - } - -- csz = CertNameToStr(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, nm, CERT_X500_NAME_STR, str, csz); -+ csz = CertNameToStr(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, nm, CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG, str, csz); - if (csz < 1) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, -@@ -1904,17 +2001,37 @@ - return(NULL); - } - -- res = xmlStrdup(BAD_CAST str); -- if(res == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlStrdup", -- XMLSEC_ERRORS_R_MALLOC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- xmlFree(str); -- return(NULL); -+ /* aleksey: this is a hack, but mscrypto can not read E= flag and wants Email= instead. -+ * don't ask me how is it possible not to read something you wrote yourself but also -+ * see comment in the xmlSecMSCryptoX509FindCert function. -+ */ -+ if(strncmp(str, "E=", 2) == 0) { -+ res = xmlMalloc(strlen(str) + 13 + 1); -+ if(res == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlMalloc", -+ XMLSEC_ERRORS_R_MALLOC_FAILED, -+ "size=%d", -+ strlen(str) + 13 + 1); -+ xmlFree(str); -+ return(NULL); -+ } -+ -+ memcpy(res, "emailAddress=", 13); -+ strcpy(res + 13, BAD_CAST (str + 2)); -+ } else { -+ res = xmlStrdup(BAD_CAST str); -+ if(res == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlStrdup", -+ XMLSEC_ERRORS_R_MALLOC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlFree(str); -+ return(NULL); -+ } - } -- - xmlFree(str); - return(res); - } -@@ -2153,7 +2270,11 @@ - xmlSecSize bufSize, - xmlSecKeyInfoCtxPtr keyInfoCtx); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecMSCryptoKeyDataRawX509CertKlass = { -+#else - static xmlSecKeyDataKlass xmlSecMSCryptoKeyDataRawX509CertKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - sizeof(xmlSecKeyData), - ---- misc/xmlsec1-1.2.6/src/mscrypto/x509vfy.c 2003-09-27 05:12:22.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/mscrypto/x509vfy.c 2008-06-29 23:44:19.000000000 +0200 -@@ -70,7 +70,11 @@ - static xmlSecByte * xmlSecMSCryptoX509NameRead (xmlSecByte *str, - int len); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataStoreKlass xmlSecMSCryptoX509StoreKlass = { -+#else - static xmlSecKeyDataStoreKlass xmlSecMSCryptoX509StoreKlass = { -+#endif - sizeof(xmlSecKeyDataStoreKlass), - xmlSecMSCryptoX509StoreSize, - -@@ -125,6 +129,7 @@ - xmlChar *issuerName, xmlChar *issuerSerial, - xmlChar *ski, xmlSecKeyInfoCtx* keyInfoCtx) { - xmlSecMSCryptoX509StoreCtxPtr ctx; -+ PCCERT_CONTEXT pCert ; - - xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecMSCryptoX509StoreId), NULL); - xmlSecAssert2(keyInfoCtx != NULL, NULL); -@@ -132,10 +137,17 @@ - ctx = xmlSecMSCryptoX509StoreGetCtx(store); - xmlSecAssert2(ctx != NULL, NULL); - xmlSecAssert2(ctx->untrusted != NULL, NULL); -+ xmlSecAssert2(ctx->trusted != NULL, NULL); - -- return(xmlSecMSCryptoX509FindCert(ctx->untrusted, subjectName, issuerName, issuerSerial, ski)); --} -+ pCert = NULL ; -+ if( ctx->untrusted != NULL ) -+ pCert = xmlSecMSCryptoX509FindCert( ctx->untrusted, subjectName, issuerName, issuerSerial, ski ) ; -+ -+ if( ctx->trusted != NULL && pCert == NULL ) -+ pCert = xmlSecMSCryptoX509FindCert( ctx->trusted, subjectName, issuerName, issuerSerial, ski ) ; - -+ return( pCert ) ; -+} - - static void - xmlSecMSCryptoUnixTimeToFileTime(time_t t, LPFILETIME pft) { -@@ -252,17 +264,22 @@ - } - - static BOOL --xmlSecMSCryptoX509StoreConstructCertsChain(xmlSecKeyDataStorePtr store, PCCERT_CONTEXT cert, HCERTSTORE certs, -- xmlSecKeyInfoCtx* keyInfoCtx) { -+xmlSecMSCryptoX509StoreConstructCertsChain( -+ xmlSecKeyDataStorePtr store , -+ PCCERT_CONTEXT cert , -+ HCERTSTORE certStore , -+ xmlSecKeyInfoCtx* keyInfoCtx -+) { - xmlSecMSCryptoX509StoreCtxPtr ctx; - PCCERT_CONTEXT issuerCert = NULL; - FILETIME fTime; - DWORD flags; -+ BOOL selfSigned ; - - xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecMSCryptoX509StoreId), FALSE); - xmlSecAssert2(cert != NULL, FALSE); - xmlSecAssert2(cert->pCertInfo != NULL, FALSE); -- xmlSecAssert2(certs != NULL, FALSE); -+ xmlSecAssert2(certStore != NULL, FALSE); - xmlSecAssert2(keyInfoCtx != NULL, FALSE); - - ctx = xmlSecMSCryptoX509StoreGetCtx(store); -@@ -283,60 +300,85 @@ - return(FALSE); - } - -- if (!xmlSecMSCryptoCheckRevocation(certs, cert)) { -+ if (!xmlSecMSCryptoCheckRevocation(certStore, cert)) { - return(FALSE); - } - -- /* try the untrusted certs in the chain */ -- issuerCert = CertFindCertificateInStore(certs, -+ /*- -+ * Firstly try to find the cert in the trusted cert store. We will trust -+ * the certificate in the trusted store. -+ */ -+ issuerCert = CertFindCertificateInStore(ctx->trusted, - X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, - 0, - CERT_FIND_SUBJECT_NAME, -- &(cert->pCertInfo->Issuer), -+ &(cert->pCertInfo->Subject), - NULL); -- if(issuerCert == cert) { -- /* self signed cert, forget it */ -- CertFreeCertificateContext(issuerCert); -- } else if(issuerCert != NULL) { -- flags = CERT_STORE_REVOCATION_FLAG | CERT_STORE_SIGNATURE_FLAG; -- if(!CertVerifySubjectCertificateContext(cert, issuerCert, &flags)) { -- xmlSecMSCryptoX509StoreCertError(store, issuerCert, flags); -- CertFreeCertificateContext(issuerCert); -- return(FALSE); -- } -- if(!xmlSecMSCryptoX509StoreConstructCertsChain(store, issuerCert, certs, keyInfoCtx)) { -- xmlSecMSCryptoX509StoreCertError(store, issuerCert, flags); -- CertFreeCertificateContext(issuerCert); -- return(FALSE); -- } -- CertFreeCertificateContext(issuerCert); -- return(TRUE); -+ if( issuerCert != NULL ) { -+ /* We have found the trusted cert, so return true */ -+ CertFreeCertificateContext( issuerCert ) ; -+ return( TRUE ) ; - } - -- /* try the untrusted certs in the store */ -- issuerCert = CertFindCertificateInStore(ctx->untrusted, -+ /* Check whether the certificate is self signed certificate */ -+ selfSigned = CertCompareCertificateName( X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &(cert->pCertInfo->Subject), &(cert->pCertInfo->Issuer) ) ; -+ -+ /* try the untrusted certs in the chain */ -+ if( !selfSigned ) { -+ issuerCert = CertFindCertificateInStore(certStore, - X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, - 0, - CERT_FIND_SUBJECT_NAME, - &(cert->pCertInfo->Issuer), - NULL); -- if(issuerCert == cert) { -- /* self signed cert, forget it */ -- CertFreeCertificateContext(issuerCert); -- } else if(issuerCert != NULL) { -- flags = CERT_STORE_REVOCATION_FLAG | CERT_STORE_SIGNATURE_FLAG; -- if(!CertVerifySubjectCertificateContext(cert, issuerCert, &flags)) { -- xmlSecMSCryptoX509StoreCertError(store, issuerCert, flags); -- CertFreeCertificateContext(issuerCert); -- return(FALSE); -- } -- if(!xmlSecMSCryptoX509StoreConstructCertsChain(store, issuerCert, certs, keyInfoCtx)) { -- CertFreeCertificateContext(issuerCert); -- return(FALSE); -+ if( issuerCert != NULL && CertCompareCertificate( X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cert->pCertInfo, issuerCert->pCertInfo ) ) { -+ /* self signed cert, forget it */ -+ CertFreeCertificateContext(issuerCert); -+ } else if(issuerCert != NULL) { -+ flags = CERT_STORE_REVOCATION_FLAG | CERT_STORE_SIGNATURE_FLAG; -+ if(!CertVerifySubjectCertificateContext(cert, issuerCert, &flags)) { -+ xmlSecMSCryptoX509StoreCertError(store, issuerCert, flags); -+ CertFreeCertificateContext(issuerCert); -+ return(FALSE); -+ } -+ if(!xmlSecMSCryptoX509StoreConstructCertsChain(store, issuerCert, certStore, keyInfoCtx)) { -+ xmlSecMSCryptoX509StoreCertError(store, issuerCert, flags); -+ CertFreeCertificateContext(issuerCert); -+ return(FALSE); -+ } -+ -+ CertFreeCertificateContext(issuerCert); -+ return(TRUE); -+ } -+ } -+ -+ /* try the untrusted certs in the store */ -+ if( !selfSigned ) { -+ issuerCert = CertFindCertificateInStore(ctx->untrusted, -+ X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, -+ 0, -+ CERT_FIND_SUBJECT_NAME, -+ &(cert->pCertInfo->Issuer), -+ NULL); -+ if( issuerCert != NULL && CertCompareCertificate( X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cert->pCertInfo, issuerCert->pCertInfo ) ) { -+ /* self signed cert, forget it */ -+ CertFreeCertificateContext(issuerCert); -+ } else if(issuerCert != NULL) { -+ flags = CERT_STORE_REVOCATION_FLAG | CERT_STORE_SIGNATURE_FLAG; -+ if(!CertVerifySubjectCertificateContext(cert, issuerCert, &flags)) { -+ xmlSecMSCryptoX509StoreCertError(store, issuerCert, flags); -+ CertFreeCertificateContext(issuerCert); -+ return(FALSE); -+ } -+ if(!xmlSecMSCryptoX509StoreConstructCertsChain(store, issuerCert, certStore, keyInfoCtx)) { -+ CertFreeCertificateContext(issuerCert); -+ return(FALSE); -+ } -+ -+ CertFreeCertificateContext(issuerCert); -+ return(TRUE); -+ } - } -- CertFreeCertificateContext(issuerCert); -- return(TRUE); -- } - - /* try to find issuer cert in the trusted cert in the store */ - issuerCert = CertFindCertificateInStore(ctx->trusted, -@@ -379,26 +421,61 @@ - xmlSecAssert2(certs != NULL, NULL); - xmlSecAssert2(keyInfoCtx != NULL, NULL); - -- while((cert = CertEnumCertificatesInStore(certs, cert)) != NULL){ -- PCCERT_CONTEXT nextCert = NULL; -+ while( ( cert = CertEnumCertificatesInStore( certs, cert ) ) != NULL ) { -+ PCCERT_CONTEXT nextCert ; -+ unsigned char selected ; - -- xmlSecAssert2(cert->pCertInfo != NULL, NULL); -+ xmlSecAssert2( cert->pCertInfo != NULL, NULL ) ; - -- /* if cert is the issuer of any other cert in the list, then it is -- * to be skipped */ -- nextCert = CertFindCertificateInStore(certs, -+ /* if cert is the issuer of any other cert in the list, then it is -+ * to be skipped except that the cert list only have one self-signed -+ * certificate. -+ */ -+ for( selected = 0, nextCert = NULL ; ; ) { -+ nextCert = CertFindCertificateInStore( certs, - X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, - 0, - CERT_FIND_ISSUER_NAME, - &(cert->pCertInfo->Subject), -- NULL); -- if(nextCert != NULL) { -- CertFreeCertificateContext(nextCert); -- continue; -- } -- if(xmlSecMSCryptoX509StoreConstructCertsChain(store, cert, certs, keyInfoCtx)) { -- return(cert); -- } -+ nextCert ) ; -+ if( nextCert != NULL ) { -+ if( CertCompareCertificate( X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, cert->pCertInfo, nextCert->pCertInfo ) ) { -+ selected = 1 ; -+ continue ; -+ } else { -+ selected = 0 ; -+ break ; -+ } -+ } else { -+ selected = 1 ; -+ break ; -+ } -+ } -+ -+ if( nextCert != NULL ) -+ CertFreeCertificateContext( nextCert ) ; -+ -+ if( !selected ) { -+ continue ; -+ } -+ -+ /* JL: OpenOffice.org implements its own certificate verification routine. -+ The goal is to seperate validation of the signature -+ and the certificate. For example, OOo could show that the document signature is valid, -+ but the certificate could not be verified. If we do not prevent the verification of -+ the certificate by libxmlsec and the verification fails, then the XML signature will not be -+ verified. This would happen, for example, if the root certificate is not installed. -+ -+ In the store schould only be the certificate from the X509Certificate element -+ and the X509IssuerSerial element. The latter is only there -+ if the certificate is installed. Both certificates must be the same! -+ In case of writing the signature, the store contains only the certificate that -+ was created based on the information from the X509IssuerSerial element. */ -+ return cert; -+ -+/* if( xmlSecMSCryptoX509StoreConstructCertsChain( store, cert, certs, keyInfoCtx ) ) { -+ return( cert ) ; -+ } */ - } - - return (NULL); -@@ -458,9 +535,126 @@ - return(0); - } - -+int -+xmlSecMSCryptoX509StoreAdoptKeyStore ( -+ xmlSecKeyDataStorePtr store, -+ HCERTSTORE keyStore -+) { -+ xmlSecMSCryptoX509StoreCtxPtr ctx; -+ int ret; -+ -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecMSCryptoX509StoreId), -1); -+ xmlSecAssert2( keyStore != NULL, -1); -+ -+ ctx = xmlSecMSCryptoX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, -1); -+ xmlSecAssert2(ctx->trusted != NULL, -1); -+ -+ if( !CertAddStoreToCollection ( ctx->trusted , keyStore , CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , 2 ) ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertAddStoreToCollection", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ { -+ PCCERT_CONTEXT ptCert ; -+ -+ ptCert = NULL ; -+ while( 1 ) { -+ ptCert = CertEnumCertificatesInStore( ctx->trusted, ptCert ) ; -+ if( ptCert == NULL ) -+ break ; -+ } -+ } -+ -+ return(0); -+} -+ -+int -+xmlSecMSCryptoX509StoreAdoptTrustedStore ( -+ xmlSecKeyDataStorePtr store, -+ HCERTSTORE trustedStore -+) { -+ xmlSecMSCryptoX509StoreCtxPtr ctx; -+ int ret; -+ -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecMSCryptoX509StoreId), -1); -+ xmlSecAssert2( trustedStore != NULL, -1); -+ -+ ctx = xmlSecMSCryptoX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, -1); -+ xmlSecAssert2(ctx->trusted != NULL, -1); -+ -+ if( !CertAddStoreToCollection ( ctx->trusted , trustedStore , CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , 3 ) ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertAddStoreToCollection", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ { -+ PCCERT_CONTEXT ptCert ; -+ -+ ptCert = NULL ; -+ while( 1 ) { -+ ptCert = CertEnumCertificatesInStore( ctx->trusted, ptCert ) ; -+ if( ptCert == NULL ) -+ break ; -+ } -+ } -+ -+ return(0); -+} -+ -+int -+xmlSecMSCryptoX509StoreAdoptUntrustedStore ( -+ xmlSecKeyDataStorePtr store, -+ HCERTSTORE untrustedStore -+) { -+ xmlSecMSCryptoX509StoreCtxPtr ctx; -+ int ret; -+ -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecMSCryptoX509StoreId), -1); -+ xmlSecAssert2( untrustedStore != NULL, -1); -+ -+ ctx = xmlSecMSCryptoX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, -1); -+ xmlSecAssert2(ctx->untrusted != NULL, -1); -+ -+ if( !CertAddStoreToCollection ( ctx->untrusted , untrustedStore , CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG , 2 ) ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertAddStoreToCollection", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ { -+ PCCERT_CONTEXT ptCert ; -+ -+ ptCert = NULL ; -+ while( 1 ) { -+ ptCert = CertEnumCertificatesInStore( ctx->untrusted, ptCert ) ; -+ if( ptCert == NULL ) -+ break ; -+ } -+ } -+ -+ return(0); -+} -+ - static int - xmlSecMSCryptoX509StoreInitialize(xmlSecKeyDataStorePtr store) { - xmlSecMSCryptoX509StoreCtxPtr ctx; -+ HCERTSTORE hTrustedMemStore ; -+ HCERTSTORE hUntrustedMemStore ; -+ - xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecMSCryptoX509StoreId), -1); - - ctx = xmlSecMSCryptoX509StoreGetCtx(store); -@@ -468,36 +662,104 @@ - - memset(ctx, 0, sizeof(xmlSecMSCryptoX509StoreCtx)); - -+ /* create trusted certs store collection */ -+ ctx->trusted = CertOpenStore(CERT_STORE_PROV_COLLECTION, -+ 0, -+ NULL, -+ 0, -+ NULL); -+ if(ctx->trusted == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertOpenStore", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ - /* create trusted certs store */ -- ctx->trusted = CertOpenStore(CERT_STORE_PROV_MEMORY, -+ hTrustedMemStore = CertOpenStore(CERT_STORE_PROV_MEMORY, - X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, - 0, - CERT_STORE_CREATE_NEW_FLAG, - NULL); -- if(ctx->trusted == NULL) { -+ if(hTrustedMemStore == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), - "CertOpenStore", - XMLSEC_ERRORS_R_CRYPTO_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -+ CertCloseStore(ctx->trusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ ctx->trusted = NULL ; - return(-1); - } - -- /* create trusted certs store */ -- ctx->untrusted = CertOpenStore(CERT_STORE_PROV_MEMORY, -+ /* add the memory trusted certs store to trusted certs store collection */ -+ if( !CertAddStoreToCollection( ctx->trusted, hTrustedMemStore, CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 1 ) ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertAddStoreToCollection", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ CertCloseStore(ctx->trusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ CertCloseStore(hTrustedMemStore, CERT_CLOSE_STORE_CHECK_FLAG); -+ ctx->trusted = NULL ; -+ return(-1); -+ } -+ CertCloseStore(hTrustedMemStore, CERT_CLOSE_STORE_CHECK_FLAG); -+ -+ /* create untrusted certs store collection */ -+ ctx->untrusted = CertOpenStore(CERT_STORE_PROV_COLLECTION, -+ 0, -+ NULL, -+ 0, -+ NULL); -+ if(ctx->untrusted == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertOpenStore", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ CertCloseStore(ctx->trusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ ctx->trusted = NULL ; -+ return(-1); -+ } -+ -+ /* create untrusted certs store */ -+ hUntrustedMemStore = CertOpenStore(CERT_STORE_PROV_MEMORY, - X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, - 0, - CERT_STORE_CREATE_NEW_FLAG, - NULL); -- if(ctx->untrusted == NULL) { -+ if(hUntrustedMemStore == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), - "CertOpenStore", - XMLSEC_ERRORS_R_CRYPTO_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -+ CertCloseStore(ctx->trusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ CertCloseStore(ctx->untrusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ ctx->trusted = NULL ; -+ ctx->untrusted = NULL ; - return(-1); - } - -+ /* add the memory trusted certs store to untrusted certs store collection */ -+ if( !CertAddStoreToCollection( ctx->untrusted, hUntrustedMemStore, CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG, 1 ) ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CertAddStoreToCollection", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ CertCloseStore(ctx->untrusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ CertCloseStore(ctx->trusted, CERT_CLOSE_STORE_FORCE_FLAG); -+ CertCloseStore(hUntrustedMemStore, CERT_CLOSE_STORE_CHECK_FLAG); -+ ctx->trusted = NULL ; -+ ctx->untrusted = NULL ; -+ return(-1); -+ } -+ CertCloseStore(hUntrustedMemStore, CERT_CLOSE_STORE_CHECK_FLAG); -+ - return(0); - } - -@@ -567,10 +829,41 @@ - - if((pCert == NULL) && (NULL != issuerName) && (NULL != issuerSerial)) { - xmlSecBn issuerSerialBn; -+ xmlChar * p; - CERT_NAME_BLOB cnb; -+ CRYPT_INTEGER_BLOB cib; - BYTE *cName = NULL; - DWORD cNameLen = 0; -+ -+ /* aleksey: for some unknown to me reasons, mscrypto wants Email -+ * instead of emailAddress. This code is not bullet proof and may -+ * produce incorrect results if someone has "emailAddress=" string -+ * in one of the fields, but it is best I can suggest to fix this problem. -+ * Also see xmlSecMSCryptoX509NameWrite function. -+ */ -+ while( (p = (xmlChar*)xmlStrstr(issuerName, BAD_CAST "emailAddress=")) != NULL) { -+ memcpy(p, " Email=", 13); -+ } -+ -+ -+ -+ /* get issuer name */ -+ cName = xmlSecMSCryptoCertStrToName(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, -+ issuerName, -+ CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG | CERT_OID_NAME_STR | CERT_NAME_STR_REVERSE_FLAG, -+ &cNameLen); -+ if(cName == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecMSCryptoCertStrToName", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return (NULL); -+ } -+ cnb.pbData = cName; -+ cnb.cbData = cNameLen; - -+ /* get serial number */ - ret = xmlSecBnInitialize(&issuerSerialBn, 0); - if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, -@@ -578,6 +871,7 @@ - "xmlSecBnInitialize", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -+ xmlFree(cName); - return(NULL); - } - -@@ -589,26 +883,30 @@ - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); - xmlSecBnFinalize(&issuerSerialBn); -- return(NULL); -+ xmlFree(cName); -+ return(NULL); - } - -- cName = xmlSecMSCryptoCertStrToName(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, -- issuerName, -- CERT_OID_NAME_STR | CERT_NAME_STR_REVERSE_FLAG, -- &cNameLen); -- if(cName == NULL) { -+ /* I have no clue why at a sudden a swap is needed to -+ * convert from lsb... This code is purely based upon -+ * trial and error :( WK -+ */ -+ ret = xmlSecBnReverse(&issuerSerialBn); -+ if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, - NULL, -- "xmlSecMSCryptoCertStrToName", -+ "xmlSecBnReverse", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); - xmlSecBnFinalize(&issuerSerialBn); -- return (NULL); -+ xmlFree(cName); -+ return(NULL); - } - -- cnb.pbData = cName; -- cnb.cbData = cNameLen; -- while((pCert = CertFindCertificateInStore(store, -+ cib.pbData = xmlSecBufferGetData(&issuerSerialBn); -+ cib.cbData = xmlSecBufferGetSize(&issuerSerialBn); -+ -+ while((pCert = CertFindCertificateInStore(store, - PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, - 0, - CERT_FIND_ISSUER_NAME, -@@ -622,10 +920,9 @@ - if((pCert->pCertInfo != NULL) && - (pCert->pCertInfo->SerialNumber.pbData != NULL) && - (pCert->pCertInfo->SerialNumber.cbData > 0) && -- (0 == xmlSecBnCompareReverse(&issuerSerialBn, pCert->pCertInfo->SerialNumber.pbData, -- pCert->pCertInfo->SerialNumber.cbData))) { -- -- break; -+ (CertCompareIntegerBlob(&(pCert->pCertInfo->SerialNumber), &cib) == TRUE) -+ ) { -+ break; - } - } - xmlFree(cName); ---- misc/xmlsec1-1.2.6/src/nss/Makefile.am 2003-09-16 11:43:03.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/Makefile.am 2008-06-29 23:44:19.000000000 +0200 -@@ -20,21 +20,22 @@ - $(NULL) - - libxmlsec1_nss_la_SOURCES =\ -+ akmngr.c \ - app.c \ - bignum.c \ - ciphers.c \ - crypto.c \ - digests.c \ - hmac.c \ -+ keysstore.c \ -+ keytrans.c \ -+ keywrapers.c \ - pkikeys.c \ - signatures.c \ - symkeys.c \ -+ tokens.c \ - x509.c \ - x509vfy.c \ -- keysstore.c \ -- kt_rsa.c \ -- kw_des.c \ -- kw_aes.c \ - $(NULL) - - libxmlsec1_nss_la_LIBADD = \ ---- misc/xmlsec1-1.2.6/src/nss/Makefile.in 2004-08-26 08:00:32.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/Makefile.in 2008-06-29 23:44:19.000000000 +0200 -@@ -54,9 +54,9 @@ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) - am__objects_1 = --am_libxmlsec1_nss_la_OBJECTS = app.lo bignum.lo ciphers.lo crypto.lo \ -+am_libxmlsec1_nss_la_OBJECTS = akmngr.lo app.lo bignum.lo ciphers.lo crypto.lo \ - digests.lo hmac.lo pkikeys.lo signatures.lo symkeys.lo x509.lo \ -- x509vfy.lo keysstore.lo kt_rsa.lo kw_des.lo kw_aes.lo \ -+ x509vfy.lo keysstore.lo tokens.lo keytrans.lo keywrapers.lo \ - $(am__objects_1) - libxmlsec1_nss_la_OBJECTS = $(am_libxmlsec1_nss_la_OBJECTS) - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -@@ -65,11 +65,11 @@ - @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/app.Plo ./$(DEPDIR)/bignum.Plo \ - @AMDEP_TRUE@ ./$(DEPDIR)/ciphers.Plo ./$(DEPDIR)/crypto.Plo \ - @AMDEP_TRUE@ ./$(DEPDIR)/digests.Plo ./$(DEPDIR)/hmac.Plo \ --@AMDEP_TRUE@ ./$(DEPDIR)/keysstore.Plo ./$(DEPDIR)/kt_rsa.Plo \ --@AMDEP_TRUE@ ./$(DEPDIR)/kw_aes.Plo ./$(DEPDIR)/kw_des.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/keysstore.Plo ./$(DEPDIR)/tokens.Plo \ -+@AMDEP_TRUE@ ./$(DEPDIR)/keywrapers.Plo ./$(DEPDIR)/keytrans.Plo \ - @AMDEP_TRUE@ ./$(DEPDIR)/pkikeys.Plo ./$(DEPDIR)/signatures.Plo \ - @AMDEP_TRUE@ ./$(DEPDIR)/symkeys.Plo ./$(DEPDIR)/x509.Plo \ --@AMDEP_TRUE@ ./$(DEPDIR)/x509vfy.Plo -+@AMDEP_TRUE@ ./$(DEPDIR)/x509vfy.Plo ./$(DEPDIR)/akmngr.Plo - COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ -@@ -321,21 +321,22 @@ - $(NULL) - - libxmlsec1_nss_la_SOURCES = \ -+ akmngr.c \ - app.c \ - bignum.c \ - ciphers.c \ - crypto.c \ - digests.c \ - hmac.c \ -+ keysstore.c \ -+ keytrans.c \ -+ keywrappers.c \ - pkikeys.c \ - signatures.c \ - symkeys.c \ -+ tokens.c \ - x509.c \ - x509vfy.c \ -- keysstore.c \ -- kt_rsa.c \ -- kw_des.c \ -- kw_aes.c \ - $(NULL) - - libxmlsec1_nss_la_LIBADD = \ -@@ -418,6 +419,7 @@ - distclean-compile: - -rm -f *.tab.c - -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/akmngr.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/app.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bignum.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ciphers.Plo@am__quote@ -@@ -425,9 +427,9 @@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/digests.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hmac.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keysstore.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kt_rsa.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kw_aes.Plo@am__quote@ --@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kw_des.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tokens.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keywrapers.Plo@am__quote@ -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keytrans.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkikeys.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signatures.Plo@am__quote@ - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symkeys.Plo@am__quote@ ---- misc/xmlsec1-1.2.6/src/nss/akmngr.c 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/akmngr.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,384 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright......................... -+ */ -+#include "globals.h" -+ -+#include <nspr.h> -+#include <nss.h> -+#include <pk11func.h> -+#include <cert.h> -+#include <keyhi.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+#include <xmlsec/errors.h> -+ -+#include <xmlsec/nss/crypto.h> -+#include <xmlsec/nss/tokens.h> -+#include <xmlsec/nss/akmngr.h> -+#include <xmlsec/nss/pkikeys.h> -+#include <xmlsec/nss/ciphers.h> -+#include <xmlsec/nss/keysstore.h> -+ -+/** -+ * xmlSecNssAppliedKeysMngrCreate: -+ * @slot: array of pointers to NSS PKCS#11 slot infomation. -+ * @cSlots: number of slots in the array -+ * @handler: the pointer to NSS certificate database. -+ * -+ * Create and load NSS crypto slot and certificate database into keys manager -+ * -+ * Returns keys manager pointer on success or NULL otherwise. -+ */ -+xmlSecKeysMngrPtr -+xmlSecNssAppliedKeysMngrCreate( -+ PK11SlotInfo** slots, -+ int cSlots, -+ CERTCertDBHandle* handler -+) { -+ xmlSecKeyDataStorePtr certStore = NULL ; -+ xmlSecKeysMngrPtr keyMngr = NULL ; -+ xmlSecKeyStorePtr keyStore = NULL ; -+ int islot = 0; -+ keyStore = xmlSecKeyStoreCreate( xmlSecNssKeysStoreId ) ; -+ if( keyStore == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeyStoreCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return NULL ; -+ } -+ -+ for (islot = 0; islot < cSlots; islot++) -+ { -+ xmlSecNssKeySlotPtr keySlot ; -+ -+ /* Create a key slot */ -+ keySlot = xmlSecNssKeySlotCreate() ; -+ if( keySlot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecNssKeySlotCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ return NULL ; -+ } -+ -+ /* Set slot */ -+ if( xmlSecNssKeySlotSetSlot( keySlot , slots[islot] ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecNssKeySlotSetSlot" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ xmlSecNssKeySlotDestroy( keySlot ) ; -+ return NULL ; -+ } -+ -+ /* Adopt keySlot */ -+ if( xmlSecNssKeysStoreAdoptKeySlot( keyStore , keySlot ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecNssKeysStoreAdoptKeySlot" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ xmlSecNssKeySlotDestroy( keySlot ) ; -+ return NULL ; -+ } -+ } -+ -+ keyMngr = xmlSecKeysMngrCreate() ; -+ if( keyMngr == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Add key store to manager, from now on keys manager destroys the store if -+ * needed -+ */ -+ if( xmlSecKeysMngrAdoptKeysStore( keyMngr, keyStore ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecKeysMngrAdoptKeyStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyStoreDestroy( keyStore ) ; -+ xmlSecKeysMngrDestroy( keyMngr ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Initialize crypto library specific data in keys manager -+ */ -+ if( xmlSecNssKeysMngrInit( keyMngr ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeysMngrDestroy( keyMngr ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Set certificate databse to X509 key data store -+ */ -+ /** -+ * Because Tej's implementation of certDB use the default DB, so I ignore -+ * the certDB handler at present. I'll modify the cert store sources to -+ * accept particular certDB instead of default ones. -+ certStore = xmlSecKeysMngrGetDataStore( keyMngr , xmlSecNssKeyDataStoreX509Id ) ; -+ if( certStore == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecKeysMngrGetDataStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeysMngrDestroy( keyMngr ) ; -+ return NULL ; -+ } -+ -+ if( xmlSecNssKeyDataStoreX509SetCertDb( certStore , handler ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , -+ "xmlSecNssKeyDataStoreX509SetCertDb" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeysMngrDestroy( keyMngr ) ; -+ return NULL ; -+ } -+ */ -+ -+ /*- -+ * Set the getKey callback -+ */ -+ keyMngr->getKey = xmlSecKeysMngrGetKey ; -+ -+ return keyMngr ; -+} -+ -+int -+xmlSecNssAppliedKeysMngrSymKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ PK11SymKey* symKey -+) { -+ xmlSecKeyPtr key ; -+ xmlSecKeyDataPtr data ; -+ xmlSecKeyStorePtr keyStore ; -+ -+ xmlSecAssert2( mngr != NULL , -1 ) ; -+ xmlSecAssert2( symKey != NULL , -1 ) ; -+ -+ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ; -+ if( keyStore == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrGetKeysStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ; -+ -+ data = xmlSecNssSymKeyDataKeyAdopt( symKey ) ; -+ if( data == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ -+ key = xmlSecKeyCreate() ; -+ if( key == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ if( xmlSecKeySetValue( key , data ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDestroy( key ) ; -+ return(-1) ; -+ } -+ -+ return(0) ; -+} -+ -+int -+xmlSecNssAppliedKeysMngrPubKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ SECKEYPublicKey* pubKey -+) { -+ xmlSecKeyPtr key ; -+ xmlSecKeyDataPtr data ; -+ xmlSecKeyStorePtr keyStore ; -+ -+ xmlSecAssert2( mngr != NULL , -1 ) ; -+ xmlSecAssert2( pubKey != NULL , -1 ) ; -+ -+ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ; -+ if( keyStore == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrGetKeysStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ; -+ -+ data = xmlSecNssPKIAdoptKey( NULL, pubKey ) ; -+ if( data == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssPKIAdoptKey" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ -+ key = xmlSecKeyCreate() ; -+ if( key == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ if( xmlSecKeySetValue( key , data ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDestroy( key ) ; -+ return(-1) ; -+ } -+ -+ return(0) ; -+} -+ -+int -+xmlSecNssAppliedKeysMngrPriKeyLoad( -+ xmlSecKeysMngrPtr mngr , -+ SECKEYPrivateKey* priKey -+) { -+ xmlSecKeyPtr key ; -+ xmlSecKeyDataPtr data ; -+ xmlSecKeyStorePtr keyStore ; -+ -+ xmlSecAssert2( mngr != NULL , -1 ) ; -+ xmlSecAssert2( priKey != NULL , -1 ) ; -+ -+ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ; -+ if( keyStore == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeysMngrGetKeysStore" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ; -+ -+ data = xmlSecNssPKIAdoptKey( priKey, NULL ) ; -+ if( data == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssPKIAdoptKey" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ -+ key = xmlSecKeyCreate() ; -+ if( key == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ if( xmlSecKeySetValue( key , data ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataKeyAdopt" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDestroy( key ) ; -+ return(-1) ; -+ } -+ -+ return(0) ; -+} -+ ---- misc/xmlsec1-1.2.6/src/nss/ciphers.c 2003-09-26 02:58:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/ciphers.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1,838 +1,967 @@ --/** -- * XMLSec library -- * -- * This is free software; see Copyright file in the source -- * distribution for preciese wording. -- * -- * Copyright (C) 2002-2003 Aleksey Sanin <aleksey@aleksey.com> -- * Copyright (c) 2003 America Online, Inc. All rights reserved. -- */ -+/* -- C Source File -- **/ - #include "globals.h" - -+#include <stdlib.h> - #include <string.h> - --#include <nspr.h> - #include <nss.h> --#include <secoid.h> - #include <pk11func.h> - - #include <xmlsec/xmlsec.h> -+#include <xmlsec/xmltree.h> -+#include <xmlsec/base64.h> - #include <xmlsec/keys.h> -+#include <xmlsec/keyinfo.h> - #include <xmlsec/transforms.h> - #include <xmlsec/errors.h> - - #include <xmlsec/nss/crypto.h> -+#include <xmlsec/nss/ciphers.h> - --#define XMLSEC_NSS_MAX_KEY_SIZE 32 --#define XMLSEC_NSS_MAX_IV_SIZE 32 --#define XMLSEC_NSS_MAX_BLOCK_SIZE 32 -- --/************************************************************************** -- * -- * Internal Nss Block cipher CTX -+/** -+ * Internal Nss Block Cipher Context - * -- *****************************************************************************/ --typedef struct _xmlSecNssBlockCipherCtx xmlSecNssBlockCipherCtx, -- *xmlSecNssBlockCipherCtxPtr; -+ * This context is designed for repositing a block cipher for transform -+ */ -+typedef struct _xmlSecNssBlockCipherCtx xmlSecNssBlockCipherCtx ; -+typedef struct _xmlSecNssBlockCipherCtx* xmlSecNssBlockCipherCtxPtr ; -+ - struct _xmlSecNssBlockCipherCtx { -- CK_MECHANISM_TYPE cipher; -- PK11Context* cipherCtx; -- xmlSecKeyDataId keyId; -- int keyInitialized; -- int ctxInitialized; -- xmlSecByte key[XMLSEC_NSS_MAX_KEY_SIZE]; -- xmlSecSize keySize; -- xmlSecByte iv[XMLSEC_NSS_MAX_IV_SIZE]; -- xmlSecSize ivSize; --}; --static int xmlSecNssBlockCipherCtxInit (xmlSecNssBlockCipherCtxPtr ctx, -- xmlSecBufferPtr in, -- xmlSecBufferPtr out, -- int encrypt, -- const xmlChar* cipherName, -- xmlSecTransformCtxPtr transformCtx); --static int xmlSecNssBlockCipherCtxUpdate (xmlSecNssBlockCipherCtxPtr ctx, -- xmlSecBufferPtr in, -- xmlSecBufferPtr out, -- int encrypt, -- const xmlChar* cipherName, -- xmlSecTransformCtxPtr transformCtx); --static int xmlSecNssBlockCipherCtxFinal (xmlSecNssBlockCipherCtxPtr ctx, -- xmlSecBufferPtr in, -- xmlSecBufferPtr out, -- int encrypt, -- const xmlChar* cipherName, -- xmlSecTransformCtxPtr transformCtx); --static int --xmlSecNssBlockCipherCtxInit(xmlSecNssBlockCipherCtxPtr ctx, -- xmlSecBufferPtr in, xmlSecBufferPtr out, -- int encrypt, -- const xmlChar* cipherName, -- xmlSecTransformCtxPtr transformCtx) { -- SECItem keyItem; -- SECItem ivItem; -- PK11SlotInfo* slot; -- PK11SymKey* symKey; -- int ivLen; -- SECStatus rv; -- int ret; -- -- xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->cipher != 0, -1); -- xmlSecAssert2(ctx->cipherCtx == NULL, -1); -- xmlSecAssert2(ctx->keyInitialized != 0, -1); -- xmlSecAssert2(ctx->ctxInitialized == 0, -1); -- xmlSecAssert2(in != NULL, -1); -- xmlSecAssert2(out != NULL, -1); -- xmlSecAssert2(transformCtx != NULL, -1); -- -- ivLen = PK11_GetIVLength(ctx->cipher); -- xmlSecAssert2(ivLen > 0, -1); -- xmlSecAssert2((xmlSecSize)ivLen <= sizeof(ctx->iv), -1); -- -- if(encrypt) { -- /* generate random iv */ -- rv = PK11_GenerateRandom(ctx->iv, ivLen); -- if(rv != SECSuccess) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_GenerateRandom", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- "size=%d", ivLen); -- return(-1); -- } -- -- /* write iv to the output */ -- ret = xmlSecBufferAppend(out, ctx->iv, ivLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferAppend", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", ivLen); -- return(-1); -- } -- -- } else { -- /* if we don't have enough data, exit and hope that -- * we'll have iv next time */ -- if(xmlSecBufferGetSize(in) < (xmlSecSize)ivLen) { -- return(0); -- } -- -- /* copy iv to our buffer*/ -- xmlSecAssert2(xmlSecBufferGetData(in) != NULL, -1); -- memcpy(ctx->iv, xmlSecBufferGetData(in), ivLen); -- -- /* and remove from input */ -- ret = xmlSecBufferRemoveHead(in, ivLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferRemoveHead", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", ivLen); -- return(-1); -+ CK_MECHANISM_TYPE cipher ; -+ PK11SymKey* symkey ; -+ PK11Context* cipherCtx ; -+ xmlSecKeyDataId keyId ; -+} ; -+ -+#define xmlSecNssBlockCipherSize \ -+ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssBlockCipherCtx ) ) -+ -+#define xmlSecNssBlockCipherGetCtx( transform ) \ -+ ( ( xmlSecNssBlockCipherCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) ) -+ -+static int -+xmlSecNssBlockCipherCheckId( -+ xmlSecTransformPtr transform -+) { -+ #ifndef XMLSEC_NO_DES -+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformDes3CbcId ) ) { -+ return 1 ; - } -- } -+ #endif /* XMLSEC_NO_DES */ - -- memset(&keyItem, 0, sizeof(keyItem)); -- keyItem.data = ctx->key; -- keyItem.len = ctx->keySize; -- memset(&ivItem, 0, sizeof(ivItem)); -- ivItem.data = ctx->iv; -- ivItem.len = ctx->ivSize; -- -- slot = PK11_GetBestSlot(ctx->cipher, NULL); -- if(slot == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_GetBestSlot", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- -- symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginDerive, -- CKA_SIGN, &keyItem, NULL); -- if(symKey == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_ImportSymKey", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- PK11_FreeSlot(slot); -- return(-1); -- } -+ #ifndef XMLSEC_NO_AES -+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformAes128CbcId ) || -+ xmlSecTransformCheckId( transform, xmlSecNssTransformAes192CbcId ) || -+ xmlSecTransformCheckId( transform, xmlSecNssTransformAes256CbcId ) ) { - -- ctx->cipherCtx = PK11_CreateContextBySymKey(ctx->cipher, -- (encrypt) ? CKA_ENCRYPT : CKA_DECRYPT, -- symKey, &ivItem); -- if(ctx->cipherCtx == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_CreateContextBySymKey", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- PK11_FreeSymKey(symKey); -- PK11_FreeSlot(slot); -- return(-1); -+ return 1 ; - } -- -- ctx->ctxInitialized = 1; -- PK11_FreeSymKey(symKey); -- PK11_FreeSlot(slot); -- return(0); -+ #endif /* XMLSEC_NO_AES */ -+ -+ return 0 ; - } - --static int --xmlSecNssBlockCipherCtxUpdate(xmlSecNssBlockCipherCtxPtr ctx, -- xmlSecBufferPtr in, xmlSecBufferPtr out, -- int encrypt, -- const xmlChar* cipherName, -- xmlSecTransformCtxPtr transformCtx) { -- xmlSecSize inSize, inBlocks, outSize; -- int blockLen; -- int outLen = 0; -- xmlSecByte* outBuf; -- SECStatus rv; -- int ret; -- -- xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->cipher != 0, -1); -- xmlSecAssert2(ctx->cipherCtx != NULL, -1); -- xmlSecAssert2(ctx->ctxInitialized != 0, -1); -- xmlSecAssert2(in != NULL, -1); -- xmlSecAssert2(out != NULL, -1); -- xmlSecAssert2(transformCtx != NULL, -1); -+static int -+xmlSecNssBlockCipherFetchCtx( -+ xmlSecNssBlockCipherCtxPtr context , -+ xmlSecTransformId id -+) { -+ xmlSecAssert2( context != NULL, -1 ) ; -+ -+ #ifndef XMLSEC_NO_DES -+ if( id == xmlSecNssTransformDes3CbcId ) { -+ context->cipher = CKM_DES3_CBC ; -+ context->keyId = xmlSecNssKeyDataDesId ; -+ } else -+ #endif /* XMLSEC_NO_DES */ -+ -+ #ifndef XMLSEC_NO_AES -+ if( id == xmlSecNssTransformAes128CbcId ) { -+ context->cipher = CKM_AES_CBC ; -+ context->keyId = xmlSecNssKeyDataAesId ; -+ } else -+ if( id == xmlSecNssTransformAes192CbcId ) { -+ context->cipher = CKM_AES_CBC ; -+ context->keyId = xmlSecNssKeyDataAesId ; -+ } else -+ if( id == xmlSecNssTransformAes256CbcId ) { -+ context->cipher = CKM_AES_CBC ; -+ context->keyId = xmlSecNssKeyDataAesId ; -+ } else -+ #endif /* XMLSEC_NO_AES */ -+ -+ if( 1 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } - -- blockLen = PK11_GetBlockSize(ctx->cipher, NULL); -- xmlSecAssert2(blockLen > 0, -1); -+ return 0 ; -+} - -- inSize = xmlSecBufferGetSize(in); -- outSize = xmlSecBufferGetSize(out); -- -- if(inSize < (xmlSecSize)blockLen) { -- return(0); -- } -+/** -+ * xmlSecTransformInitializeMethod: -+ * @transform: the pointer to transform object. -+ * -+ * The transform specific initialization method. -+ * -+ * Returns 0 on success or a negative value otherwise. -+ */ -+static int -+xmlSecNssBlockCipherInitialize( -+ xmlSecTransformPtr transform -+) { -+ xmlSecNssBlockCipherCtxPtr context = NULL ; -+ -+ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; -+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; -+ -+ context = xmlSecNssBlockCipherGetCtx( transform ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecNssBlockCipherFetchCtx( context , transform->id ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherFetchCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } - -- if(encrypt) { -- inBlocks = inSize / ((xmlSecSize)blockLen); -- } else { -- /* we want to have the last block in the input buffer -- * for padding check */ -- inBlocks = (inSize - 1) / ((xmlSecSize)blockLen); -- } -- inSize = inBlocks * ((xmlSecSize)blockLen); -+ context->symkey = NULL ; -+ context->cipherCtx = NULL ; - -- /* we write out the input size plus may be one block */ -- ret = xmlSecBufferSetMaxSize(out, outSize + inSize + blockLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferSetMaxSize", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", outSize + inSize + blockLen); -- return(-1); -- } -- outBuf = xmlSecBufferGetData(out) + outSize; -- -- rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, inSize + blockLen, -- xmlSecBufferGetData(in), inSize); -- if(rv != SECSuccess) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_CipherOp", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- xmlSecAssert2((xmlSecSize)outLen == inSize, -1); -- -- /* set correct output buffer size */ -- ret = xmlSecBufferSetSize(out, outSize + outLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferSetSize", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", outSize + outLen); -- return(-1); -- } -- -- /* remove the processed block from input */ -- ret = xmlSecBufferRemoveHead(in, inSize); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferRemoveHead", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", inSize); -- return(-1); -- } -- return(0); -+ return 0 ; - } - --static int --xmlSecNssBlockCipherCtxFinal(xmlSecNssBlockCipherCtxPtr ctx, -- xmlSecBufferPtr in, -- xmlSecBufferPtr out, -- int encrypt, -- const xmlChar* cipherName, -- xmlSecTransformCtxPtr transformCtx) { -- xmlSecSize inSize, outSize; -- int blockLen, outLen = 0; -- xmlSecByte* inBuf; -- xmlSecByte* outBuf; -- SECStatus rv; -- int ret; -- -- xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->cipher != 0, -1); -- xmlSecAssert2(ctx->cipherCtx != NULL, -1); -- xmlSecAssert2(ctx->ctxInitialized != 0, -1); -- xmlSecAssert2(in != NULL, -1); -- xmlSecAssert2(out != NULL, -1); -- xmlSecAssert2(transformCtx != NULL, -1); -- -- blockLen = PK11_GetBlockSize(ctx->cipher, NULL); -- xmlSecAssert2(blockLen > 0, -1); -+/** -+ * xmlSecTransformFinalizeMethod: -+ * @transform: the pointer to transform object. -+ * -+ * The transform specific destroy method. -+ */ -+static void -+xmlSecNssBlockCipherFinalize( -+ xmlSecTransformPtr transform -+) { -+ xmlSecNssBlockCipherCtxPtr context = NULL ; - -- inSize = xmlSecBufferGetSize(in); -- outSize = xmlSecBufferGetSize(out); -+ xmlSecAssert( xmlSecNssBlockCipherCheckId( transform ) ) ; -+ xmlSecAssert( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ) ) ; - -- if(encrypt != 0) { -- xmlSecAssert2(inSize < (xmlSecSize)blockLen, -1); -- -- /* create padding */ -- ret = xmlSecBufferSetMaxSize(in, blockLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferSetMaxSize", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", blockLen); -- return(-1); -- } -- inBuf = xmlSecBufferGetData(in); -- -- /* generate random padding */ -- if((xmlSecSize)blockLen > (inSize + 1)) { -- rv = PK11_GenerateRandom(inBuf + inSize, blockLen - inSize - 1); -- if(rv != SECSuccess) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_GenerateRandom", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- "size=%d", blockLen - inSize - 1); -- return(-1); -- } -- } -- inBuf[blockLen - 1] = blockLen - inSize; -- inSize = blockLen; -- } else { -- if(inSize != (xmlSecSize)blockLen) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "data=%d;block=%d", inSize, blockLen); -- return(-1); -+ context = xmlSecNssBlockCipherGetCtx( transform ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return ; - } -- } -- -- /* process last block */ -- ret = xmlSecBufferSetMaxSize(out, outSize + 2 * blockLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferSetMaxSize", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", outSize + 2 * blockLen); -- return(-1); -- } -- outBuf = xmlSecBufferGetData(out) + outSize; - -- rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, 2 * blockLen, -- xmlSecBufferGetData(in), inSize); -- if(rv != SECSuccess) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "PK11_CipherOp", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- xmlSecAssert2((xmlSecSize)outLen == inSize, -1); -- -- if(encrypt == 0) { -- /* check padding */ -- if(outLen < outBuf[blockLen - 1]) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "padding=%d;buffer=%d", -- outBuf[blockLen - 1], outLen); -- return(-1); -- } -- outLen -= outBuf[blockLen - 1]; -- } -- -- /* set correct output buffer size */ -- ret = xmlSecBufferSetSize(out, outSize + outLen); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferSetSize", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", outSize + outLen); -- return(-1); -- } -+ if( context->cipherCtx != NULL ) { -+ PK11_DestroyContext( context->cipherCtx, PR_TRUE ) ; -+ context->cipherCtx = NULL ; -+ } - -- /* remove the processed block from input */ -- ret = xmlSecBufferRemoveHead(in, inSize); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(cipherName), -- "xmlSecBufferRemoveHead", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "size=%d", inSize); -- return(-1); -- } -+ if( context->symkey != NULL ) { -+ PK11_FreeSymKey( context->symkey ) ; -+ context->symkey = NULL ; -+ } - -- return(0); -+ context->cipher = CKM_INVALID_MECHANISM ; -+ context->keyId = NULL ; - } - -- --/****************************************************************************** -- * -- * EVP Block Cipher transforms -+/** -+ * xmlSecTransformSetKeyRequirementsMethod: -+ * @transform: the pointer to transform object. -+ * @keyReq: the pointer to key requirements structure. - * -- * xmlSecNssBlockCipherCtx block is located after xmlSecTransform structure -+ * Transform specific method to set transform's key requirements. - * -- *****************************************************************************/ --#define xmlSecNssBlockCipherSize \ -- (sizeof(xmlSecTransform) + sizeof(xmlSecNssBlockCipherCtx)) --#define xmlSecNssBlockCipherGetCtx(transform) \ -- ((xmlSecNssBlockCipherCtxPtr)(((xmlSecByte*)(transform)) + sizeof(xmlSecTransform))) -- --static int xmlSecNssBlockCipherInitialize (xmlSecTransformPtr transform); --static void xmlSecNssBlockCipherFinalize (xmlSecTransformPtr transform); --static int xmlSecNssBlockCipherSetKeyReq (xmlSecTransformPtr transform, -- xmlSecKeyReqPtr keyReq); --static int xmlSecNssBlockCipherSetKey (xmlSecTransformPtr transform, -- xmlSecKeyPtr key); --static int xmlSecNssBlockCipherExecute (xmlSecTransformPtr transform, -- int last, -- xmlSecTransformCtxPtr transformCtx); --static int xmlSecNssBlockCipherCheckId (xmlSecTransformPtr transform); -- -- -+ * Returns 0 on success or a negative value otherwise. -+ */ -+static int -+xmlSecNssBlockCipherSetKeyReq( -+ xmlSecTransformPtr transform , -+ xmlSecKeyReqPtr keyReq -+) { -+ xmlSecNssBlockCipherCtxPtr context = NULL ; -+ xmlSecSize cipherSize = 0 ; -+ -+ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; -+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; -+ xmlSecAssert2( keyReq != NULL , -1 ) ; -+ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; -+ -+ context = xmlSecNssBlockCipherGetCtx( transform ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ keyReq->keyId = context->keyId ; -+ keyReq->keyType = xmlSecKeyDataTypeSymmetric ; -+ -+ if( transform->operation == xmlSecTransformOperationEncrypt ) { -+ keyReq->keyUsage = xmlSecKeyUsageEncrypt ; -+ } else { -+ keyReq->keyUsage = xmlSecKeyUsageDecrypt ; -+ } -+ -+ /* -+ if( context->symkey != NULL ) -+ cipherSize = PK11_GetKeyLength( context->symkey ) ; - --static int --xmlSecNssBlockCipherCheckId(xmlSecTransformPtr transform) { --#ifndef XMLSEC_NO_DES -- if(xmlSecTransformCheckId(transform, xmlSecNssTransformDes3CbcId)) { -- return(1); -- } --#endif /* XMLSEC_NO_DES */ -+ keyReq->keyBitsSize = cipherSize * 8 ; -+ */ - --#ifndef XMLSEC_NO_AES -- if(xmlSecTransformCheckId(transform, xmlSecNssTransformAes128CbcId) || -- xmlSecTransformCheckId(transform, xmlSecNssTransformAes192CbcId) || -- xmlSecTransformCheckId(transform, xmlSecNssTransformAes256CbcId)) { -- -- return(1); -- } --#endif /* XMLSEC_NO_AES */ -- -- return(0); -+ return 0 ; - } - --static int --xmlSecNssBlockCipherInitialize(xmlSecTransformPtr transform) { -- xmlSecNssBlockCipherCtxPtr ctx; -- -- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); -- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); -+/** -+ * xmlSecTransformSetKeyMethod: -+ * @transform: the pointer to transform object. -+ * @key: the pointer to key. -+ * -+ * The transform specific method to set the key for use. -+ * -+ * Returns 0 on success or a negative value otherwise. -+ */ -+static int -+xmlSecNssBlockCipherSetKey( -+ xmlSecTransformPtr transform , -+ xmlSecKeyPtr key -+) { -+ xmlSecNssBlockCipherCtxPtr context = NULL ; -+ xmlSecKeyDataPtr keyData = NULL ; -+ PK11SymKey* symkey = NULL ; -+ CK_ATTRIBUTE_TYPE operation ; -+ int ivLen ; -+ -+ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; -+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; -+ xmlSecAssert2( key != NULL , -1 ) ; -+ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; -+ -+ context = xmlSecNssBlockCipherGetCtx( transform ) ; -+ if( context == NULL || context->keyId == NULL || context->symkey != NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ; -+ -+ keyData = xmlSecKeyGetValue( key ) ; -+ if( keyData == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) , -+ "xmlSecKeyGetValue" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( ( symkey = xmlSecNssSymKeyDataGetKey( keyData ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) , -+ "xmlSecNssSymKeyDataGetKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } - -- ctx = xmlSecNssBlockCipherGetCtx(transform); -- xmlSecAssert2(ctx != NULL, -1); -- -- memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx)); -+ context->symkey = symkey ; - --#ifndef XMLSEC_NO_DES -- if(transform->id == xmlSecNssTransformDes3CbcId) { -- ctx->cipher = CKM_DES3_CBC; -- ctx->keyId = xmlSecNssKeyDataDesId; -- ctx->keySize = 24; -- } else --#endif /* XMLSEC_NO_DES */ -- --#ifndef XMLSEC_NO_AES -- if(transform->id == xmlSecNssTransformAes128CbcId) { -- ctx->cipher = CKM_AES_CBC; -- ctx->keyId = xmlSecNssKeyDataAesId; -- ctx->keySize = 16; -- } else if(transform->id == xmlSecNssTransformAes192CbcId) { -- ctx->cipher = CKM_AES_CBC; -- ctx->keyId = xmlSecNssKeyDataAesId; -- ctx->keySize = 24; -- } else if(transform->id == xmlSecNssTransformAes256CbcId) { -- ctx->cipher = CKM_AES_CBC; -- ctx->keyId = xmlSecNssKeyDataAesId; -- ctx->keySize = 32; -- } else --#endif /* XMLSEC_NO_AES */ -- -- if(1) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- NULL, -- XMLSEC_ERRORS_R_INVALID_TRANSFORM, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- -- return(0); -+ return 0 ; - } - --static void --xmlSecNssBlockCipherFinalize(xmlSecTransformPtr transform) { -- xmlSecNssBlockCipherCtxPtr ctx; -- -- xmlSecAssert(xmlSecNssBlockCipherCheckId(transform)); -- xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize)); -+/** -+ * Block cipher transform init -+ */ -+static int -+xmlSecNssBlockCipherCtxInit( -+ xmlSecNssBlockCipherCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ const xmlChar* cipherName , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ SECItem ivItem ; -+ SECItem* secParam = NULL ; -+ xmlSecBufferPtr ivBuf = NULL ; -+ int ivLen ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipherCtx == NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ ivLen = PK11_GetIVLength( ctx->cipher ) ; -+ if( ivLen < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_GetIVLength" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( ( ivBuf = xmlSecBufferCreate( ivLen ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( encrypt ) { -+ if( PK11_GenerateRandom( ivBuf->data , ivLen ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_GenerateRandom" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } -+ if( xmlSecBufferSetSize( ivBuf , ivLen ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferSetSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecBufferAppend( out , ivBuf->data , ivLen ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } -+ } else { -+ if( xmlSecBufferSetData( ivBuf , in->data , ivLen ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetData" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecBufferRemoveHead( in , ivLen ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } -+ } -+ -+ ivItem.data = xmlSecBufferGetData( ivBuf ) ; -+ ivItem.len = xmlSecBufferGetSize( ivBuf ) ; -+ if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_ParamFromIV" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } -+ -+ ctx->cipherCtx = PK11_CreateContextBySymKey( ctx->cipher , encrypt ? CKA_ENCRYPT : CKA_DECRYPT , ctx->symkey , secParam ) ; -+ if( ctx->cipherCtx == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ SECITEM_FreeItem( secParam , PR_TRUE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; -+ return -1 ; -+ } - -- ctx = xmlSecNssBlockCipherGetCtx(transform); -- xmlSecAssert(ctx != NULL); -+ SECITEM_FreeItem( secParam , PR_TRUE ) ; -+ xmlSecBufferDestroy( ivBuf ) ; - -- if(ctx->cipherCtx != NULL) { -- PK11_DestroyContext(ctx->cipherCtx, PR_TRUE); -- } -- -- memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx)); -+ return 0 ; - } - --static int --xmlSecNssBlockCipherSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) { -- xmlSecNssBlockCipherCtxPtr ctx; -- -- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); -- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); -- xmlSecAssert2(keyReq != NULL, -1); -- -- ctx = xmlSecNssBlockCipherGetCtx(transform); -- xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->keyId != NULL, -1); -- -- keyReq->keyId = ctx->keyId; -- keyReq->keyType = xmlSecKeyDataTypeSymmetric; -- if(transform->operation == xmlSecTransformOperationEncrypt) { -- keyReq->keyUsage = xmlSecKeyUsageEncrypt; -- } else { -- keyReq->keyUsage = xmlSecKeyUsageDecrypt; -- } -- keyReq->keyBitsSize = 8 * ctx->keySize; -- return(0); --} -+/** -+ * Block cipher transform update -+ */ -+static int -+xmlSecNssBlockCipherCtxUpdate( -+ xmlSecNssBlockCipherCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ const xmlChar* cipherName , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecSize inSize ; -+ xmlSecSize outSize ; -+ xmlSecSize inBlocks ; -+ int blockSize ; -+ int outLen ; -+ xmlSecByte* outBuf ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipherCtx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_GetBlockSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ inSize = xmlSecBufferGetSize( in ) ; -+ outSize = xmlSecBufferGetSize( out ) ; -+ -+ inBlocks = ( encrypt != 0 ? inSize : ( inSize - 1 ) ) / blockSize ; -+ inSize = inBlocks * blockSize ; -+ -+ if( inSize < blockSize ) { -+ return 0 ; -+ } -+ -+ if( xmlSecBufferSetMaxSize( out , outSize + inSize + blockSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetMaxSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ outBuf = xmlSecBufferGetData( out ) + outSize ; -+ -+ if( PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData( in ) , inSize ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_CipherOp" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecBufferSetSize( out , outSize + outLen ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecBufferRemoveHead( in , inSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } - --static int --xmlSecNssBlockCipherSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) { -- xmlSecNssBlockCipherCtxPtr ctx; -- xmlSecBufferPtr buffer; -- -- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); -- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); -- xmlSecAssert2(key != NULL, -1); -- -- ctx = xmlSecNssBlockCipherGetCtx(transform); -- xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(ctx->cipher != 0, -1); -- xmlSecAssert2(ctx->keyInitialized == 0, -1); -- xmlSecAssert2(ctx->keyId != NULL, -1); -- xmlSecAssert2(xmlSecKeyCheckId(key, ctx->keyId), -1); -- -- xmlSecAssert2(ctx->keySize > 0, -1); -- xmlSecAssert2(ctx->keySize <= sizeof(ctx->key), -1); -- -- buffer = xmlSecKeyDataBinaryValueGetBuffer(xmlSecKeyGetValue(key)); -- xmlSecAssert2(buffer != NULL, -1); -- -- if(xmlSecBufferGetSize(buffer) < ctx->keySize) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- NULL, -- XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE, -- "keySize=%d;expected=%d", -- xmlSecBufferGetSize(buffer), ctx->keySize); -- return(-1); -- } -- -- xmlSecAssert2(xmlSecBufferGetData(buffer) != NULL, -1); -- memcpy(ctx->key, xmlSecBufferGetData(buffer), ctx->keySize); -- -- ctx->keyInitialized = 1; -- return(0); -+ return 0 ; - } - -+/** -+ * Block cipher transform final -+ */ - static int --xmlSecNssBlockCipherExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) { -- xmlSecNssBlockCipherCtxPtr ctx; -- xmlSecBufferPtr in, out; -- int ret; -- -- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); -- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); -- xmlSecAssert2(transformCtx != NULL, -1); -- -- in = &(transform->inBuf); -- out = &(transform->outBuf); -- -- ctx = xmlSecNssBlockCipherGetCtx(transform); -- xmlSecAssert2(ctx != NULL, -1); -+xmlSecNssBlockCipherCtxFinal( -+ xmlSecNssBlockCipherCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ const xmlChar* cipherName , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecSize inSize ; -+ xmlSecSize outSize ; -+ int blockSize ; -+ int outLen ; -+ xmlSecByte* inBuf ; -+ xmlSecByte* outBuf ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipherCtx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_GetBlockSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ inSize = xmlSecBufferGetSize( in ) ; -+ outSize = xmlSecBufferGetSize( out ) ; -+ -+ /******************************************************************/ -+ if( encrypt != 0 ) { -+ xmlSecAssert2( inSize < blockSize, -1 ) ; -+ -+ /* create padding */ -+ if( xmlSecBufferSetMaxSize( in , blockSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetMaxSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ inBuf = xmlSecBufferGetData( in ) ; -+ -+ /* generate random */ -+ if( blockSize > ( inSize + 1 ) ) { -+ if( PK11_GenerateRandom( inBuf + inSize, blockSize - inSize - 1 ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_GenerateRandom" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ inBuf[blockSize-1] = blockSize - inSize ; -+ inSize = blockSize ; -+ } else { -+ if( inSize != blockSize ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ /* process the last block */ -+ if( xmlSecBufferSetMaxSize( out , outSize + inSize + blockSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetMaxSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ outBuf = xmlSecBufferGetData( out ) + outSize ; -+ -+ if( PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData( in ) , inSize ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_CipherOp" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( encrypt == 0 ) { -+ /* check padding */ -+ if( outLen < outBuf[blockSize-1] ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ outLen -= outBuf[blockSize-1] ; -+ } -+ /******************************************************************/ -+ -+ /****************************************************************** -+ if( xmlSecBufferSetMaxSize( out , outSize + blockSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetMaxSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ outBuf = xmlSecBufferGetData( out ) + outSize ; -+ -+ if( PK11_DigestFinal( ctx->cipherCtx , outBuf , &outLen , blockSize ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "PK11_DigestFinal" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ ******************************************************************/ -+ -+ if( xmlSecBufferSetSize( out , outSize + outLen ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferSetSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecBufferRemoveHead( in , inSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( cipherName ) , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+/* PK11_Finalize( ctx->cipherCtx ) ;*/ -+ PK11_DestroyContext( ctx->cipherCtx , PR_TRUE ) ; -+ ctx->cipherCtx = NULL ; - -- if(transform->status == xmlSecTransformStatusNone) { -- transform->status = xmlSecTransformStatusWorking; -- } -- -- if(transform->status == xmlSecTransformStatusWorking) { -- if(ctx->ctxInitialized == 0) { -- ret = xmlSecNssBlockCipherCtxInit(ctx, in, out, -- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0, -- xmlSecTransformGetName(transform), transformCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- "xmlSecNssBlockCipherCtxInit", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- } -- if((ctx->ctxInitialized == 0) && (last != 0)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "not enough data to initialize transform"); -- return(-1); -- } -- -- if(ctx->ctxInitialized != 0) { -- ret = xmlSecNssBlockCipherCtxUpdate(ctx, in, out, -- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0, -- xmlSecTransformGetName(transform), transformCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- "xmlSecNssBlockCipherCtxUpdate", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- } -- -- if(last) { -- ret = xmlSecNssBlockCipherCtxFinal(ctx, in, out, -- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0, -- xmlSecTransformGetName(transform), transformCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- "xmlSecNssBlockCipherCtxFinal", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- transform->status = xmlSecTransformStatusFinished; -- } -- } else if(transform->status == xmlSecTransformStatusFinished) { -- /* the only way we can get here is if there is no input */ -- xmlSecAssert2(xmlSecBufferGetSize(in) == 0, -1); -- } else if(transform->status == xmlSecTransformStatusNone) { -- /* the only way we can get here is if there is no enough data in the input */ -- xmlSecAssert2(last == 0, -1); -- } else { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- NULL, -- XMLSEC_ERRORS_R_INVALID_STATUS, -- "status=%d", transform->status); -- return(-1); -- } -- -- return(0); -+ return 0 ; - } - - --#ifndef XMLSEC_NO_AES --/********************************************************************* -+ -+/** -+ * xmlSecTransformExecuteMethod: -+ * @transform: the pointer to transform object. -+ * @last: the flag: if set to 1 then it's the last data chunk. -+ * @transformCtx: the pointer to transform context object. - * -- * AES CBC cipher transforms -+ * Transform specific method to process a chunk of data. - * -- ********************************************************************/ -+ * Returns 0 on success or a negative value otherwise. -+ */ -+static int -+xmlSecNssBlockCipherExecute( -+ xmlSecTransformPtr transform , -+ int last , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecNssBlockCipherCtxPtr context = NULL ; -+ xmlSecBufferPtr inBuf = NULL ; -+ xmlSecBufferPtr outBuf = NULL ; -+ const xmlChar* cipherName ; -+ int operation ; -+ int rtv ; -+ -+ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; -+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; -+ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ context = xmlSecNssBlockCipherGetCtx( transform ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ inBuf = &( transform->inBuf ) ; -+ outBuf = &( transform->outBuf ) ; -+ -+ if( transform->status == xmlSecTransformStatusNone ) { -+ transform->status = xmlSecTransformStatusWorking ; -+ } -+ -+ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ; -+ cipherName = xmlSecTransformGetName( transform ) ; -+ -+ if( transform->status == xmlSecTransformStatusWorking ) { -+ if( context->cipherCtx == NULL ) { -+ rtv = xmlSecNssBlockCipherCtxInit( context, inBuf , outBuf , operation , cipherName , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherCtxInit" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ if( context->cipherCtx == NULL && last != 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "No enough data to intialize transform" ) ; -+ return -1 ; -+ } -+ -+ if( context->cipherCtx != NULL ) { -+ rtv = xmlSecNssBlockCipherCtxUpdate( context, inBuf , outBuf , operation , cipherName , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherCtxUpdate" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ if( last ) { -+ rtv = xmlSecNssBlockCipherCtxFinal( context, inBuf , outBuf , operation , cipherName , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssBlockCipherCtxFinal" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ transform->status = xmlSecTransformStatusFinished ; -+ } -+ } else if( transform->status == xmlSecTransformStatusFinished ) { -+ if( xmlSecBufferGetSize( inBuf ) != 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "status=%d", transform->status ) ; -+ return -1 ; -+ } -+ } else { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "status=%d", transform->status ) ; -+ return -1 ; -+ } -+ -+ return 0 ; -+} -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssAes128CbcKlass = { -+#else - static xmlSecTransformKlass xmlSecNssAes128CbcKlass = { -- /* klass/object sizes */ -- sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -- xmlSecNssBlockCipherSize, /* xmlSecSize objSize */ -- -- xmlSecNameAes128Cbc, /* const xmlChar* name; */ -- xmlSecHrefAes128Cbc, /* const xmlChar* href; */ -- xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -- -- xmlSecNssBlockCipherInitialize, /* xmlSecTransformInitializeMethod initialize; */ -- xmlSecNssBlockCipherFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -- NULL, /* xmlSecTransformNodeReadMethod readNode; */ -- NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -- xmlSecNssBlockCipherSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -- xmlSecNssBlockCipherSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -- NULL, /* xmlSecTransformValidateMethod validate; */ -- xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -- xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -- xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -- NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -- NULL, /* xmlSecTransformPopXmlMethod popXml; */ -- xmlSecNssBlockCipherExecute, /* xmlSecTransformExecuteMethod execute; */ -- -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ --}; -+#endif -+ sizeof( xmlSecTransformKlass ) , -+ xmlSecNssBlockCipherSize , -+ -+ xmlSecNameAes128Cbc , -+ xmlSecHrefAes128Cbc , -+ xmlSecTransformUsageEncryptionMethod , -+ -+ xmlSecNssBlockCipherInitialize , -+ xmlSecNssBlockCipherFinalize , -+ NULL , -+ NULL , -+ -+ xmlSecNssBlockCipherSetKeyReq , -+ xmlSecNssBlockCipherSetKey , -+ NULL , -+ xmlSecTransformDefaultGetDataType , -+ -+ xmlSecTransformDefaultPushBin , -+ xmlSecTransformDefaultPopBin , -+ NULL , -+ NULL , -+ xmlSecNssBlockCipherExecute , -+ -+ NULL , -+ NULL -+} ; -+ -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssAes192CbcKlass = { -+#else -+static xmlSecTransformKlass xmlSecNssAes192CbcKlass = { -+#endif -+ sizeof( xmlSecTransformKlass ) , -+ xmlSecNssBlockCipherSize , -+ -+ xmlSecNameAes192Cbc , -+ xmlSecHrefAes192Cbc , -+ xmlSecTransformUsageEncryptionMethod , -+ -+ xmlSecNssBlockCipherInitialize , -+ xmlSecNssBlockCipherFinalize , -+ NULL , -+ NULL , -+ -+ xmlSecNssBlockCipherSetKeyReq , -+ xmlSecNssBlockCipherSetKey , -+ NULL , -+ xmlSecTransformDefaultGetDataType , -+ -+ xmlSecTransformDefaultPushBin , -+ xmlSecTransformDefaultPopBin , -+ NULL , -+ NULL , -+ xmlSecNssBlockCipherExecute , -+ -+ NULL , -+ NULL -+} ; -+ -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssAes256CbcKlass = { -+#else -+static xmlSecTransformKlass xmlSecNssAes256CbcKlass = { -+#endif -+ sizeof( xmlSecTransformKlass ) , -+ xmlSecNssBlockCipherSize , -+ -+ xmlSecNameAes256Cbc , -+ xmlSecHrefAes256Cbc , -+ xmlSecTransformUsageEncryptionMethod , -+ -+ xmlSecNssBlockCipherInitialize , -+ xmlSecNssBlockCipherFinalize , -+ NULL , -+ NULL , -+ -+ xmlSecNssBlockCipherSetKeyReq , -+ xmlSecNssBlockCipherSetKey , -+ NULL , -+ xmlSecTransformDefaultGetDataType , -+ -+ xmlSecTransformDefaultPushBin , -+ xmlSecTransformDefaultPopBin , -+ NULL , -+ NULL , -+ xmlSecNssBlockCipherExecute , -+ -+ NULL , -+ NULL -+} ; -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssDes3CbcKlass = { -+#else -+static xmlSecTransformKlass xmlSecNssDes3CbcKlass = { -+#endif -+ sizeof( xmlSecTransformKlass ) , -+ xmlSecNssBlockCipherSize , -+ -+ xmlSecNameDes3Cbc , -+ xmlSecHrefDes3Cbc , -+ xmlSecTransformUsageEncryptionMethod , -+ -+ xmlSecNssBlockCipherInitialize , -+ xmlSecNssBlockCipherFinalize , -+ NULL , -+ NULL , -+ -+ xmlSecNssBlockCipherSetKeyReq , -+ xmlSecNssBlockCipherSetKey , -+ NULL , -+ xmlSecTransformDefaultGetDataType , -+ -+ xmlSecTransformDefaultPushBin , -+ xmlSecTransformDefaultPopBin , -+ NULL , -+ NULL , -+ xmlSecNssBlockCipherExecute , -+ -+ NULL , -+ NULL -+} ; - - /** -- * xmlSecNssTransformAes128CbcGetKlass: -- * -- * AES 128 CBC encryption transform klass. -- * -- * Returns pointer to AES 128 CBC encryption transform. -- */ --xmlSecTransformId --xmlSecNssTransformAes128CbcGetKlass(void) { -- return(&xmlSecNssAes128CbcKlass); -+ * xmlSecNssTransformAes128CbcGetKlass -+ * -+ * Get the AES128_CBC transform klass -+ * -+ * Return AES128_CBC transform klass -+ */ -+xmlSecTransformId -+xmlSecNssTransformAes128CbcGetKlass( void ) { -+ return ( &xmlSecNssAes128CbcKlass ) ; - } - --static xmlSecTransformKlass xmlSecNssAes192CbcKlass = { -- /* klass/object sizes */ -- sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -- xmlSecNssBlockCipherSize, /* xmlSecSize objSize */ -- -- xmlSecNameAes192Cbc, /* const xmlChar* name; */ -- xmlSecHrefAes192Cbc, /* const xmlChar* href; */ -- xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -- -- xmlSecNssBlockCipherInitialize, /* xmlSecTransformInitializeMethod initialize; */ -- xmlSecNssBlockCipherFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -- NULL, /* xmlSecTransformNodeReadMethod readNode; */ -- NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -- xmlSecNssBlockCipherSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -- xmlSecNssBlockCipherSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -- NULL, /* xmlSecTransformValidateMethod validate; */ -- xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -- xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -- xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -- NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -- NULL, /* xmlSecTransformPopXmlMethod popXml; */ -- xmlSecNssBlockCipherExecute, /* xmlSecTransformExecuteMethod execute; */ -- -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ --}; -- - /** -- * xmlSecNssTransformAes192CbcGetKlass: -- * -- * AES 192 CBC encryption transform klass. -- * -- * Returns pointer to AES 192 CBC encryption transform. -- */ --xmlSecTransformId --xmlSecNssTransformAes192CbcGetKlass(void) { -- return(&xmlSecNssAes192CbcKlass); -+ * xmlSecNssTransformAes192CbcGetKlass -+ * -+ * Get the AES192_CBC transform klass -+ * -+ * Return AES192_CBC transform klass -+ */ -+xmlSecTransformId -+xmlSecNssTransformAes192CbcGetKlass( void ) { -+ return ( &xmlSecNssAes192CbcKlass ) ; - } - --static xmlSecTransformKlass xmlSecNssAes256CbcKlass = { -- /* klass/object sizes */ -- sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -- xmlSecNssBlockCipherSize, /* xmlSecSize objSize */ -- -- xmlSecNameAes256Cbc, /* const xmlChar* name; */ -- xmlSecHrefAes256Cbc, /* const xmlChar* href; */ -- xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -- -- xmlSecNssBlockCipherInitialize, /* xmlSecTransformInitializeMethod initialize; */ -- xmlSecNssBlockCipherFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -- NULL, /* xmlSecTransformNodeReadMethod readNode; */ -- NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -- xmlSecNssBlockCipherSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -- xmlSecNssBlockCipherSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -- NULL, /* xmlSecTransformValidateMethod validate; */ -- xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -- xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -- xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -- NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -- NULL, /* xmlSecTransformPopXmlMethod popXml; */ -- xmlSecNssBlockCipherExecute, /* xmlSecTransformExecuteMethod execute; */ -- -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ --}; -- - /** -- * xmlSecNssTransformAes256CbcGetKlass: -- * -- * AES 256 CBC encryption transform klass. -- * -- * Returns pointer to AES 256 CBC encryption transform. -- */ --xmlSecTransformId --xmlSecNssTransformAes256CbcGetKlass(void) { -- return(&xmlSecNssAes256CbcKlass); -+ * xmlSecNssTransformAes256CbcGetKlass -+ * -+ * Get the AES256_CBC transform klass -+ * -+ * Return AES256_CBC transform klass -+ */ -+xmlSecTransformId -+xmlSecNssTransformAes256CbcGetKlass( void ) { -+ return ( &xmlSecNssAes256CbcKlass ) ; - } - --#endif /* XMLSEC_NO_AES */ -- --#ifndef XMLSEC_NO_DES --static xmlSecTransformKlass xmlSecNssDes3CbcKlass = { -- /* klass/object sizes */ -- sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -- xmlSecNssBlockCipherSize, /* xmlSecSize objSize */ -- -- xmlSecNameDes3Cbc, /* const xmlChar* name; */ -- xmlSecHrefDes3Cbc, /* const xmlChar* href; */ -- xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -- -- xmlSecNssBlockCipherInitialize, /* xmlSecTransformInitializeMethod initialize; */ -- xmlSecNssBlockCipherFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -- NULL, /* xmlSecTransformNodeReadMethod readNode; */ -- NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -- xmlSecNssBlockCipherSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -- xmlSecNssBlockCipherSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -- NULL, /* xmlSecTransformValidateMethod validate; */ -- xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -- xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -- xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -- NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -- NULL, /* xmlSecTransformPopXmlMethod popXml; */ -- xmlSecNssBlockCipherExecute, /* xmlSecTransformExecuteMethod execute; */ -- -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ --}; -- --/** -- * xmlSecNssTransformDes3CbcGetKlass: -+/** -+ * xmlSecNssTransformDes3CbcGetKlass - * -- * Triple DES CBC encryption transform klass. -- * -- * Returns pointer to Triple DES encryption transform. -+ * Get the DES3_CBC transform klass -+ * -+ * Return DES3_CBC transform klass - */ --xmlSecTransformId --xmlSecNssTransformDes3CbcGetKlass(void) { -- return(&xmlSecNssDes3CbcKlass); -+xmlSecTransformId -+xmlSecNssTransformDes3CbcGetKlass( void ) { -+ return ( &xmlSecNssDes3CbcKlass ) ; - } --#endif /* XMLSEC_NO_DES */ -+ - ---- misc/xmlsec1-1.2.6/src/nss/crypto.c 2003-10-29 16:57:25.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/src/nss/crypto.c 2008-06-29 23:44:19.000000000 +0200 -@@ -130,6 +130,7 @@ - /** - * High level routines form xmlsec command line utility - */ -+/* - gXmlSecNssFunctions->cryptoAppInit = xmlSecNssAppInit; - gXmlSecNssFunctions->cryptoAppShutdown = xmlSecNssAppShutdown; - gXmlSecNssFunctions->cryptoAppDefaultKeysMngrInit = xmlSecNssAppDefaultKeysMngrInit; -@@ -143,10 +144,29 @@ - gXmlSecNssFunctions->cryptoAppPkcs12LoadMemory = xmlSecNssAppPkcs12LoadMemory; - gXmlSecNssFunctions->cryptoAppKeyCertLoad = xmlSecNssAppKeyCertLoad; - gXmlSecNssFunctions->cryptoAppKeyCertLoadMemory = xmlSecNssAppKeyCertLoadMemory; --#endif /* XMLSEC_NO_X509 */ -+#endif - gXmlSecNssFunctions->cryptoAppKeyLoad = xmlSecNssAppKeyLoad; - gXmlSecNssFunctions->cryptoAppKeyLoadMemory = xmlSecNssAppKeyLoadMemory; - gXmlSecNssFunctions->cryptoAppDefaultPwdCallback = (void*)xmlSecNssAppGetDefaultPwdCallback; -+*/ -+ -+ gXmlSecNssFunctions->cryptoAppInit = NULL ; -+ gXmlSecNssFunctions->cryptoAppShutdown = NULL ; -+ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrInit = NULL ; -+ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrAdoptKey = NULL ; -+ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrLoad = NULL ; -+ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrSave = NULL ; -+#ifndef XMLSEC_NO_X509 -+ gXmlSecNssFunctions->cryptoAppKeysMngrCertLoad = NULL ; -+ gXmlSecNssFunctions->cryptoAppKeysMngrCertLoadMemory= NULL ; -+ gXmlSecNssFunctions->cryptoAppPkcs12Load = NULL ; -+ gXmlSecNssFunctions->cryptoAppPkcs12LoadMemory = NULL ; -+ gXmlSecNssFunctions->cryptoAppKeyCertLoad = NULL ; -+ gXmlSecNssFunctions->cryptoAppKeyCertLoadMemory = NULL ; -+#endif /* XMLSEC_NO_X509 */ -+ gXmlSecNssFunctions->cryptoAppKeyLoad = NULL ; -+ gXmlSecNssFunctions->cryptoAppKeyLoadMemory = NULL ; -+ gXmlSecNssFunctions->cryptoAppDefaultPwdCallback = (void*)NULL ; - - return(gXmlSecNssFunctions); - } ---- misc/xmlsec1-1.2.6/src/nss/digests.c 2003-09-26 02:58:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/digests.c 2008-06-29 23:44:19.000000000 +0200 -@@ -21,7 +21,6 @@ - #include <xmlsec/transforms.h> - #include <xmlsec/errors.h> - --#include <xmlsec/nss/app.h> - #include <xmlsec/nss/crypto.h> - - #define XMLSEC_NSS_MAX_DIGEST_SIZE 32 -@@ -107,7 +106,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "SECOID_FindOIDByTag", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -117,7 +116,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_CreateDigestContext", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -208,7 +207,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_DigestBegin", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - transform->status = xmlSecTransformStatusWorking; -@@ -225,7 +224,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_DigestOp", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -246,7 +245,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_DigestFinal", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - xmlSecAssert2(ctx->dgstSize > 0, -1); -@@ -285,7 +284,11 @@ - * SHA1 Digest transforms - * - *****************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecNssSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecNssDigestSize, /* xmlSecSize objSize */ ---- misc/xmlsec1-1.2.6/src/nss/hmac.c 2003-09-26 02:58:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/hmac.c 2008-06-29 23:44:19.000000000 +0200 -@@ -23,8 +23,8 @@ - #include <xmlsec/transforms.h> - #include <xmlsec/errors.h> - --#include <xmlsec/nss/app.h> - #include <xmlsec/nss/crypto.h> -+#include <xmlsec/nss/tokens.h> - - #define XMLSEC_NSS_MAX_HMAC_SIZE 128 - -@@ -241,13 +241,13 @@ - keyItem.data = xmlSecBufferGetData(buffer); - keyItem.len = xmlSecBufferGetSize(buffer); - -- slot = PK11_GetBestSlot(ctx->digestType, NULL); -+ slot = xmlSecNssSlotGet(ctx->digestType); - if(slot == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -- "PK11_GetBestSlot", -+ "xmlSecNssSlotGet", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -258,7 +258,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_ImportSymKey", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - PK11_FreeSlot(slot); - return(-1); - } -@@ -269,7 +269,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_CreateContextBySymKey", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - PK11_FreeSymKey(symKey); - PK11_FreeSlot(slot); - return(-1); -@@ -368,7 +368,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_DigestBegin", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - transform->status = xmlSecTransformStatusWorking; -@@ -385,7 +385,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_DigestOp", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -408,7 +408,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "PK11_DigestFinal", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - xmlSecAssert2(dgstSize > 0, -1); -@@ -459,7 +459,11 @@ - /** - * HMAC SHA1 - */ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssHmacSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecNssHmacSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecNssHmacSize, /* xmlSecSize objSize */ -@@ -501,7 +505,11 @@ - /** - * HMAC Ripemd160 - */ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssHmacRipemd160Klass = { -+#else - static xmlSecTransformKlass xmlSecNssHmacRipemd160Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecNssHmacSize, /* xmlSecSize objSize */ -@@ -543,7 +551,11 @@ - /** - * HMAC Md5 - */ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssHmacMd5Klass = { -+#else - static xmlSecTransformKlass xmlSecNssHmacMd5Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecNssHmacSize, /* xmlSecSize objSize */ ---- misc/xmlsec1-1.2.6/src/nss/keysstore.c 2003-09-26 02:58:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/keysstore.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1,119 +1,522 @@ - /** - * XMLSec library - * -- * Nss keys store that uses Simple Keys Store under the hood. Uses the -- * Nss DB as a backing store for the finding keys, but the NSS DB is -- * not written to by the keys store. -- * So, if store->findkey is done and the key is not found in the simple -- * keys store, the NSS DB is looked up. -- * If store is called to adopt a key, that key is not written to the NSS -- * DB. -- * Thus, the NSS DB can be used to pre-load keys and becomes an alternate -- * source of keys for xmlsec -- * - * This is free software; see Copyright file in the source - * distribution for precise wording. - * -- * Copyright (c) 2003 America Online, Inc. All rights reserved. -+ * Copyright................................ - */ --#include "globals.h" - --#include <stdlib.h> -+/** -+ * NSS key store uses a key list and a slot list as the key repository. NSS slot -+ * list is a backup repository for the finding keys. If a key is not found from -+ * the key list, the NSS slot list is looked up. -+ * -+ * Any key in the key list will not save to pkcs11 slot. When a store to called -+ * to adopt a key, the key is resident in the key list; While a store to called -+ * to set a is resident in the key list; While a store to called to set a slot -+ * list, which means that the keys in the listed slot can be used for xml sign- -+ * nature or encryption. -+ * -+ * Then, a user can adjust slot list to effect the crypto behaviors of xmlSec. -+ * -+ * The framework will decrease the user interfaces to administrate xmlSec crypto -+ * engine. He can only focus on NSS layer functions. For examples, after the -+ * user set up a slot list handler to the keys store, he do not need to do any -+ * other work atop xmlSec interfaces, his action on the slot list handler, such -+ * as add a token to, delete a token from the list, will directly effect the key -+ * store behaviors. -+ * -+ * For example, a scenariio: -+ * 0. Create a slot list;( NSS interfaces ) -+ * 1. Create a keys store;( xmlSec interfaces ) -+ * 2. Set slot list with the keys store;( xmlSec Interfaces ) -+ * 3. Add a slot to the slot list;( NSS interfaces ) -+ * 4. Perform xml signature; ( xmlSec Interfaces ) -+ * 5. Deleter a slot from the slot list;( NSS interfaces ) -+ * 6. Perform xml encryption; ( xmlSec Interfaces ) -+ * 7. Perform xml signature;( xmlSec Interfaces ) -+ * 8. Destroy the keys store;( xmlSec Interfaces ) -+ * 8. Destroy the slot list.( NSS Interfaces ) -+ */ -+ -+#include "globals.h" - #include <string.h> - --#include <nss.h> --#include <cert.h> --#include <pk11func.h> --#include <keyhi.h> -+#include <nss.h> -+#include <pk11func.h> -+#include <prinit.h> -+#include <keyhi.h> - --#include <libxml/tree.h> - - #include <xmlsec/xmlsec.h> --#include <xmlsec/buffer.h> --#include <xmlsec/base64.h> --#include <xmlsec/errors.h> --#include <xmlsec/xmltree.h> -- -+#include <xmlsec/keys.h> - #include <xmlsec/keysmngr.h> -+#include <xmlsec/transforms.h> -+#include <xmlsec/xmltree.h> -+#include <xmlsec/errors.h> - - #include <xmlsec/nss/crypto.h> - #include <xmlsec/nss/keysstore.h> --#include <xmlsec/nss/x509.h> -+#include <xmlsec/nss/tokens.h> -+#include <xmlsec/nss/ciphers.h> - #include <xmlsec/nss/pkikeys.h> - --/**************************************************************************** -+/** -+ * Internal NSS key store context - * -- * Nss Keys Store. Uses Simple Keys Store under the hood -- * -- * Simple Keys Store ptr is located after xmlSecKeyStore -+ * This context is located after xmlSecKeyStore -+ */ -+typedef struct _xmlSecNssKeysStoreCtx xmlSecNssKeysStoreCtx ; -+typedef struct _xmlSecNssKeysStoreCtx* xmlSecNssKeysStoreCtxPtr ; -+ -+struct _xmlSecNssKeysStoreCtx { -+ xmlSecPtrListPtr keyList ; -+ xmlSecPtrListPtr slotList ; -+} ; -+ -+#define xmlSecNssKeysStoreSize \ -+ ( sizeof( xmlSecKeyStore ) + sizeof( xmlSecNssKeysStoreCtx ) ) -+ -+#define xmlSecNssKeysStoreGetCtx( data ) \ -+ ( ( xmlSecNssKeysStoreCtxPtr )( ( ( xmlSecByte* )( data ) ) + sizeof( xmlSecKeyStore ) ) ) -+ -+int xmlSecNssKeysStoreAdoptKeySlot( -+ xmlSecKeyStorePtr store , -+ xmlSecNssKeySlotPtr keySlot -+) { -+ xmlSecNssKeysStoreCtxPtr context = NULL ; -+ -+ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ; -+ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ; -+ -+ context = xmlSecNssKeysStoreGetCtx( store ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecNssKeysStoreGetCtx" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( context->slotList == NULL ) { -+ if( ( context->slotList = xmlSecPtrListCreate( xmlSecNssKeySlotListId ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecPtrListCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ if( !xmlSecPtrListCheckId( context->slotList , xmlSecNssKeySlotListId ) ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecPtrListCheckId" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecPtrListAdd( context->slotList , keySlot ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecPtrListAdd" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ return 0 ; -+} -+ -+int xmlSecNssKeysStoreAdoptKey( -+ xmlSecKeyStorePtr store , -+ xmlSecKeyPtr key -+) { -+ xmlSecNssKeysStoreCtxPtr context = NULL ; -+ -+ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ; -+ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ; -+ -+ context = xmlSecNssKeysStoreGetCtx( store ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecNssKeysStoreGetCtx" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( context->keyList == NULL ) { -+ if( ( context->keyList = xmlSecPtrListCreate( xmlSecKeyPtrListId ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecPtrListCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ if( !xmlSecPtrListCheckId( context->keyList , xmlSecKeyPtrListId ) ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecPtrListCheckId" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ if( xmlSecPtrListAdd( context->keyList , key ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecPtrListAdd" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ -+ return 0 ; -+} -+ -+/** -+ * xmlSecKeyStoreInitializeMethod: -+ * @store: the store. - * -- ***************************************************************************/ --#define xmlSecNssKeysStoreSize \ -- (sizeof(xmlSecKeyStore) + sizeof(xmlSecKeyStorePtr)) -- --#define xmlSecNssKeysStoreGetSS(store) \ -- ((xmlSecKeyStoreCheckSize((store), xmlSecNssKeysStoreSize)) ? \ -- (xmlSecKeyStorePtr*)(((xmlSecByte*)(store)) + sizeof(xmlSecKeyStore)) : \ -- (xmlSecKeyStorePtr*)NULL) -- --static int xmlSecNssKeysStoreInitialize (xmlSecKeyStorePtr store); --static void xmlSecNssKeysStoreFinalize (xmlSecKeyStorePtr store); --static xmlSecKeyPtr xmlSecNssKeysStoreFindKey (xmlSecKeyStorePtr store, -- const xmlChar* name, -- xmlSecKeyInfoCtxPtr keyInfoCtx); -+ * Keys store specific initialization method. -+ * -+ * Returns 0 on success or a negative value if an error occurs. -+ */ -+static int -+xmlSecNssKeysStoreInitialize( -+ xmlSecKeyStorePtr store -+) { -+ xmlSecNssKeysStoreCtxPtr context = NULL ; -+ -+ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ; -+ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ; -+ -+ context = xmlSecNssKeysStoreGetCtx( store ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecNssKeysStoreGetCtx" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } - --static xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = { -- sizeof(xmlSecKeyStoreKlass), -- xmlSecNssKeysStoreSize, -+ context->keyList = NULL ; -+ context->slotList = NULL ; - -- /* data */ -- BAD_CAST "NSS-keys-store", /* const xmlChar* name; */ -- -- /* constructors/destructor */ -- xmlSecNssKeysStoreInitialize, /* xmlSecKeyStoreInitializeMethod initialize; */ -- xmlSecNssKeysStoreFinalize, /* xmlSecKeyStoreFinalizeMethod finalize; */ -- xmlSecNssKeysStoreFindKey, /* xmlSecKeyStoreFindKeyMethod findKey; */ -- -- /* reserved for the future */ -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ --}; -+ return 0 ; -+} - --/** -- * xmlSecNssKeysStoreGetKlass: -- * -- * The Nss list based keys store klass. -+/** -+ * xmlSecKeyStoreFinalizeMethod: -+ * @store: the store. - * -- * Returns Nss list based keys store klass. -+ * Keys store specific finalization (destroy) method. - */ --xmlSecKeyStoreId --xmlSecNssKeysStoreGetKlass(void) { -- return(&xmlSecNssKeysStoreKlass); -+void -+xmlSecNssKeysStoreFinalize( -+ xmlSecKeyStorePtr store -+) { -+ xmlSecNssKeysStoreCtxPtr context = NULL ; -+ -+ xmlSecAssert( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) ) ; -+ xmlSecAssert( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) ) ; -+ -+ context = xmlSecNssKeysStoreGetCtx( store ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecNssKeysStoreGetCtx" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return ; -+ } -+ -+ if( context->keyList != NULL ) { -+ xmlSecPtrListDestroy( context->keyList ) ; -+ context->keyList = NULL ; -+ } -+ -+ if( context->slotList != NULL ) { -+ xmlSecPtrListDestroy( context->slotList ) ; -+ context->slotList = NULL ; -+ } - } - --/** -- * xmlSecNssKeysStoreAdoptKey: -- * @store: the pointer to Nss keys store. -- * @key: the pointer to key. -- * -- * Adds @key to the @store. -+xmlSecKeyPtr -+xmlSecNssKeysStoreFindKeyFromSlot( -+ PK11SlotInfo* slot, -+ const xmlChar* name, -+ xmlSecKeyInfoCtxPtr keyInfoCtx -+) { -+ xmlSecKeyPtr key = NULL ; -+ xmlSecKeyDataPtr data = NULL ; -+ int length ; -+ -+ xmlSecAssert2( slot != NULL , NULL ) ; -+ xmlSecAssert2( name != NULL , NULL ) ; -+ xmlSecAssert2( keyInfoCtx != NULL , NULL ) ; -+ -+ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypeSymmetric ) == xmlSecKeyDataTypeSymmetric ) { -+ PK11SymKey* symKey ; -+ PK11SymKey* curKey ; -+ -+ /* Find symmetric key from the slot by name */ -+ symKey = PK11_ListFixedKeysInSlot( slot , ( char* )name , NULL ) ; -+ for( curKey = symKey ; curKey != NULL ; curKey = PK11_GetNextSymKey( curKey ) ) { -+ /* Check the key request */ -+ length = PK11_GetKeyLength( curKey ) ; -+ length *= 8 ; -+ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) && -+ ( length > 0 ) && -+ ( length < keyInfoCtx->keyReq.keyBitsSize ) ) -+ continue ; -+ -+ /* We find a eligible key */ -+ data = xmlSecNssSymKeyDataKeyAdopt( curKey ) ; -+ if( data == NULL ) { -+ /* Do nothing */ -+ } -+ break ; -+ } -+ -+ /* Destroy the sym key list */ -+ for( curKey = symKey ; curKey != NULL ; ) { -+ symKey = curKey ; -+ curKey = PK11_GetNextSymKey( symKey ) ; -+ PK11_FreeSymKey( symKey ) ; -+ } -+ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) { -+ SECKEYPublicKeyList* pubKeyList ; -+ SECKEYPublicKey* pubKey ; -+ SECKEYPublicKeyListNode* curPub ; -+ -+ /* Find asymmetric key from the slot by name */ -+ pubKeyList = PK11_ListPublicKeysInSlot( slot , ( char* )name ) ; -+ pubKey = NULL ; -+ curPub = PUBKEY_LIST_HEAD(pubKeyList); -+ for( ; !PUBKEY_LIST_END(curPub, pubKeyList) ; curPub = PUBKEY_LIST_NEXT( curPub ) ) { -+ /* Check the key request */ -+ length = SECKEY_PublicKeyStrength( curPub->key ) ; -+ length *= 8 ; -+ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) && -+ ( length > 0 ) && -+ ( length < keyInfoCtx->keyReq.keyBitsSize ) ) -+ continue ; -+ -+ /* We find a eligible key */ -+ pubKey = curPub->key ; -+ break ; -+ } -+ -+ if( pubKey != NULL ) { -+ data = xmlSecNssPKIAdoptKey( NULL, pubKey ) ; -+ if( data == NULL ) { -+ /* Do nothing */ -+ } -+ } -+ -+ /* Destroy the public key list */ -+ SECKEY_DestroyPublicKeyList( pubKeyList ) ; -+ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) { -+ SECKEYPrivateKeyList* priKeyList = NULL ; -+ SECKEYPrivateKey* priKey = NULL ; -+ SECKEYPrivateKeyListNode* curPri ; -+ -+ /* Find asymmetric key from the slot by name */ -+ priKeyList = PK11_ListPrivKeysInSlot( slot , ( char* )name , NULL ) ; -+ priKey = NULL ; -+ curPri = PRIVKEY_LIST_HEAD(priKeyList); -+ for( ; !PRIVKEY_LIST_END(curPri, priKeyList) ; curPri = PRIVKEY_LIST_NEXT( curPri ) ) { -+ /* Check the key request */ -+ length = PK11_SignatureLen( curPri->key ) ; -+ length *= 8 ; -+ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) && -+ ( length > 0 ) && -+ ( length < keyInfoCtx->keyReq.keyBitsSize ) ) -+ continue ; -+ -+ /* We find a eligible key */ -+ priKey = curPri->key ; -+ break ; -+ } -+ -+ if( priKey != NULL ) { -+ data = xmlSecNssPKIAdoptKey( priKey, NULL ) ; -+ if( data == NULL ) { -+ /* Do nothing */ -+ } -+ } -+ -+ /* Destroy the private key list */ -+ SECKEY_DestroyPrivateKeyList( priKeyList ) ; -+ } -+ -+ /* If we have gotten the key value */ -+ if( data != NULL ) { -+ if( ( key = xmlSecKeyCreate() ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeyCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyDataDestroy( data ) ; -+ return NULL ; -+ } -+ -+ if( xmlSecKeySetValue( key , data ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeySetValue" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyDestroy( key ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return NULL ; -+ } -+ } -+ -+ return(key); -+} -+ -+/** -+ * xmlSecKeyStoreFindKeyMethod: -+ * @store: the store. -+ * @name: the desired key name. -+ * @keyInfoCtx: the pointer to key info context. - * -- * Returns 0 on success or a negative value if an error occurs. -+ * Keys store specific find method. The caller is responsible for destroying -+ * the returned key using #xmlSecKeyDestroy method. -+ * -+ * Returns the pointer to a key or NULL if key is not found or an error occurs. - */ --int --xmlSecNssKeysStoreAdoptKey(xmlSecKeyStorePtr store, xmlSecKeyPtr key) { -- xmlSecKeyStorePtr *ss; -- -- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1); -- xmlSecAssert2((key != NULL), -1); -+static xmlSecKeyPtr -+xmlSecNssKeysStoreFindKey( -+ xmlSecKeyStorePtr store , -+ const xmlChar* name , -+ xmlSecKeyInfoCtxPtr keyInfoCtx -+) { -+ xmlSecNssKeysStoreCtxPtr context = NULL ; -+ xmlSecKeyPtr key = NULL ; -+ xmlSecNssKeySlotPtr keySlot = NULL ; -+ xmlSecSize pos ; -+ xmlSecSize size ; -+ -+ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , NULL ) ; -+ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , NULL ) ; -+ xmlSecAssert2( keyInfoCtx != NULL , NULL ) ; -+ -+ context = xmlSecNssKeysStoreGetCtx( store ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecNssKeysStoreGetCtx" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return NULL ; -+ } -+ -+ /*- -+ * Look for key at keyList at first. -+ */ -+ if( context->keyList != NULL ) { -+ size = xmlSecPtrListGetSize( context->keyList ) ; -+ for( pos = 0 ; pos < size ; pos ++ ) { -+ key = ( xmlSecKeyPtr )xmlSecPtrListGetItem( context->keyList , pos ) ; -+ if( key != NULL && xmlSecKeyMatch( key , name , &( keyInfoCtx->keyReq ) ) ) { -+ return xmlSecKeyDuplicate( key ) ; -+ } -+ } -+ } -+ -+ /*- -+ * Find the key from slotList -+ */ -+ if( context->slotList != NULL ) { -+ PK11SlotInfo* slot = NULL ; -+ -+ size = xmlSecPtrListGetSize( context->slotList ) ; -+ for( pos = 0 ; pos < size ; pos ++ ) { -+ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( context->slotList , pos ) ; -+ slot = xmlSecNssKeySlotGetSlot( keySlot ) ; -+ if( slot == NULL ) { -+ continue ; -+ } else { -+ key = xmlSecNssKeysStoreFindKeyFromSlot( slot, name, keyInfoCtx ) ; -+ if( key == NULL ) { -+ continue ; -+ } else { -+ return( key ) ; -+ } -+ } -+ } -+ } -+ -+ /*- -+ * Create a session key if we can not find the key from keyList and slotList -+ */ -+ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypeSession ) == xmlSecKeyDataTypeSession ) { -+ key = xmlSecKeyGenerate( keyInfoCtx->keyReq.keyId , keyInfoCtx->keyReq.keyBitsSize , xmlSecKeyDataTypeSession ) ; -+ if( key == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , -+ "xmlSecKeySetValue" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return NULL ; -+ } -+ -+ return key ; -+ } -+ -+ /** -+ * We have no way to find the key any more. -+ */ -+ return NULL ; -+} - -- ss = xmlSecNssKeysStoreGetSS(store); -- xmlSecAssert2(((ss != NULL) && (*ss != NULL) && -- (xmlSecKeyStoreCheckId(*ss, xmlSecSimpleKeysStoreId))), -1); -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = { -+#else -+static xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = { -+#endif -+ sizeof( xmlSecKeyStoreKlass ) , -+ xmlSecNssKeysStoreSize , -+ BAD_CAST "implicit_nss_keys_store" , -+ xmlSecNssKeysStoreInitialize , -+ xmlSecNssKeysStoreFinalize , -+ xmlSecNssKeysStoreFindKey , -+ NULL , -+ NULL -+} ; - -- return (xmlSecSimpleKeysStoreAdoptKey(*ss, key)); -+/** -+ * xmlSecNssKeysStoreGetKlass: -+ * -+ * The simple list based keys store klass. -+ * -+ * Returns simple list based keys store klass. -+ */ -+xmlSecKeyStoreId -+xmlSecNssKeysStoreGetKlass( void ) { -+ return &xmlSecNssKeysStoreKlass ; - } - -+ -+/************************** -+ * Application routines -+ */ - /** - * xmlSecNssKeysStoreLoad: - * @store: the pointer to Nss keys store. -@@ -125,8 +528,11 @@ - * Returns 0 on success or a negative value if an error occurs. - */ - int --xmlSecNssKeysStoreLoad(xmlSecKeyStorePtr store, const char *uri, -- xmlSecKeysMngrPtr keysMngr) { -+xmlSecNssKeysStoreLoad( -+ xmlSecKeyStorePtr store, -+ const char *uri, -+ xmlSecKeysMngrPtr keysMngr -+) { - xmlDocPtr doc; - xmlNodePtr root; - xmlNodePtr cur; -@@ -252,254 +658,147 @@ - */ - int - xmlSecNssKeysStoreSave(xmlSecKeyStorePtr store, const char *filename, xmlSecKeyDataType type) { -- xmlSecKeyStorePtr *ss; -- -- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1); -- xmlSecAssert2((filename != NULL), -1); -- -- ss = xmlSecNssKeysStoreGetSS(store); -- xmlSecAssert2(((ss != NULL) && (*ss != NULL) && -- (xmlSecKeyStoreCheckId(*ss, xmlSecSimpleKeysStoreId))), -1); -- -- return (xmlSecSimpleKeysStoreSave(*ss, filename, type)); --} -- --static int --xmlSecNssKeysStoreInitialize(xmlSecKeyStorePtr store) { -- xmlSecKeyStorePtr *ss; -- -- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1); -+ xmlSecKeyInfoCtx keyInfoCtx; -+ xmlSecNssKeysStoreCtxPtr context ; -+ xmlSecPtrListPtr list; -+ xmlSecKeyPtr key; -+ xmlSecSize i, keysSize; -+ xmlDocPtr doc; -+ xmlNodePtr cur; -+ xmlSecKeyDataPtr data; -+ xmlSecPtrListPtr idsList; -+ xmlSecKeyDataId dataId; -+ xmlSecSize idsSize, j; -+ int ret; - -- ss = xmlSecNssKeysStoreGetSS(store); -- xmlSecAssert2((*ss == NULL), -1); -+ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ), -1 ) ; -+ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ), -1 ) ; -+ xmlSecAssert2(filename != NULL, -1); -+ -+ context = xmlSecNssKeysStoreGetCtx( store ) ; -+ xmlSecAssert2( context != NULL, -1 ); -+ -+ list = context->keyList ; -+ xmlSecAssert2( list != NULL, -1 ); -+ xmlSecAssert2(xmlSecPtrListCheckId(list, xmlSecKeyPtrListId), -1); - -- *ss = xmlSecKeyStoreCreate(xmlSecSimpleKeysStoreId); -- if(*ss == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -+ /* create doc */ -+ doc = xmlSecCreateTree(BAD_CAST "Keys", xmlSecNs); -+ if(doc == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -- "xmlSecKeyStoreCreate", -+ "xmlSecCreateTree", - XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "xmlSecSimpleKeysStoreId"); -- return(-1); -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); - } -- -- return(0); --} -- --static void --xmlSecNssKeysStoreFinalize(xmlSecKeyStorePtr store) { -- xmlSecKeyStorePtr *ss; -- -- xmlSecAssert(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId)); -- -- ss = xmlSecNssKeysStoreGetSS(store); -- xmlSecAssert((ss != NULL) && (*ss != NULL)); - -- xmlSecKeyStoreDestroy(*ss); --} -- --static xmlSecKeyPtr --xmlSecNssKeysStoreFindKey(xmlSecKeyStorePtr store, const xmlChar* name, -- xmlSecKeyInfoCtxPtr keyInfoCtx) { -- xmlSecKeyStorePtr* ss; -- xmlSecKeyPtr key = NULL; -- xmlSecKeyPtr retval = NULL; -- xmlSecKeyReqPtr keyReq = NULL; -- CERTCertificate *cert = NULL; -- SECKEYPublicKey *pubkey = NULL; -- SECKEYPrivateKey *privkey = NULL; -- xmlSecKeyDataPtr data = NULL; -- xmlSecKeyDataPtr x509Data = NULL; -- int ret; -- -- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), NULL); -- xmlSecAssert2(keyInfoCtx != NULL, NULL); -- -- ss = xmlSecNssKeysStoreGetSS(store); -- xmlSecAssert2(((ss != NULL) && (*ss != NULL)), NULL); -- -- key = xmlSecKeyStoreFindKey(*ss, name, keyInfoCtx); -- if (key != NULL) { -- return (key); -- } -+ idsList = xmlSecKeyDataIdsGet(); -+ xmlSecAssert2(idsList != NULL, -1); -+ -+ keysSize = xmlSecPtrListGetSize(list); -+ idsSize = xmlSecPtrListGetSize(idsList); -+ for(i = 0; i < keysSize; ++i) { -+ key = (xmlSecKeyPtr)xmlSecPtrListGetItem(list, i); -+ xmlSecAssert2(key != NULL, -1); -+ -+ cur = xmlSecAddChild(xmlDocGetRootElement(doc), xmlSecNodeKeyInfo, xmlSecDSigNs); -+ if(cur == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -+ "xmlSecAddChild", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "node=%s", -+ xmlSecErrorsSafeString(xmlSecNodeKeyInfo)); -+ xmlFreeDoc(doc); -+ return(-1); -+ } - -- /* Try to find the key in the NSS DB, and construct an xmlSecKey. -- * we must have a name to lookup keys in NSS DB. -- */ -- if (name == NULL) { -- goto done; -- } -+ /* special data key name */ -+ if(xmlSecKeyGetName(key) != NULL) { -+ if(xmlSecAddChild(cur, xmlSecNodeKeyName, xmlSecDSigNs) == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -+ "xmlSecAddChild", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "node=%s", -+ xmlSecErrorsSafeString(xmlSecNodeKeyName)); -+ xmlFreeDoc(doc); -+ return(-1); -+ } -+ } -+ -+ /* create nodes for other keys data */ -+ for(j = 0; j < idsSize; ++j) { -+ dataId = (xmlSecKeyDataId)xmlSecPtrListGetItem(idsList, j); -+ xmlSecAssert2(dataId != xmlSecKeyDataIdUnknown, -1); - -- /* what type of key are we looking for? -- * TBD: For now, we'll look only for public/private keys using the -- * name as a cert nickname. Later on, we can attempt to find -- * symmetric keys using PK11_FindFixedKey -- */ -- keyReq = &(keyInfoCtx->keyReq); -- if (keyReq->keyType & -- (xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate)) { -- cert = CERT_FindCertByNickname (CERT_GetDefaultCertDB(), (char *)name); -- if (cert == NULL) { -- goto done; -- } -- -- if (keyReq->keyType & xmlSecKeyDataTypePublic) { -- pubkey = CERT_ExtractPublicKey(cert); -- if (pubkey == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CERT_ExtractPublicKey", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -+ if(dataId->dataNodeName == NULL) { -+ continue; -+ } -+ -+ data = xmlSecKeyGetData(key, dataId); -+ if(data == NULL) { -+ continue; - } -- } - -- if (keyReq->keyType & xmlSecKeyDataTypePrivate) { -- privkey = PK11_FindKeyByAnyCert(cert, NULL); -- if (privkey == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "PK11_FindKeyByAnyCert", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -+ if(xmlSecAddChild(cur, dataId->dataNodeName, dataId->dataNodeNs) == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -+ "xmlSecAddChild", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "node=%s", -+ xmlSecErrorsSafeString(dataId->dataNodeName)); -+ xmlFreeDoc(doc); -+ return(-1); - } - } - -- data = xmlSecNssPKIAdoptKey(privkey, pubkey); -- if(data == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssPKIAdoptKey", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- privkey = NULL; -- pubkey = NULL; -- -- key = xmlSecKeyCreate(); -- if (key == NULL) { -+ ret = xmlSecKeyInfoCtxInitialize(&keyInfoCtx, NULL); -+ if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecKeyCreate", -+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -+ "xmlSecKeyInfoCtxInitialize", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -- return (NULL); -- } -- -- x509Data = xmlSecKeyDataCreate(xmlSecNssKeyDataX509Id); -- if(x509Data == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecKeyDataCreate", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "transform=%s", -- xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecNssKeyDataX509Id))); -- goto done; -- } -- -- ret = xmlSecNssKeyDataX509AdoptKeyCert(x509Data, cert); -- if (ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssKeyDataX509AdoptKeyCert", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "data=%s", -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); -- goto done; -- } -- cert = CERT_DupCertificate(cert); -- if (cert == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CERT_DupCertificate", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- "data=%s", -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); -- goto done; -- } -- -- ret = xmlSecNssKeyDataX509AdoptCert(x509Data, cert); -- if (ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssKeyDataX509AdoptCert", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "data=%s", -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); -- goto done; -+ xmlFreeDoc(doc); -+ return(-1); - } -- cert = NULL; - -- ret = xmlSecKeySetValue(key, data); -- if (ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecKeySetValue", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "data=%s", -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data))); -- goto done; -- } -- data = NULL; -+ keyInfoCtx.mode = xmlSecKeyInfoModeWrite; -+ keyInfoCtx.keyReq.keyId = xmlSecKeyDataIdUnknown; -+ keyInfoCtx.keyReq.keyType = type; -+ keyInfoCtx.keyReq.keyUsage = xmlSecKeyDataUsageAny; - -- ret = xmlSecKeyAdoptData(key, x509Data); -- if (ret < 0) { -+ /* finally write key in the node */ -+ ret = xmlSecKeyInfoNodeWrite(cur, key, &keyInfoCtx); -+ if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecKeyAdoptData", -+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -+ "xmlSecKeyInfoNodeWrite", - XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "data=%s", -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); -- goto done; -- } -- x509Data = NULL; -- -- retval = key; -- key = NULL; -- } -- --done: -- if (cert != NULL) { -- CERT_DestroyCertificate(cert); -- } -- if (pubkey != NULL) { -- SECKEY_DestroyPublicKey(pubkey); -- } -- if (privkey != NULL) { -- SECKEY_DestroyPrivateKey(privkey); -- } -- if (data != NULL) { -- xmlSecKeyDataDestroy(data); -- } -- if (x509Data != NULL) { -- xmlSecKeyDataDestroy(x509Data); -- } -- if (key != NULL) { -- xmlSecKeyDestroy(key); -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlSecKeyInfoCtxFinalize(&keyInfoCtx); -+ xmlFreeDoc(doc); -+ return(-1); -+ } -+ xmlSecKeyInfoCtxFinalize(&keyInfoCtx); - } -- -- /* now that we have a key, make sure it is valid and let the simple -- * store adopt it */ -- if (retval) { -- if (xmlSecKeyIsValid(retval)) { -- ret = xmlSecSimpleKeysStoreAdoptKey(*ss, retval); -- if (ret < 0) { -+ -+ /* now write result */ -+ ret = xmlSaveFormatFile(filename, doc, 1); -+ if(ret < 0) { - xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -- "xmlSecSimpleKeysStoreAdoptKey", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- xmlSecKeyDestroy(retval); -- retval = NULL; -- } -- } else { -- xmlSecKeyDestroy(retval); -- retval = NULL; -- } -- } -- -- return (retval); -+ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), -+ "xmlSaveFormatFile", -+ XMLSEC_ERRORS_R_XML_FAILED, -+ "filename=%s", -+ xmlSecErrorsSafeString(filename)); -+ xmlFreeDoc(doc); -+ return(-1); -+ } -+ -+ xmlFreeDoc(doc); -+ return(0); - } -+ ---- misc/xmlsec1-1.2.6/src/nss/keytrans.c 2008-06-29 23:44:39.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/keytrans.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,752 @@ --dummy -+/** -+ * -+ * XMLSec library -+ * -+ * AES Algorithm support -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright ................................. -+ */ -+#include "globals.h" -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <string.h> -+ -+#include <nss.h> -+#include <pk11func.h> -+#include <keyhi.h> -+#include <key.h> -+#include <hasht.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/xmltree.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+#include <xmlsec/errors.h> -+ -+#include <xmlsec/nss/crypto.h> -+#include <xmlsec/nss/pkikeys.h> -+#include <xmlsec/nss/tokens.h> -+ -+/********************************************************************* -+ * -+ * key transform transforms -+ * -+ ********************************************************************/ -+typedef struct _xmlSecNssKeyTransportCtx xmlSecNssKeyTransportCtx ; -+typedef struct _xmlSecNssKeyTransportCtx* xmlSecNssKeyTransportCtxPtr ; -+ -+#define xmlSecNssKeyTransportSize \ -+ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssKeyTransportCtx ) ) -+ -+#define xmlSecNssKeyTransportGetCtx( transform ) \ -+ ( ( xmlSecNssKeyTransportCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) ) -+ -+struct _xmlSecNssKeyTransportCtx { -+ CK_MECHANISM_TYPE cipher ; -+ SECKEYPublicKey* pubkey ; -+ SECKEYPrivateKey* prikey ; -+ xmlSecKeyDataId keyId ; -+ xmlSecBufferPtr material ; /* to be encrypted/decrypted material */ -+} ; -+ -+static int xmlSecNssKeyTransportInitialize(xmlSecTransformPtr transform); -+static void xmlSecNssKeyTransportFinalize(xmlSecTransformPtr transform); -+static int xmlSecNssKeyTransportSetKeyReq(xmlSecTransformPtr transform, -+ xmlSecKeyReqPtr keyReq); -+static int xmlSecNssKeyTransportSetKey(xmlSecTransformPtr transform, -+ xmlSecKeyPtr key); -+static int xmlSecNssKeyTransportExecute(xmlSecTransformPtr transform, -+ int last, -+ xmlSecTransformCtxPtr transformCtx); -+static xmlSecSize xmlSecNssKeyTransportGetKeySize(xmlSecTransformPtr transform); -+ -+static int -+xmlSecNssKeyTransportCheckId( -+ xmlSecTransformPtr transform -+) { -+ #ifndef XMLSEC_NO_RSA -+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformRsaPkcs1Id ) || -+ xmlSecTransformCheckId( transform, xmlSecNssTransformRsaOaepId ) ) { -+ -+ return(1); -+ } -+ #endif /* XMLSEC_NO_RSA */ -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKeyTransportInitialize(xmlSecTransformPtr transform) { -+ xmlSecNssKeyTransportCtxPtr context ; -+ int ret; -+ -+ xmlSecAssert2(xmlSecNssKeyTransportCheckId(transform), -1); -+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyTransportSize), -1); -+ -+ context = xmlSecNssKeyTransportGetCtx( transform ) ; -+ xmlSecAssert2( context != NULL , -1 ) ; -+ -+ #ifndef XMLSEC_NO_RSA -+ if( transform->id == xmlSecNssTransformRsaPkcs1Id ) { -+ context->cipher = CKM_RSA_PKCS ; -+ context->keyId = xmlSecNssKeyDataRsaId ; -+ } else if( transform->id == xmlSecNssTransformRsaOaepId ) { -+ context->cipher = CKM_RSA_PKCS_OAEP ; -+ context->keyId = xmlSecNssKeyDataRsaId ; -+ } else -+ #endif /* XMLSEC_NO_RSA */ -+ -+ if( 1 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ context->pubkey = NULL ; -+ context->prikey = NULL ; -+ context->material = NULL ; -+ -+ return(0); -+} -+ -+static void -+xmlSecNssKeyTransportFinalize(xmlSecTransformPtr transform) { -+ xmlSecNssKeyTransportCtxPtr context ; -+ -+ xmlSecAssert(xmlSecNssKeyTransportCheckId(transform)); -+ xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssKeyTransportSize)); -+ -+ context = xmlSecNssKeyTransportGetCtx( transform ) ; -+ xmlSecAssert( context != NULL ) ; -+ -+ if( context->pubkey != NULL ) { -+ SECKEY_DestroyPublicKey( context->pubkey ) ; -+ context->pubkey = NULL ; -+ } -+ -+ if( context->prikey != NULL ) { -+ SECKEY_DestroyPrivateKey( context->prikey ) ; -+ context->prikey = NULL ; -+ } -+ -+ if( context->material != NULL ) { -+ xmlSecBufferDestroy(context->material); -+ context->material = NULL ; -+ } -+} -+ -+static int -+xmlSecNssKeyTransportSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) { -+ xmlSecNssKeyTransportCtxPtr context ; -+ xmlSecSize cipherSize = 0 ; -+ -+ -+ xmlSecAssert2(xmlSecNssKeyTransportCheckId(transform), -1); -+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyTransportSize), -1); -+ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -+ xmlSecAssert2(keyReq != NULL, -1); -+ -+ context = xmlSecNssKeyTransportGetCtx( transform ) ; -+ xmlSecAssert2( context != NULL , -1 ) ; -+ -+ keyReq->keyId = context->keyId; -+ if(transform->operation == xmlSecTransformOperationEncrypt) { -+ keyReq->keyUsage = xmlSecKeyUsageEncrypt; -+ keyReq->keyType = xmlSecKeyDataTypePublic; -+ } else { -+ keyReq->keyUsage = xmlSecKeyUsageDecrypt; -+ keyReq->keyType = xmlSecKeyDataTypePrivate; -+ } -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKeyTransportSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) { -+ xmlSecNssKeyTransportCtxPtr context = NULL ; -+ xmlSecKeyDataPtr keyData = NULL ; -+ SECKEYPublicKey* pubkey = NULL ; -+ SECKEYPrivateKey* prikey = NULL ; -+ -+ xmlSecAssert2(xmlSecNssKeyTransportCheckId(transform), -1); -+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyTransportSize), -1); -+ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -+ xmlSecAssert2(key != NULL, -1); -+ -+ context = xmlSecNssKeyTransportGetCtx( transform ) ; -+ if( context == NULL || context->keyId == NULL || context->pubkey != NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyTransportGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ; -+ -+ keyData = xmlSecKeyGetValue( key ) ; -+ if( keyData == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) , -+ "xmlSecKeyGetValue" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if(transform->operation == xmlSecTransformOperationEncrypt) { -+ if( ( pubkey = xmlSecNssPKIKeyDataGetPubKey( keyData ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) , -+ "xmlSecNssPKIKeyDataGetPubKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ context->pubkey = pubkey ; -+ } else { -+ if( ( prikey = xmlSecNssPKIKeyDataGetPrivKey( keyData ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) , -+ "xmlSecNssPKIKeyDataGetPrivKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ context->prikey = prikey ; -+ } -+ -+ return(0) ; -+} -+ -+/** -+ * key wrap transform -+ */ -+static int -+xmlSecNssKeyTransportCtxInit( -+ xmlSecNssKeyTransportCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecSize blockSize ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ( ctx->pubkey != NULL && encrypt ) || ( ctx->prikey != NULL && !encrypt ), -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ if( ctx->material != NULL ) { -+ xmlSecBufferDestroy( ctx->material ) ; -+ ctx->material = NULL ; -+ } -+ -+ if( ctx->pubkey != NULL ) { -+ blockSize = SECKEY_PublicKeyStrength( ctx->pubkey ) ; -+ } else if( ctx->prikey != NULL ) { -+ blockSize = PK11_SignatureLen( ctx->prikey ) ; -+ } else { -+ blockSize = -1 ; -+ } -+ -+ if( blockSize < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ ctx->material = xmlSecBufferCreate( blockSize ) ; -+ if( ctx->material == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ /* read raw key material into context */ -+ if( xmlSecBufferSetData( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferSetData" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ return(0); -+} -+ -+/** -+ * key wrap transform update -+ */ -+static int -+xmlSecNssKeyTransportCtxUpdate( -+ xmlSecNssKeyTransportCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ( ctx->pubkey != NULL && encrypt ) || ( ctx->prikey != NULL && !encrypt ), -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( ctx->material != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ /* read raw key material and append into context */ -+ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ return(0); -+} -+ -+/** -+ * Block cipher transform final -+ */ -+static int -+xmlSecNssKeyTransportCtxFinal( -+ xmlSecNssKeyTransportCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ SECKEYPublicKey* targetKey ; -+ PK11SymKey* symKey ; -+ PK11SlotInfo* slot ; -+ SECItem oriskv ; -+ xmlSecSize blockSize ; -+ xmlSecBufferPtr result ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ( ctx->pubkey != NULL && encrypt ) || ( ctx->prikey != NULL && !encrypt ), -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( ctx->material != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ /* read raw key material and append into context */ -+ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ /* Now we get all of the key materail */ -+ /* from now on we will wrap or unwrap the key */ -+ if( ctx->pubkey != NULL ) { -+ blockSize = SECKEY_PublicKeyStrength( ctx->pubkey ) ; -+ } else if( ctx->prikey != NULL ) { -+ blockSize = PK11_SignatureLen( ctx->prikey ) ; -+ } else { -+ blockSize = -1 ; -+ } -+ -+ if( blockSize < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_GetBlockSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ result = xmlSecBufferCreate( blockSize * 2 ) ; -+ if( result == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ oriskv.type = siBuffer ; -+ oriskv.data = xmlSecBufferGetData( ctx->material ) ; -+ oriskv.len = xmlSecBufferGetSize( ctx->material ) ; -+ -+ if( encrypt != 0 ) { -+ CK_OBJECT_HANDLE id ; -+ SECItem wrpskv ; -+ -+ /* Create template symmetric key from material */ -+ if( ( slot = ctx->pubkey->pkcs11Slot ) == NULL ) { -+ slot = xmlSecNssSlotGet( ctx->cipher ) ; -+ if( slot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSlotGet" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ -+ id = PK11_ImportPublicKey( slot, ctx->pubkey, PR_FALSE ) ; -+ if( id == CK_INVALID_HANDLE ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_ImportPublicKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ PK11_FreeSlot( slot ) ; -+ return(-1); -+ } -+ } -+ -+ /* pay attention to mechanism */ -+ symKey = PK11_ImportSymKey( slot, ctx->cipher, PK11_OriginUnwrap, CKA_WRAP, &oriskv, NULL ) ; -+ if( symKey == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_ImportSymKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ PK11_FreeSlot( slot ) ; -+ return(-1); -+ } -+ -+ wrpskv.type = siBuffer ; -+ wrpskv.data = xmlSecBufferGetData( result ) ; -+ wrpskv.len = xmlSecBufferGetMaxSize( result ) ; -+ -+ if( PK11_PubWrapSymKey( ctx->cipher, ctx->pubkey, symKey, &wrpskv ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_PubWrapSymKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSymKey( symKey ) ; -+ xmlSecBufferDestroy(result); -+ PK11_FreeSlot( slot ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferSetSize( result , wrpskv.len ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferSetSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSymKey( symKey ) ; -+ xmlSecBufferDestroy(result); -+ PK11_FreeSlot( slot ) ; -+ return(-1); -+ } -+ PK11_FreeSymKey( symKey ) ; -+ PK11_FreeSlot( slot ) ; -+ } else { -+ SECItem* keyItem ; -+ CK_OBJECT_HANDLE id1 ; -+ -+ /* pay attention to mechanism */ -+ if( ( symKey = PK11_PubUnwrapSymKey( ctx->prikey, &oriskv, ctx->cipher, CKA_UNWRAP, 0 ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_PubUnwrapSymKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ -+ /* Extract raw data from symmetric key */ -+ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_ExtractKeyValue" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSymKey( symKey ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ -+ if( ( keyItem = PK11_GetKeyData( symKey ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_GetKeyData" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSymKey( symKey ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ -+ if( xmlSecBufferSetData( result, keyItem->data, keyItem->len ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_PubUnwrapSymKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSymKey( symKey ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ PK11_FreeSymKey( symKey ) ; -+ } -+ -+ /* Write output */ -+ if( xmlSecBufferAppend( out, xmlSecBufferGetData(result), xmlSecBufferGetSize(result) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ xmlSecBufferDestroy(result); -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKeyTransportExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) { -+ xmlSecNssKeyTransportCtxPtr context = NULL ; -+ xmlSecBufferPtr inBuf, outBuf ; -+ int operation ; -+ int rtv ; -+ -+ xmlSecAssert2( xmlSecNssKeyTransportCheckId( transform ), -1 ) ; -+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssKeyTransportSize ), -1 ) ; -+ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ context = xmlSecNssKeyTransportGetCtx( transform ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyTransportGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ inBuf = &( transform->inBuf ) ; -+ outBuf = &( transform->outBuf ) ; -+ -+ if( transform->status == xmlSecTransformStatusNone ) { -+ transform->status = xmlSecTransformStatusWorking ; -+ } -+ -+ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ; -+ if( transform->status == xmlSecTransformStatusWorking ) { -+ if( context->material == NULL ) { -+ rtv = xmlSecNssKeyTransportCtxInit( context, inBuf , outBuf , operation , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyTransportCtxInit" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ } -+ -+ if( context->material == NULL && last != 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "No enough data to intialize transform" ) ; -+ return(-1); -+ } -+ -+ if( context->material != NULL ) { -+ rtv = xmlSecNssKeyTransportCtxUpdate( context, inBuf , outBuf , operation , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyTransportCtxUpdate" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ } -+ -+ if( last ) { -+ rtv = xmlSecNssKeyTransportCtxFinal( context, inBuf , outBuf , operation , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyTransportCtxFinal" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ transform->status = xmlSecTransformStatusFinished ; -+ } -+ } else if( transform->status == xmlSecTransformStatusFinished ) { -+ if( xmlSecBufferGetSize( inBuf ) != 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "status=%d", transform->status ) ; -+ return(-1); -+ } -+ } else { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "status=%d", transform->status ) ; -+ return(-1); -+ } -+ -+ return(0); -+} -+ -+ -+#ifndef XMLSEC_NO_RSA -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssRsaPkcs1Klass = { -+#else -+static xmlSecTransformKlass xmlSecNssRsaPkcs1Klass = { -+#endif -+ /* klass/object sizes */ -+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -+ xmlSecNssKeyTransportSize, /* xmlSecSize objSize */ -+ -+ xmlSecNameRsaPkcs1, /* const xmlChar* name; */ -+ xmlSecHrefRsaPkcs1, /* const xmlChar* href; */ -+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -+ -+ xmlSecNssKeyTransportInitialize, /* xmlSecTransformInitializeMethod initialize; */ -+ xmlSecNssKeyTransportFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -+ NULL, /* xmlSecTransformNodeReadMethod readNode; */ -+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -+ xmlSecNssKeyTransportSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -+ xmlSecNssKeyTransportSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -+ NULL, /* xmlSecTransformValidateMethod validate; */ -+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -+ NULL, /* xmlSecTransformPopXmlMethod popXml; */ -+ xmlSecNssKeyTransportExecute, /* xmlSecTransformExecuteMethod execute; */ -+ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ -+}; -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssRsaOaepKlass = { -+#else -+static xmlSecTransformKlass xmlSecNssRsaOaepKlass = { -+#endif -+ /* klass/object sizes */ -+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -+ xmlSecNssKeyTransportSize, /* xmlSecSize objSize */ -+ -+ xmlSecNameRsaOaep, /* const xmlChar* name; */ -+ xmlSecHrefRsaOaep, /* const xmlChar* href; */ -+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -+ -+ xmlSecNssKeyTransportInitialize, /* xmlSecTransformInitializeMethod initialize; */ -+ xmlSecNssKeyTransportFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -+ NULL, /* xmlSecTransformNodeReadMethod readNode; */ -+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -+ xmlSecNssKeyTransportSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -+ xmlSecNssKeyTransportSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -+ NULL, /* xmlSecTransformValidateMethod validate; */ -+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -+ NULL, /* xmlSecTransformPopXmlMethod popXml; */ -+ xmlSecNssKeyTransportExecute, /* xmlSecTransformExecuteMethod execute; */ -+ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ -+}; -+ -+/** -+ * xmlSecNssTransformRsaPkcs1GetKlass: -+ * -+ * The RSA-PKCS1 key transport transform klass. -+ * -+ * Returns RSA-PKCS1 key transport transform klass. -+ */ -+xmlSecTransformId -+xmlSecNssTransformRsaPkcs1GetKlass(void) { -+ return(&xmlSecNssRsaPkcs1Klass); -+} -+ -+/** -+ * xmlSecNssTransformRsaOaepGetKlass: -+ * -+ * The RSA-PKCS1 key transport transform klass. -+ * -+ * Returns RSA-PKCS1 key transport transform klass. -+ */ -+xmlSecTransformId -+xmlSecNssTransformRsaOaepGetKlass(void) { -+ return(&xmlSecNssRsaOaepKlass); -+} -+ -+#endif /* XMLSEC_NO_RSA */ -+ ---- misc/xmlsec1-1.2.6/src/nss/keywrapers.c 2008-06-29 23:44:40.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/keywrapers.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,1213 @@ --dummy -+/** -+ * -+ * XMLSec library -+ * -+ * AES Algorithm support -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright ................................. -+ */ -+#include "globals.h" -+ -+#include <stdlib.h> -+#include <stdio.h> -+#include <string.h> -+ -+#include <nss.h> -+#include <pk11func.h> -+#include <hasht.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/xmltree.h> -+#include <xmlsec/keys.h> -+#include <xmlsec/transforms.h> -+#include <xmlsec/errors.h> -+ -+#include <xmlsec/nss/crypto.h> -+#include <xmlsec/nss/ciphers.h> -+ -+#define XMLSEC_NSS_AES128_KEY_SIZE 16 -+#define XMLSEC_NSS_AES192_KEY_SIZE 24 -+#define XMLSEC_NSS_AES256_KEY_SIZE 32 -+#define XMLSEC_NSS_DES3_KEY_SIZE 24 -+#define XMLSEC_NSS_DES3_KEY_LENGTH 24 -+#define XMLSEC_NSS_DES3_IV_LENGTH 8 -+#define XMLSEC_NSS_DES3_BLOCK_LENGTH 8 -+ -+static xmlSecByte xmlSecNssKWDes3Iv[XMLSEC_NSS_DES3_IV_LENGTH] = { -+ 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05 -+}; -+ -+/********************************************************************* -+ * -+ * key wrap transforms -+ * -+ ********************************************************************/ -+typedef struct _xmlSecNssKeyWrapCtx xmlSecNssKeyWrapCtx ; -+typedef struct _xmlSecNssKeyWrapCtx* xmlSecNssKeyWrapCtxPtr ; -+ -+#define xmlSecNssKeyWrapSize \ -+ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssKeyWrapCtx ) ) -+ -+#define xmlSecNssKeyWrapGetCtx( transform ) \ -+ ( ( xmlSecNssKeyWrapCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) ) -+ -+struct _xmlSecNssKeyWrapCtx { -+ CK_MECHANISM_TYPE cipher ; -+ PK11SymKey* symkey ; -+ xmlSecKeyDataId keyId ; -+ xmlSecBufferPtr material ; /* to be encrypted/decrypted key material */ -+} ; -+ -+static int xmlSecNssKeyWrapInitialize(xmlSecTransformPtr transform); -+static void xmlSecNssKeyWrapFinalize(xmlSecTransformPtr transform); -+static int xmlSecNssKeyWrapSetKeyReq(xmlSecTransformPtr transform, -+ xmlSecKeyReqPtr keyReq); -+static int xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform, -+ xmlSecKeyPtr key); -+static int xmlSecNssKeyWrapExecute(xmlSecTransformPtr transform, -+ int last, -+ xmlSecTransformCtxPtr transformCtx); -+static xmlSecSize xmlSecNssKeyWrapGetKeySize(xmlSecTransformPtr transform); -+ -+static int -+xmlSecNssKeyWrapCheckId( -+ xmlSecTransformPtr transform -+) { -+ #ifndef XMLSEC_NO_DES -+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWDes3Id ) ) { -+ return(1); -+ } -+ #endif /* XMLSEC_NO_DES */ -+ -+ #ifndef XMLSEC_NO_AES -+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes128Id ) || -+ xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes192Id ) || -+ xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes256Id ) ) { -+ -+ return(1); -+ } -+ #endif /* XMLSEC_NO_AES */ -+ -+ return(0); -+} -+ -+static xmlSecSize -+xmlSecNssKeyWrapGetKeySize(xmlSecTransformPtr transform) { -+#ifndef XMLSEC_NO_DES -+ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWDes3Id ) ) { -+ return(XMLSEC_NSS_DES3_KEY_SIZE); -+ } else -+#endif /* XMLSEC_NO_DES */ -+ -+#ifndef XMLSEC_NO_AES -+ if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes128Id)) { -+ return(XMLSEC_NSS_AES128_KEY_SIZE); -+ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes192Id)) { -+ return(XMLSEC_NSS_AES192_KEY_SIZE); -+ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes256Id)) { -+ return(XMLSEC_NSS_AES256_KEY_SIZE); -+ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes256Id)) { -+ return(XMLSEC_NSS_AES256_KEY_SIZE); -+ } else -+#endif /* XMLSEC_NO_AES */ -+ -+ if(1) -+ return(0); -+} -+ -+ -+static int -+xmlSecNssKeyWrapInitialize(xmlSecTransformPtr transform) { -+ xmlSecNssKeyWrapCtxPtr context ; -+ int ret; -+ -+ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1); -+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1); -+ -+ context = xmlSecNssKeyWrapGetCtx( transform ) ; -+ xmlSecAssert2( context != NULL , -1 ) ; -+ -+ #ifndef XMLSEC_NO_DES -+ if( transform->id == xmlSecNssTransformKWDes3Id ) { -+ context->cipher = CKM_DES3_CBC ; -+ context->keyId = xmlSecNssKeyDataDesId ; -+ } else -+ #endif /* XMLSEC_NO_DES */ -+ -+ #ifndef XMLSEC_NO_AES -+ if( transform->id == xmlSecNssTransformKWAes128Id ) { -+ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/ -+ context->cipher = CKM_AES_CBC ; -+ context->keyId = xmlSecNssKeyDataAesId ; -+ } else -+ if( transform->id == xmlSecNssTransformKWAes192Id ) { -+ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/ -+ context->cipher = CKM_AES_CBC ; -+ context->keyId = xmlSecNssKeyDataAesId ; -+ } else -+ if( transform->id == xmlSecNssTransformKWAes256Id ) { -+ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/ -+ context->cipher = CKM_AES_CBC ; -+ context->keyId = xmlSecNssKeyDataAesId ; -+ } else -+ #endif /* XMLSEC_NO_AES */ -+ -+ -+ if( 1 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ context->symkey = NULL ; -+ context->material = NULL ; -+ -+ return(0); -+} -+ -+static void -+xmlSecNssKeyWrapFinalize(xmlSecTransformPtr transform) { -+ xmlSecNssKeyWrapCtxPtr context ; -+ -+ xmlSecAssert(xmlSecNssKeyWrapCheckId(transform)); -+ xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize)); -+ -+ context = xmlSecNssKeyWrapGetCtx( transform ) ; -+ xmlSecAssert( context != NULL ) ; -+ -+ if( context->symkey != NULL ) { -+ PK11_FreeSymKey( context->symkey ) ; -+ context->symkey = NULL ; -+ } -+ -+ if( context->material != NULL ) { -+ xmlSecBufferDestroy(context->material); -+ context->material = NULL ; -+ } -+} -+ -+static int -+xmlSecNssKeyWrapSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) { -+ xmlSecNssKeyWrapCtxPtr context ; -+ xmlSecSize cipherSize = 0 ; -+ -+ -+ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1); -+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1); -+ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -+ xmlSecAssert2(keyReq != NULL, -1); -+ -+ context = xmlSecNssKeyWrapGetCtx( transform ) ; -+ xmlSecAssert2( context != NULL , -1 ) ; -+ -+ keyReq->keyId = context->keyId; -+ keyReq->keyType = xmlSecKeyDataTypeSymmetric; -+ if(transform->operation == xmlSecTransformOperationEncrypt) { -+ keyReq->keyUsage = xmlSecKeyUsageEncrypt; -+ } else { -+ keyReq->keyUsage = xmlSecKeyUsageDecrypt; -+ } -+ -+ keyReq->keyBitsSize = xmlSecNssKeyWrapGetKeySize( transform ) ; -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) { -+ xmlSecNssKeyWrapCtxPtr context = NULL ; -+ xmlSecKeyDataPtr keyData = NULL ; -+ PK11SymKey* symkey = NULL ; -+ -+ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1); -+ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1); -+ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); -+ xmlSecAssert2(key != NULL, -1); -+ -+ context = xmlSecNssKeyWrapGetCtx( transform ) ; -+ if( context == NULL || context->keyId == NULL || context->symkey != NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyWrapGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ; -+ -+ keyData = xmlSecKeyGetValue( key ) ; -+ if( keyData == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) , -+ "xmlSecKeyGetValue" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( ( symkey = xmlSecNssSymKeyDataGetKey( keyData ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) , -+ "xmlSecNssSymKeyDataGetKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ context->symkey = symkey ; -+ -+ return(0) ; -+} -+ -+/** -+ * key wrap transform -+ */ -+static int -+xmlSecNssKeyWrapCtxInit( -+ xmlSecNssKeyWrapCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecSize blockSize ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ if( ctx->material != NULL ) { -+ xmlSecBufferDestroy( ctx->material ) ; -+ ctx->material = NULL ; -+ } -+ -+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_GetBlockSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ ctx->material = xmlSecBufferCreate( blockSize ) ; -+ if( ctx->material == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ /* read raw key material into context */ -+ if( xmlSecBufferSetData( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferSetData" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ return(0); -+} -+ -+/** -+ * key wrap transform update -+ */ -+static int -+xmlSecNssKeyWrapCtxUpdate( -+ xmlSecNssKeyWrapCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( ctx->material != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ /* read raw key material and append into context */ -+ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKWDes3BufferReverse(xmlSecByte *buf, xmlSecSize size) { -+ xmlSecSize s; -+ xmlSecSize i; -+ xmlSecByte c; -+ -+ xmlSecAssert2(buf != NULL, -1); -+ -+ s = size / 2; -+ --size; -+ for(i = 0; i < s; ++i) { -+ c = buf[i]; -+ buf[i] = buf[size - i]; -+ buf[size - i] = c; -+ } -+ return(0); -+} -+ -+static xmlSecByte * -+xmlSecNssComputeSHA1(const xmlSecByte *in, xmlSecSize inSize, -+ xmlSecByte *out, xmlSecSize outSize) -+{ -+ PK11Context *context = NULL; -+ SECStatus s; -+ xmlSecByte *digest = NULL; -+ unsigned int len; -+ -+ xmlSecAssert2(in != NULL, NULL); -+ xmlSecAssert2(out != NULL, NULL); -+ xmlSecAssert2(outSize >= SHA1_LENGTH, NULL); -+ -+ /* Create a context for hashing (digesting) */ -+ context = PK11_CreateDigestContext(SEC_OID_SHA1); -+ if (context == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_CreateDigestContext", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ s = PK11_DigestBegin(context); -+ if (s != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_DigestBegin", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ s = PK11_DigestOp(context, in, inSize); -+ if (s != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_DigestOp", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ s = PK11_DigestFinal(context, out, &len, outSize); -+ if (s != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_DigestFinal", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code = %d", PORT_GetError()); -+ goto done; -+ } -+ xmlSecAssert2(len == SHA1_LENGTH, NULL); -+ -+ digest = out; -+ -+done: -+ if (context != NULL) { -+ PK11_DestroyContext(context, PR_TRUE); -+ } -+ return (digest); -+} -+ -+static int -+xmlSecNssKWDes3Encrypt( -+ PK11SymKey* symKey , -+ CK_MECHANISM_TYPE cipherMech , -+ const xmlSecByte* iv , -+ xmlSecSize ivSize , -+ const xmlSecByte* in , -+ xmlSecSize inSize , -+ xmlSecByte* out , -+ xmlSecSize outSize , -+ int enc -+) { -+ PK11Context* EncContext = NULL; -+ SECItem ivItem ; -+ SECItem* secParam = NULL ; -+ int tmp1_outlen; -+ unsigned int tmp2_outlen; -+ int result_len = -1; -+ SECStatus rv; -+ -+ xmlSecAssert2( cipherMech != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( symKey != NULL , -1 ) ; -+ xmlSecAssert2(iv != NULL, -1); -+ xmlSecAssert2(ivSize == XMLSEC_NSS_DES3_IV_LENGTH, -1); -+ xmlSecAssert2(in != NULL, -1); -+ xmlSecAssert2(inSize > 0, -1); -+ xmlSecAssert2(out != NULL, -1); -+ xmlSecAssert2(outSize >= inSize, -1); -+ -+ /* Prepare IV */ -+ ivItem.data = ( unsigned char* )iv ; -+ ivItem.len = ivSize ; -+ -+ secParam = PK11_ParamFromIV(cipherMech, &ivItem); -+ if (secParam == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_ParamFromIV", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "Error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ EncContext = PK11_CreateContextBySymKey(cipherMech, -+ enc ? CKA_ENCRYPT : CKA_DECRYPT, -+ symKey, secParam); -+ if (EncContext == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_CreateContextBySymKey", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "Error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ tmp1_outlen = tmp2_outlen = 0; -+ rv = PK11_CipherOp(EncContext, out, &tmp1_outlen, outSize, -+ (unsigned char *)in, inSize); -+ if (rv != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_CipherOp", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "Error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ rv = PK11_DigestFinal(EncContext, out+tmp1_outlen, -+ &tmp2_outlen, outSize-tmp1_outlen); -+ if (rv != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_DigestFinal", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "Error code = %d", PORT_GetError()); -+ goto done; -+ } -+ -+ result_len = tmp1_outlen + tmp2_outlen; -+ -+done: -+ if (secParam) { -+ SECITEM_FreeItem(secParam, PR_TRUE); -+ } -+ if (EncContext) { -+ PK11_DestroyContext(EncContext, PR_TRUE); -+ } -+ -+ return(result_len); -+} -+ -+static int -+xmlSecNssKeyWrapDesOp( -+ xmlSecNssKeyWrapCtxPtr ctx , -+ int encrypt , -+ xmlSecBufferPtr result -+) { -+ xmlSecByte sha1[SHA1_LENGTH]; -+ xmlSecByte iv[XMLSEC_NSS_DES3_IV_LENGTH]; -+ xmlSecByte* in; -+ xmlSecSize inSize; -+ xmlSecByte* out; -+ xmlSecSize outSize; -+ xmlSecSize s; -+ int ret; -+ SECStatus status; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( ctx->material != NULL , -1 ) ; -+ xmlSecAssert2( result != NULL , -1 ) ; -+ -+ in = xmlSecBufferGetData(ctx->material); -+ inSize = xmlSecBufferGetSize(ctx->material) ; -+ out = xmlSecBufferGetData(result); -+ outSize = xmlSecBufferGetMaxSize(result) ; -+ if( encrypt ) { -+ /* step 2: calculate sha1 and CMS */ -+ if(xmlSecNssComputeSHA1(in, inSize, sha1, SHA1_LENGTH) == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssComputeSHA1", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ /* step 3: construct WKCKS */ -+ memcpy(out, in, inSize); -+ memcpy(out + inSize, sha1, XMLSEC_NSS_DES3_BLOCK_LENGTH); -+ -+ /* step 4: generate random iv */ -+ status = PK11_GenerateRandom(iv, XMLSEC_NSS_DES3_IV_LENGTH); -+ if(status != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PK11_GenerateRandom", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code = %d", PORT_GetError()); -+ return(-1); -+ } -+ -+ /* step 5: first encryption, result is TEMP1 */ -+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, -+ iv, XMLSEC_NSS_DES3_IV_LENGTH, -+ out, inSize + XMLSEC_NSS_DES3_IV_LENGTH, -+ out, outSize, 1); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssKWDes3Encrypt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ /* step 6: construct TEMP2=IV || TEMP1 */ -+ memmove(out + XMLSEC_NSS_DES3_IV_LENGTH, out, -+ inSize + XMLSEC_NSS_DES3_IV_LENGTH); -+ memcpy(out, iv, XMLSEC_NSS_DES3_IV_LENGTH); -+ s = ret + XMLSEC_NSS_DES3_IV_LENGTH; -+ -+ /* step 7: reverse octets order, result is TEMP3 */ -+ ret = xmlSecNssKWDes3BufferReverse(out, s); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssKWDes3BufferReverse", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ /* step 8: second encryption with static IV */ -+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, -+ xmlSecNssKWDes3Iv, XMLSEC_NSS_DES3_IV_LENGTH, -+ out, s, -+ out, outSize, 1); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssKWDes3Encrypt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ s = ret; -+ -+ if( xmlSecBufferSetSize( result , s ) < 0 ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBufferSetSize", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ } else { -+ /* step 2: first decryption with static IV, result is TEMP3 */ -+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, -+ xmlSecNssKWDes3Iv, XMLSEC_NSS_DES3_IV_LENGTH, -+ in, inSize, -+ out, outSize, 0); -+ if((ret < 0) || (ret < XMLSEC_NSS_DES3_IV_LENGTH)) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssKWDes3Encrypt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ s = ret; -+ -+ /* step 3: reverse octets order in TEMP3, result is TEMP2 */ -+ ret = xmlSecNssKWDes3BufferReverse(out, s); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssKWDes3BufferReverse", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ /* steps 4 and 5: get IV and decrypt second time, result is WKCKS */ -+ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, -+ out, XMLSEC_NSS_DES3_IV_LENGTH, -+ out+XMLSEC_NSS_DES3_IV_LENGTH, s-XMLSEC_NSS_DES3_IV_LENGTH, -+ out, outSize, 0); -+ if((ret < 0) || (ret < XMLSEC_NSS_DES3_BLOCK_LENGTH)) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssKWDes3Encrypt", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ s = ret - XMLSEC_NSS_DES3_IV_LENGTH; -+ -+ /* steps 6 and 7: calculate SHA1 and validate it */ -+ if(xmlSecNssComputeSHA1(out, s, sha1, SHA1_LENGTH) == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecNssComputeSHA1", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ if(memcmp(sha1, out + s, XMLSEC_NSS_DES3_BLOCK_LENGTH) != 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ NULL, -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ "SHA1 does not match"); -+ return(-1); -+ } -+ -+ if( xmlSecBufferSetSize( result , s ) < 0 ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBufferSetSize", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ } -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKeyWrapAesOp( -+ xmlSecNssKeyWrapCtxPtr ctx , -+ int encrypt , -+ xmlSecBufferPtr result -+) { -+ PK11Context* cipherCtx = NULL; -+ SECItem ivItem ; -+ SECItem* secParam = NULL ; -+ xmlSecSize inSize ; -+ xmlSecSize inBlocks ; -+ int blockSize ; -+ int midSize ; -+ int finSize ; -+ xmlSecByte* out ; -+ xmlSecSize outSize; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( ctx->material != NULL , -1 ) ; -+ xmlSecAssert2( result != NULL , -1 ) ; -+ -+ /* Do not set any IV */ -+ memset(&ivItem, 0, sizeof(ivItem)); -+ -+ /* Get block size */ -+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_GetBlockSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ inSize = xmlSecBufferGetSize( ctx->material ) ; -+ if( xmlSecBufferSetMaxSize( result , inSize + blockSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferSetMaxSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ /* Get Param for context initialization */ -+ if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_ParamFromIV" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ cipherCtx = PK11_CreateContextBySymKey( ctx->cipher , encrypt ? CKA_ENCRYPT : CKA_DECRYPT , ctx->symkey , secParam ) ; -+ if( cipherCtx == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_CreateContextBySymKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ SECITEM_FreeItem( secParam , PR_TRUE ) ; -+ return(-1); -+ } -+ -+ out = xmlSecBufferGetData(result) ; -+ outSize = xmlSecBufferGetMaxSize(result) ; -+ if( PK11_CipherOp( cipherCtx , out, &midSize , outSize , xmlSecBufferGetData( ctx->material ) , inSize ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_CipherOp" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( PK11_DigestFinal( cipherCtx , out + midSize , &finSize , outSize - midSize ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_DigestFinal" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferSetSize( result , midSize + finSize ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferSetSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ return 0 ; -+} -+ -+/** -+ * Block cipher transform final -+ */ -+static int -+xmlSecNssKeyWrapCtxFinal( -+ xmlSecNssKeyWrapCtxPtr ctx , -+ xmlSecBufferPtr in , -+ xmlSecBufferPtr out , -+ int encrypt , -+ xmlSecTransformCtxPtr transformCtx -+) { -+ PK11SymKey* targetKey ; -+ xmlSecSize blockSize ; -+ xmlSecBufferPtr result ; -+ -+ xmlSecAssert2( ctx != NULL , -1 ) ; -+ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; -+ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; -+ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; -+ xmlSecAssert2( ctx->material != NULL , -1 ) ; -+ xmlSecAssert2( in != NULL , -1 ) ; -+ xmlSecAssert2( out != NULL , -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ /* read raw key material and append into context */ -+ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferRemoveHead" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ /* Now we get all of the key materail */ -+ /* from now on we will wrap or unwrap the key */ -+ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "PK11_GetBlockSize" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ result = xmlSecBufferCreate( blockSize ) ; -+ if( result == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ switch( ctx->cipher ) { -+ case CKM_DES3_CBC : -+ if( xmlSecNssKeyWrapDesOp(ctx, encrypt, result) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssKeyWrapDesOp" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ break ; -+ /* case CKM_NETSCAPE_AES_KEY_WRAP :*/ -+ case CKM_AES_CBC : -+ if( xmlSecNssKeyWrapAesOp(ctx, encrypt, result) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssKeyWrapAesOp" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ break ; -+ } -+ -+ /* Write output */ -+ if( xmlSecBufferAppend( out, xmlSecBufferGetData(result), xmlSecBufferGetSize(result) ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecBufferAppend" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecBufferDestroy(result); -+ return(-1); -+ } -+ xmlSecBufferDestroy(result); -+ -+ return(0); -+} -+ -+static int -+xmlSecNssKeyWrapExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) { -+ xmlSecNssKeyWrapCtxPtr context = NULL ; -+ xmlSecBufferPtr inBuf, outBuf ; -+ int operation ; -+ int rtv ; -+ -+ xmlSecAssert2( xmlSecNssKeyWrapCheckId( transform ), -1 ) ; -+ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssKeyWrapSize ), -1 ) ; -+ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; -+ xmlSecAssert2( transformCtx != NULL , -1 ) ; -+ -+ context = xmlSecNssKeyWrapGetCtx( transform ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyWrapGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ inBuf = &( transform->inBuf ) ; -+ outBuf = &( transform->outBuf ) ; -+ -+ if( transform->status == xmlSecTransformStatusNone ) { -+ transform->status = xmlSecTransformStatusWorking ; -+ } -+ -+ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ; -+ if( transform->status == xmlSecTransformStatusWorking ) { -+ if( context->material == NULL ) { -+ rtv = xmlSecNssKeyWrapCtxInit( context, inBuf , outBuf , operation , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyWrapCtxInit" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ } -+ -+ if( context->material == NULL && last != 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "No enough data to intialize transform" ) ; -+ return(-1); -+ } -+ -+ if( context->material != NULL ) { -+ rtv = xmlSecNssKeyWrapCtxUpdate( context, inBuf , outBuf , operation , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyWrapCtxUpdate" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ } -+ -+ if( last ) { -+ rtv = xmlSecNssKeyWrapCtxFinal( context, inBuf , outBuf , operation , transformCtx ) ; -+ if( rtv < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ "xmlSecNssKeyWrapCtxFinal" , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ transform->status = xmlSecTransformStatusFinished ; -+ } -+ } else if( transform->status == xmlSecTransformStatusFinished ) { -+ if( xmlSecBufferGetSize( inBuf ) != 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "status=%d", transform->status ) ; -+ return(-1); -+ } -+ } else { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , -+ NULL , -+ XMLSEC_ERRORS_R_INVALID_STATUS , -+ "status=%d", transform->status ) ; -+ return(-1); -+ } -+ -+ return(0); -+} -+ -+#ifndef XMLSEC_NO_AES -+ -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssKWAes128Klass = { -+#else -+static xmlSecTransformKlass xmlSecNssKWAes128Klass = { -+#endif -+ /* klass/object sizes */ -+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ -+ -+ xmlSecNameKWAes128, /* const xmlChar* name; */ -+ xmlSecHrefKWAes128, /* const xmlChar* href; */ -+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -+ -+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ -+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -+ NULL, /* xmlSecTransformNodeReadMethod readNode; */ -+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -+ NULL, /* xmlSecTransformValidateMethod validate; */ -+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -+ NULL, /* xmlSecTransformPopXmlMethod popXml; */ -+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ -+ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ -+}; -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssKWAes192Klass = { -+#else -+static xmlSecTransformKlass xmlSecNssKWAes192Klass = { -+#endif -+ /* klass/object sizes */ -+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ -+ -+ xmlSecNameKWAes192, /* const xmlChar* name; */ -+ xmlSecHrefKWAes192, /* const xmlChar* href; */ -+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -+ -+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ -+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -+ NULL, /* xmlSecTransformNodeReadMethod readNode; */ -+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -+ NULL, /* xmlSecTransformValidateMethod validate; */ -+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -+ NULL, /* xmlSecTransformPopXmlMethod popXml; */ -+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ -+ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ -+}; -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssKWAes256Klass = { -+#else -+static xmlSecTransformKlass xmlSecNssKWAes256Klass = { -+#endif -+ /* klass/object sizes */ -+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ -+ -+ xmlSecNameKWAes256, /* const xmlChar* name; */ -+ xmlSecHrefKWAes256, /* const xmlChar* href; */ -+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -+ -+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ -+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -+ NULL, /* xmlSecTransformNodeReadMethod readNode; */ -+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -+ NULL, /* xmlSecTransformValidateMethod validate; */ -+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -+ NULL, /* xmlSecTransformPopXmlMethod popXml; */ -+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ -+ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ -+}; -+ -+/** -+ * xmlSecNssTransformKWAes128GetKlass: -+ * -+ * The AES-128 key wrapper transform klass. -+ * -+ * Returns AES-128 key wrapper transform klass. -+ */ -+xmlSecTransformId -+xmlSecNssTransformKWAes128GetKlass(void) { -+ return(&xmlSecNssKWAes128Klass); -+} -+ -+/** -+ * xmlSecNssTransformKWAes192GetKlass: -+ * -+ * The AES-192 key wrapper transform klass. -+ * -+ * Returns AES-192 key wrapper transform klass. -+ */ -+xmlSecTransformId -+xmlSecNssTransformKWAes192GetKlass(void) { -+ return(&xmlSecNssKWAes192Klass); -+} -+ -+/** -+ * -+ * The AES-256 key wrapper transform klass. -+ * -+ * Returns AES-256 key wrapper transform klass. -+ */ -+xmlSecTransformId -+xmlSecNssTransformKWAes256GetKlass(void) { -+ return(&xmlSecNssKWAes256Klass); -+} -+ -+#endif /* XMLSEC_NO_AES */ -+ -+ -+#ifndef XMLSEC_NO_DES -+ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssKWDes3Klass = { -+#else -+static xmlSecTransformKlass xmlSecNssKWDes3Klass = { -+#endif -+ /* klass/object sizes */ -+ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ -+ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ -+ -+ xmlSecNameKWDes3, /* const xmlChar* name; */ -+ xmlSecHrefKWDes3, /* const xmlChar* href; */ -+ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ -+ -+ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ -+ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ -+ NULL, /* xmlSecTransformNodeReadMethod readNode; */ -+ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ -+ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ -+ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ -+ NULL, /* xmlSecTransformValidateMethod validate; */ -+ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ -+ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ -+ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ -+ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ -+ NULL, /* xmlSecTransformPopXmlMethod popXml; */ -+ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ -+ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ -+}; -+ -+/** -+ * xmlSecNssTransformKWDes3GetKlass: -+ * -+ * The Triple DES key wrapper transform klass. -+ * -+ * Returns Triple DES key wrapper transform klass. -+ */ -+xmlSecTransformId -+xmlSecNssTransformKWDes3GetKlass(void) { -+ return(&xmlSecNssKWDes3Klass); -+} -+ -+#endif /* XMLSEC_NO_DES */ -+ ---- misc/xmlsec1-1.2.6/src/nss/pkikeys.c 2004-03-17 06:06:45.000000000 +0100 -+++ misc/build/xmlsec1-1.2.6/src/nss/pkikeys.c 2008-06-29 23:44:19.000000000 +0200 -@@ -5,6 +5,7 @@ - * distribution for preciese wording. - * - * Copyright (c) 2003 America Online, Inc. All rights reserved. -+ * Copyright ........................... - */ - #include "globals.h" - -@@ -24,6 +25,7 @@ - #include <xmlsec/nss/crypto.h> - #include <xmlsec/nss/bignum.h> - #include <xmlsec/nss/pkikeys.h> -+#include <xmlsec/nss/tokens.h> - - /************************************************************************** - * -@@ -98,14 +100,13 @@ - { - xmlSecAssert(ctx != NULL); - if (ctx->privkey != NULL) { -- SECKEY_DestroyPrivateKey(ctx->privkey); -- ctx->privkey = NULL; -+ SECKEY_DestroyPrivateKey(ctx->privkey); -+ ctx->privkey = NULL; - } - -- if (ctx->pubkey) -- { -- SECKEY_DestroyPublicKey(ctx->pubkey); -- ctx->pubkey = NULL; -+ if (ctx->pubkey) { -+ SECKEY_DestroyPublicKey(ctx->pubkey); -+ ctx->pubkey = NULL; - } - - } -@@ -115,29 +116,32 @@ - xmlSecNssPKIKeyDataCtxPtr ctxSrc) - { - xmlSecNSSPKIKeyDataCtxFree(ctxDst); -+ ctxDst->privkey = NULL ; -+ ctxDst->pubkey = NULL ; - if (ctxSrc->privkey != NULL) { -- ctxDst->privkey = SECKEY_CopyPrivateKey(ctxSrc->privkey); -- if(ctxDst->privkey == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "SECKEY_CopyPrivateKey", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -+ ctxDst->privkey = SECKEY_CopyPrivateKey(ctxSrc->privkey); -+ if(ctxDst->privkey == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "SECKEY_CopyPrivateKey", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code=%d", PORT_GetError()); -+ return(-1); -+ } - } - - if (ctxSrc->pubkey != NULL) { -- ctxDst->pubkey = SECKEY_CopyPublicKey(ctxSrc->pubkey); -- if(ctxDst->pubkey == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "SECKEY_CopyPublicKey", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -+ ctxDst->pubkey = SECKEY_CopyPublicKey(ctxSrc->pubkey); -+ if(ctxDst->pubkey == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "SECKEY_CopyPublicKey", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code=%d", PORT_GetError()); -+ return(-1); -+ } - } -+ - return (0); - } - -@@ -147,20 +151,41 @@ - SECKEYPublicKey *pubkey) - { - xmlSecNssPKIKeyDataCtxPtr ctx; -+ KeyType pubType = nullKey ; -+ KeyType priType = nullKey ; - - xmlSecAssert2(xmlSecKeyDataIsValid(data), -1); - xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssPKIKeyDataSize), -1); - -+ if( privkey != NULL ) { -+ priType = SECKEY_GetPrivateKeyType( privkey ) ; -+ } -+ -+ if( pubkey != NULL ) { -+ pubType = SECKEY_GetPublicKeyType( pubkey ) ; -+ } -+ -+ if( priType != nullKey && pubType != nullKey ) { -+ if( pubType != priType ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ "different type of private and public key" ) ; -+ return -1 ; -+ } -+ } -+ - ctx = xmlSecNssPKIKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); - - if (ctx->privkey) { -- SECKEY_DestroyPrivateKey(ctx->privkey); -+ SECKEY_DestroyPrivateKey(ctx->privkey); - } - ctx->privkey = privkey; - - if (ctx->pubkey) { -- SECKEY_DestroyPublicKey(ctx->pubkey); -+ SECKEY_DestroyPublicKey(ctx->pubkey); - } - ctx->pubkey = pubkey; - -@@ -183,61 +208,75 @@ - { - xmlSecKeyDataPtr data = NULL; - int ret; -- KeyType kt; -- -- if (pubkey != NULL) { -- kt = SECKEY_GetPublicKeyType(pubkey); -- } else { -- kt = SECKEY_GetPrivateKeyType(privkey); -- pubkey = SECKEY_ConvertToPublicKey(privkey); -- } -+ KeyType pubType = nullKey ; -+ KeyType priType = nullKey ; - -- switch(kt) { -+ if( privkey != NULL ) { -+ priType = SECKEY_GetPrivateKeyType( privkey ) ; -+ } -+ -+ if( pubkey != NULL ) { -+ pubType = SECKEY_GetPublicKeyType( pubkey ) ; -+ } -+ -+ if( priType != nullKey && pubType != nullKey ) { -+ if( pubType != priType ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ "different type of private and public key" ) ; -+ return( NULL ) ; -+ } -+ } -+ -+ pubType = priType != nullKey ? priType : pubType ; -+ switch(pubType) { - #ifndef XMLSEC_NO_RSA - case rsaKey: -- data = xmlSecKeyDataCreate(xmlSecNssKeyDataRsaId); -- if(data == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecKeyDataCreate", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "xmlSecNssKeyDataRsaId"); -- return(NULL); -- } -- break; -+ data = xmlSecKeyDataCreate(xmlSecNssKeyDataRsaId); -+ if(data == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecKeyDataCreate", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "xmlSecNssKeyDataRsaId"); -+ return(NULL); -+ } -+ break; - #endif /* XMLSEC_NO_RSA */ - #ifndef XMLSEC_NO_DSA - case dsaKey: -- data = xmlSecKeyDataCreate(xmlSecNssKeyDataDsaId); -- if(data == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecKeyDataCreate", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "xmlSecNssKeyDataDsaId"); -- return(NULL); -- } -- break; -+ data = xmlSecKeyDataCreate(xmlSecNssKeyDataDsaId); -+ if(data == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecKeyDataCreate", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "xmlSecNssKeyDataDsaId"); -+ return(NULL); -+ } -+ break; - #endif /* XMLSEC_NO_DSA */ - default: -- xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - NULL, - XMLSEC_ERRORS_R_INVALID_TYPE, -- "PKI key type %d not supported", kt); -- return(NULL); -+ "PKI key type %d not supported", pubType); -+ return(NULL); - } - - xmlSecAssert2(data != NULL, NULL); - ret = xmlSecNssPKIKeyDataAdoptKey(data, privkey, pubkey); - if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecError(XMLSEC_ERRORS_HERE, - NULL, - "xmlSecNssPKIKeyDataAdoptKey", - XMLSEC_ERRORS_R_XMLSEC_FAILED, - XMLSEC_ERRORS_NO_MESSAGE); -- xmlSecKeyDataDestroy(data); -- return(NULL); -+ xmlSecKeyDataDestroy(data); -+ return(NULL); - } - return(data); - } -@@ -263,7 +302,7 @@ - xmlSecAssert2(ctx != NULL, NULL); - xmlSecAssert2(ctx->pubkey != NULL, NULL); - -- ret = SECKEY_CopyPublicKey(ctx->pubkey); -+ ret = SECKEY_CopyPublicKey(ctx->pubkey); - return(ret); - } - -@@ -312,9 +351,9 @@ - xmlSecAssert2(ctx != NULL, nullKey); - - if (ctx->pubkey != NULL) { -- kt = SECKEY_GetPublicKeyType(ctx->pubkey); -+ kt = SECKEY_GetPublicKeyType(ctx->pubkey); - } else { -- kt = SECKEY_GetPrivateKeyType(ctx->privkey); -+ kt = SECKEY_GetPrivateKeyType(ctx->privkey); - } - return(kt); - } -@@ -453,7 +492,11 @@ - static void xmlSecNssKeyDataDsaDebugXmlDump (xmlSecKeyDataPtr data, - FILE* output); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataDsaKlass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataDsaKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecNssPKIKeyDataSize, - -@@ -553,13 +596,13 @@ - goto done; - } - -- slot = PK11_GetBestSlot(CKM_DSA, NULL); -+ slot = xmlSecNssSlotGet(CKM_DSA); - if(slot == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "PK11_GetBestSlot", -+ "xmlSecNssSlotGet", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - ret = -1; - goto done; - } -@@ -570,7 +613,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "PORT_NewArena", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - ret = -1; - goto done; - } -@@ -582,7 +625,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "PORT_ArenaZAlloc", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - PORT_FreeArena(arena, PR_FALSE); - ret = -1; - goto done; -@@ -750,21 +793,21 @@ - goto done; - } - data = NULL; -- - ret = 0; - - done: - if (slot != NULL) { -- PK11_FreeSlot(slot); -+ PK11_FreeSlot(slot); - } -- if (ret != 0) { -- if (pubkey != NULL) { -- SECKEY_DestroyPublicKey(pubkey); -- } -- if (data != NULL) { -- xmlSecKeyDataDestroy(data); -- } -+ -+ if (pubkey != NULL) { -+ SECKEY_DestroyPublicKey(pubkey); -+ } -+ -+ if (data != NULL) { -+ xmlSecKeyDataDestroy(data); - } -+ - return(ret); - } - -@@ -783,7 +826,7 @@ - - ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key)); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1); -+/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/ - - if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) { - /* we can have only private key or public key */ -@@ -905,7 +948,8 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "PK11_PQG_ParamGen", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- "size=%d", sizeBits); -+ "size=%d, error code=%d", sizeBits, PORT_GetError()); -+ ret = -1; - goto done; - } - -@@ -915,11 +959,12 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "PK11_PQG_VerifyParams", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- "size=%d", sizeBits); -+ "size=%d, error code=%d", sizeBits, PORT_GetError()); -+ ret = -1; - goto done; - } - -- slot = PK11_GetBestSlot(CKM_DSA_KEY_PAIR_GEN, NULL); -+ slot = xmlSecNssSlotGet(CKM_DSA_KEY_PAIR_GEN); - PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */); - privkey = PK11_GenerateKeyPair(slot, CKM_DSA_KEY_PAIR_GEN, pqgParams, - &pubkey, PR_FALSE, PR_TRUE, NULL); -@@ -929,8 +974,9 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "PK11_GenerateKeyPair", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - -+ ret = -1; - goto done; - } - -@@ -943,29 +989,32 @@ - XMLSEC_ERRORS_NO_MESSAGE); - goto done; - } -- -+ privkey = NULL ; -+ pubkey = NULL ; - ret = 0; - - done: - if (slot != NULL) { -- PK11_FreeSlot(slot); -+ PK11_FreeSlot(slot); - } -+ - if (pqgParams != NULL) { -- PK11_PQG_DestroyParams(pqgParams); -+ PK11_PQG_DestroyParams(pqgParams); - } -+ - if (pqgVerify != NULL) { -- PK11_PQG_DestroyVerify(pqgVerify); -- } -- if (ret == 0) { -- return (0); -+ PK11_PQG_DestroyVerify(pqgVerify); - } -+ - if (pubkey != NULL) { -- SECKEY_DestroyPublicKey(pubkey); -+ SECKEY_DestroyPublicKey(pubkey); - } -+ - if (privkey != NULL) { -- SECKEY_DestroyPrivateKey(privkey); -+ SECKEY_DestroyPrivateKey(privkey); - } -- return(-1); -+ -+ return(ret); - } - - static xmlSecKeyDataType -@@ -975,11 +1024,11 @@ - xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), xmlSecKeyDataTypeUnknown); - ctx = xmlSecNssPKIKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1); -+/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/ - if (ctx->privkey != NULL) { -- return(xmlSecKeyDataTypePrivate | xmlSecKeyDataTypePublic); -- } else { -- return(xmlSecKeyDataTypePublic); -+ return(xmlSecKeyDataTypePrivate | xmlSecKeyDataTypePublic); -+ } else if( ctx->pubkey != NULL ) { -+ return(xmlSecKeyDataTypePublic); - } - - return(xmlSecKeyDataTypeUnknown); -@@ -992,7 +1041,7 @@ - xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), 0); - ctx = xmlSecNssPKIKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1); -+/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/ - - return(8 * SECKEY_PublicKeyStrength(ctx->pubkey)); - } -@@ -1084,7 +1133,11 @@ - static void xmlSecNssKeyDataRsaDebugXmlDump (xmlSecKeyDataPtr data, - FILE* output); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataRsaKlass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataRsaKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecNssPKIKeyDataSize, - -@@ -1181,13 +1234,13 @@ - goto done; - } - -- slot = PK11_GetBestSlot(CKM_RSA_PKCS, NULL); -+ slot = xmlSecNssSlotGet(CKM_RSA_PKCS); - if(slot == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "PK11_GetBestSlot", -+ "xmlSecNssSlotGet", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - ret = -1; - goto done; - } -@@ -1198,7 +1251,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "PORT_NewArena", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - ret = -1; - goto done; - } -@@ -1210,7 +1263,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), - "PORT_ArenaZAlloc", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - PORT_FreeArena(arena, PR_FALSE); - ret = -1; - goto done; -@@ -1349,7 +1402,7 @@ - - ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key)); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1); -+/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/ - - - if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) { -@@ -1420,7 +1473,7 @@ - params.keySizeInBits = sizeBits; - params.pe = 65537; - -- slot = PK11_GetBestSlot(CKM_RSA_PKCS_KEY_PAIR_GEN, NULL); -+ slot = xmlSecNssSlotGet(CKM_RSA_PKCS_KEY_PAIR_GEN); - PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */); - privkey = PK11_GenerateKeyPair(slot, CKM_RSA_PKCS_KEY_PAIR_GEN, ¶ms, - &pubkey, PR_FALSE, PR_TRUE, NULL); -@@ -1430,7 +1483,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "PK11_GenerateKeyPair", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - - goto done; - } -@@ -1472,7 +1525,7 @@ - - ctx = xmlSecNssPKIKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1); -+/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/ - if (ctx->privkey != NULL) { - return(xmlSecKeyDataTypePrivate | xmlSecKeyDataTypePublic); - } else { -@@ -1490,7 +1543,7 @@ - - ctx = xmlSecNssPKIKeyDataGetCtx(data); - xmlSecAssert2(ctx != NULL, -1); -- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1); -+/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/ - - return(8 * SECKEY_PublicKeyStrength(ctx->pubkey)); - } ---- misc/xmlsec1-1.2.6/src/nss/signatures.c 2003-09-26 02:58:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/signatures.c 2008-06-29 23:44:19.000000000 +0200 -@@ -199,7 +199,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "SGN_NewContext", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } else { -@@ -222,7 +222,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "VFY_CreateContext", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } -@@ -282,7 +282,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "VFY_Update, VFY_End", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - - if (PORT_GetError() == SEC_ERROR_PKCS7_BAD_SIGNATURE) { - xmlSecError(XMLSEC_ERRORS_HERE, -@@ -341,7 +341,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "SGN_Begin", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } else { -@@ -351,7 +351,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "VFY_Begin", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } -@@ -368,7 +368,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "SGN_Update", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } else { -@@ -378,7 +378,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "VFY_Update", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } -@@ -404,7 +404,7 @@ - xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), - "SGN_End", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -459,7 +459,11 @@ - * - ***************************************************************************/ - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssDsaSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecNssDsaSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecNssSignatureSize, /* xmlSecSize objSize */ -@@ -506,7 +510,11 @@ - * RSA-SHA1 signature transform - * - ***************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecTransformKlass xmlSecNssRsaSha1Klass = { -+#else - static xmlSecTransformKlass xmlSecNssRsaSha1Klass = { -+#endif - /* klass/object sizes */ - sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ - xmlSecNssSignatureSize, /* xmlSecSize objSize */ ---- misc/xmlsec1-1.2.6/src/nss/symkeys.c 2003-07-21 05:12:52.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/symkeys.c 2008-06-29 23:44:19.000000000 +0200 -@@ -15,178 +15,837 @@ - #include <stdio.h> - #include <string.h> - -+#include <pk11func.h> -+#include <nss.h> -+ - #include <xmlsec/xmlsec.h> - #include <xmlsec/xmltree.h> -+#include <xmlsec/base64.h> - #include <xmlsec/keys.h> - #include <xmlsec/keyinfo.h> - #include <xmlsec/transforms.h> - #include <xmlsec/errors.h> - - #include <xmlsec/nss/crypto.h> -+#include <xmlsec/nss/ciphers.h> -+#include <xmlsec/nss/tokens.h> - - /***************************************************************************** - * -- * Symmetic (binary) keys - just a wrapper for xmlSecKeyDataBinary -+ * Symmetic (binary) keys - a wrapper over slot information and PK11SymKey - * - ****************************************************************************/ --static int xmlSecNssSymKeyDataInitialize (xmlSecKeyDataPtr data); --static int xmlSecNssSymKeyDataDuplicate (xmlSecKeyDataPtr dst, -- xmlSecKeyDataPtr src); --static void xmlSecNssSymKeyDataFinalize (xmlSecKeyDataPtr data); --static int xmlSecNssSymKeyDataXmlRead (xmlSecKeyDataId id, -- xmlSecKeyPtr key, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssSymKeyDataXmlWrite (xmlSecKeyDataId id, -- xmlSecKeyPtr key, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssSymKeyDataBinRead (xmlSecKeyDataId id, -- xmlSecKeyPtr key, -- const xmlSecByte* buf, -- xmlSecSize bufSize, -- xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssSymKeyDataBinWrite (xmlSecKeyDataId id, -- xmlSecKeyPtr key, -- xmlSecByte** buf, -- xmlSecSize* bufSize, -- xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssSymKeyDataGenerate (xmlSecKeyDataPtr data, -- xmlSecSize sizeBits, -- xmlSecKeyDataType type); -- --static xmlSecKeyDataType xmlSecNssSymKeyDataGetType (xmlSecKeyDataPtr data); --static xmlSecSize xmlSecNssSymKeyDataGetSize (xmlSecKeyDataPtr data); --static void xmlSecNssSymKeyDataDebugDump (xmlSecKeyDataPtr data, -- FILE* output); --static void xmlSecNssSymKeyDataDebugXmlDump (xmlSecKeyDataPtr data, -- FILE* output); --static int xmlSecNssSymKeyDataKlassCheck (xmlSecKeyDataKlass* klass); -+typedef struct _xmlSecNssSymKeyDataCtx xmlSecNssSymKeyDataCtx ; -+typedef struct _xmlSecNssSymKeyDataCtx* xmlSecNssSymKeyDataCtxPtr ; -+ -+struct _xmlSecNssSymKeyDataCtx { -+ CK_MECHANISM_TYPE cipher ; /* the symmetic key mechanism */ -+ PK11SlotInfo* slot ; /* the key resident slot */ -+ PK11SymKey* symkey ; /* the symmetic key */ -+} ; -+ -+#define xmlSecNssSymKeyDataSize \ -+ ( sizeof( xmlSecKeyData ) + sizeof( xmlSecNssSymKeyDataCtx ) ) -+ -+#define xmlSecNssSymKeyDataGetCtx( data ) \ -+ ( ( xmlSecNssSymKeyDataCtxPtr )( ( ( xmlSecByte* )( data ) ) + sizeof( xmlSecKeyData ) ) ) -+ -+ -+static int xmlSecNssSymKeyDataInitialize (xmlSecKeyDataPtr data); -+static int xmlSecNssSymKeyDataDuplicate (xmlSecKeyDataPtr dst, -+ xmlSecKeyDataPtr src); -+static void xmlSecNssSymKeyDataFinalize (xmlSecKeyDataPtr data); -+static int xmlSecNssSymKeyDataXmlRead (xmlSecKeyDataId id, -+ xmlSecKeyPtr key, -+ xmlNodePtr node, -+ xmlSecKeyInfoCtxPtr keyInfoCtx); -+static int xmlSecNssSymKeyDataXmlWrite (xmlSecKeyDataId id, -+ xmlSecKeyPtr key, -+ xmlNodePtr node, -+ xmlSecKeyInfoCtxPtr keyInfoCtx); -+static int xmlSecNssSymKeyDataBinRead (xmlSecKeyDataId id, -+ xmlSecKeyPtr key, -+ const xmlSecByte* buf, -+ xmlSecSize bufSize, -+ xmlSecKeyInfoCtxPtr keyInfoCtx); -+static int xmlSecNssSymKeyDataBinWrite (xmlSecKeyDataId id, -+ xmlSecKeyPtr key, -+ xmlSecByte** buf, -+ xmlSecSize* bufSize, -+ xmlSecKeyInfoCtxPtr keyInfoCtx); -+static int xmlSecNssSymKeyDataGenerate (xmlSecKeyDataPtr data, -+ xmlSecSize sizeBits, -+ xmlSecKeyDataType type); -+ -+static xmlSecKeyDataType xmlSecNssSymKeyDataGetType (xmlSecKeyDataPtr data); -+static xmlSecSize xmlSecNssSymKeyDataGetSize (xmlSecKeyDataPtr data); -+static void xmlSecNssSymKeyDataDebugDump (xmlSecKeyDataPtr data, -+ FILE* output); -+static void xmlSecNssSymKeyDataDebugXmlDump (xmlSecKeyDataPtr data, -+ FILE* output); -+static int xmlSecNssSymKeyDataKlassCheck (xmlSecKeyDataKlass* klass); - - #define xmlSecNssSymKeyDataCheckId(data) \ - (xmlSecKeyDataIsValid((data)) && \ - xmlSecNssSymKeyDataKlassCheck((data)->id)) - -+/** -+ * xmlSecNssSymKeyDataAdoptKey: -+ * @data: the pointer to symmetric key data. -+ * @symkey: the symmetric key -+ * -+ * Set the value of symmetric key data. -+ * -+ * Returns 0 on success or a negative value if an error occurs. -+ */ -+int -+xmlSecNssSymKeyDataAdoptKey( -+ xmlSecKeyDataPtr data , -+ PK11SymKey* symkey -+) { -+ xmlSecNssSymKeyDataCtxPtr context = NULL ; -+ -+ xmlSecAssert2( xmlSecNssSymKeyDataCheckId( data ), -1 ) ; -+ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), -1 ) ; -+ xmlSecAssert2( symkey != NULL, -1 ) ; -+ -+ context = xmlSecNssSymKeyDataGetCtx( data ) ; -+ xmlSecAssert2(context != NULL, -1); -+ -+ context->cipher = PK11_GetMechanism( symkey ) ; -+ -+ if( context->slot != NULL ) { -+ PK11_FreeSlot( context->slot ) ; -+ context->slot = NULL ; -+ } -+ context->slot = PK11_GetSlotFromKey( symkey ) ; -+ -+ if( context->symkey != NULL ) { -+ PK11_FreeSymKey( context->symkey ) ; -+ context->symkey = NULL ; -+ } -+ context->symkey = PK11_ReferenceSymKey( symkey ) ; -+ -+ return 0 ; -+} -+ -+xmlSecKeyDataPtr xmlSecNssSymKeyDataKeyAdopt( -+ PK11SymKey* symKey -+) { -+ xmlSecKeyDataPtr data = NULL ; -+ CK_MECHANISM_TYPE mechanism = CKM_INVALID_MECHANISM ; -+ -+ xmlSecAssert2( symKey != NULL , NULL ) ; -+ -+ mechanism = PK11_GetMechanism( symKey ) ; -+ switch( mechanism ) { -+ case CKM_DES3_KEY_GEN : -+ case CKM_DES3_CBC : -+ case CKM_DES3_MAC : -+ data = xmlSecKeyDataCreate( xmlSecNssKeyDataDesId ) ; -+ if( data == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeyDataCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ "xmlSecNssKeyDataDesId" ) ; -+ return NULL ; -+ } -+ break ; -+ case CKM_AES_KEY_GEN : -+ case CKM_AES_CBC : -+ case CKM_AES_MAC : -+ data = xmlSecKeyDataCreate( xmlSecNssKeyDataAesId ) ; -+ if( data == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecKeyDataCreate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ "xmlSecNssKeyDataDesId" ) ; -+ return NULL ; -+ } -+ break ; -+ default : -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ "Unsupported mechanism" ) ; -+ return NULL ; -+ } -+ -+ if( xmlSecNssSymKeyDataAdoptKey( data , symKey ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ "xmlSecNssSymKeyDataAdoptKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecKeyDataDestroy( data ) ; -+ return NULL ; -+ } -+ -+ return data ; -+} -+ -+ -+PK11SymKey* -+xmlSecNssSymKeyDataGetKey( -+ xmlSecKeyDataPtr data -+) { -+ xmlSecNssSymKeyDataCtxPtr ctx; -+ PK11SymKey* symkey ; -+ -+ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), NULL); -+ xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize), NULL); -+ -+ ctx = xmlSecNssSymKeyDataGetCtx(data); -+ xmlSecAssert2(ctx != NULL, NULL); -+ -+ if( ctx->symkey != NULL ) { -+ symkey = PK11_ReferenceSymKey( ctx->symkey ) ; -+ } else { -+ symkey = NULL ; -+ } -+ -+ return(symkey); -+} -+ - static int - xmlSecNssSymKeyDataInitialize(xmlSecKeyDataPtr data) { -+ xmlSecNssSymKeyDataCtxPtr ctx; -+ - xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1); -- -- return(xmlSecKeyDataBinaryValueInitialize(data)); -+ xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize), -1); -+ -+ ctx = xmlSecNssSymKeyDataGetCtx(data); -+ xmlSecAssert2(ctx != NULL, -1); -+ -+ memset( ctx, 0, sizeof(xmlSecNssSymKeyDataCtx)); -+ -+ /* Set the block cipher mechanism */ -+#ifndef XMLSEC_NO_DES -+ if(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDesId)) { -+ ctx->cipher = CKM_DES3_KEY_GEN; -+ } else -+#endif /* XMLSEC_NO_DES */ -+ -+#ifndef XMLSEC_NO_AES -+ if(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDesId)) { -+ ctx->cipher = CKM_AES_KEY_GEN; -+ } else -+#endif /* XMLSEC_NO_AES */ -+ -+ if(1) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ "Unsupported block cipher" ) ; -+ return(-1) ; -+ } -+ -+ return(0); - } - - static int - xmlSecNssSymKeyDataDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) { -+ xmlSecNssSymKeyDataCtxPtr ctxDst; -+ xmlSecNssSymKeyDataCtxPtr ctxSrc; -+ - xmlSecAssert2(xmlSecNssSymKeyDataCheckId(dst), -1); -+ xmlSecAssert2(xmlSecKeyDataCheckSize(dst, xmlSecNssSymKeyDataSize), -1); - xmlSecAssert2(xmlSecNssSymKeyDataCheckId(src), -1); -+ xmlSecAssert2(xmlSecKeyDataCheckSize(src, xmlSecNssSymKeyDataSize), -1); - xmlSecAssert2(dst->id == src->id, -1); -- -- return(xmlSecKeyDataBinaryValueDuplicate(dst, src)); -+ -+ ctxDst = xmlSecNssSymKeyDataGetCtx(dst); -+ xmlSecAssert2(ctxDst != NULL, -1); -+ -+ ctxSrc = xmlSecNssSymKeyDataGetCtx(src); -+ xmlSecAssert2(ctxSrc != NULL, -1); -+ -+ ctxDst->cipher = ctxSrc->cipher ; -+ -+ if( ctxSrc->slot != NULL ) { -+ if( ctxDst->slot != NULL && ctxDst->slot != ctxSrc->slot ) { -+ PK11_FreeSlot( ctxDst->slot ) ; -+ ctxDst->slot = NULL ; -+ } -+ -+ if( ctxDst->slot == NULL && ctxSrc->slot != NULL ) -+ ctxDst->slot = PK11_ReferenceSlot( ctxSrc->slot ) ; -+ } else { -+ if( ctxDst->slot != NULL ) { -+ PK11_FreeSlot( ctxDst->slot ) ; -+ ctxDst->slot = NULL ; -+ } -+ } -+ -+ if( ctxSrc->symkey != NULL ) { -+ if( ctxDst->symkey != NULL && ctxDst->symkey != ctxSrc->symkey ) { -+ PK11_FreeSymKey( ctxDst->symkey ) ; -+ ctxDst->symkey = NULL ; -+ } -+ -+ if( ctxDst->symkey == NULL && ctxSrc->symkey != NULL ) -+ ctxDst->symkey = PK11_ReferenceSymKey( ctxSrc->symkey ) ; -+ } else { -+ if( ctxDst->symkey != NULL ) { -+ PK11_FreeSymKey( ctxDst->symkey ) ; -+ ctxDst->symkey = NULL ; -+ } -+ } -+ -+ return(0); - } - - static void - xmlSecNssSymKeyDataFinalize(xmlSecKeyDataPtr data) { -+ xmlSecNssSymKeyDataCtxPtr ctx; -+ - xmlSecAssert(xmlSecNssSymKeyDataCheckId(data)); -- -- xmlSecKeyDataBinaryValueFinalize(data); -+ xmlSecAssert(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize)); -+ -+ ctx = xmlSecNssSymKeyDataGetCtx(data); -+ xmlSecAssert(ctx != NULL); -+ -+ if( ctx->slot != NULL ) { -+ PK11_FreeSlot( ctx->slot ) ; -+ ctx->slot = NULL ; -+ } -+ -+ if( ctx->symkey != NULL ) { -+ PK11_FreeSymKey( ctx->symkey ) ; -+ ctx->symkey = NULL ; -+ } -+ -+ ctx->cipher = CKM_INVALID_MECHANISM ; - } - - static int - xmlSecNssSymKeyDataXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key, -- xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { -- xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); -+ xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { -+ PK11SymKey* symKey ; -+ PK11SlotInfo* slot ; -+ xmlSecBufferPtr keyBuf; -+ xmlSecSize len; -+ xmlSecKeyDataPtr data; -+ xmlSecNssSymKeyDataCtxPtr ctx; -+ SECItem keyItem ; -+ int ret; -+ -+ xmlSecAssert2(id != xmlSecKeyDataIdUnknown, -1); -+ xmlSecAssert2(key != NULL, -1); -+ xmlSecAssert2(node != NULL, -1); -+ xmlSecAssert2(keyInfoCtx != NULL, -1); -+ -+ /* Create a new KeyData from a id */ -+ data = xmlSecKeyDataCreate(id); -+ if(data == NULL ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeyDataCreate", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ ctx = xmlSecNssSymKeyDataGetCtx(data); -+ xmlSecAssert2(ctx != NULL, -1); -+ -+ /* Create a buffer for raw symmetric key value */ -+ if( ( keyBuf = xmlSecBufferCreate( 128 ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecBufferCreate" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ /* Read the raw key value */ -+ if( xmlSecBufferBase64NodeContentRead( keyBuf , node ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecBufferDestroy( keyBuf ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ /* Get slot */ -+ slot = xmlSecNssSlotGet(ctx->cipher); -+ if( slot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecNssSlotGet" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecBufferDestroy( keyBuf ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ /* Wrap the raw key value SECItem */ -+ keyItem.type = siBuffer ; -+ keyItem.data = xmlSecBufferGetData( keyBuf ) ; -+ keyItem.len = xmlSecBufferGetSize( keyBuf ) ; -+ -+ /* Import the raw key into slot temporalily and get the key handler*/ -+ symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginGenerated, CKA_VALUE, &keyItem, NULL ) ; -+ if( symKey == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "PK11_ImportSymKey" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ PK11_FreeSlot( slot ) ; -+ xmlSecBufferDestroy( keyBuf ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ PK11_FreeSlot( slot ) ; -+ -+ /* raw key material has been copied into symKey, it isn't used any more */ -+ xmlSecBufferDestroy( keyBuf ) ; - -- return(xmlSecKeyDataBinaryValueXmlRead(id, key, node, keyInfoCtx)); -+ /* Adopt the symmetric key into key data */ -+ ret = xmlSecNssSymKeyDataAdoptKey(data, symKey); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeyDataBinaryValueSetBuffer", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1); -+ } -+ /* symKey has been duplicated into data, it isn't used any more */ -+ PK11_FreeSymKey( symKey ) ; -+ -+ /* Check value */ -+ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), data) != 1) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeyReqMatchKeyValue", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlSecKeyDataDestroy( data ) ; -+ return(0); -+ } -+ -+ ret = xmlSecKeySetValue(key, data); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeySetValue", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1); -+ } -+ -+ return(0); - } - - static int - xmlSecNssSymKeyDataXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, -- xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { -+ xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { -+ PK11SymKey* symKey ; -+ - xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); -+ xmlSecAssert2(key != NULL, -1); -+ xmlSecAssert2(node != NULL, -1); -+ xmlSecAssert2(keyInfoCtx != NULL, -1); -+ -+ /* Get symmetric key from "key" */ -+ symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key)); -+ if( symKey != NULL ) { -+ SECItem* keyItem ; -+ xmlSecBufferPtr keyBuf ; -+ -+ /* Extract raw key data from symmetric key */ -+ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "PK11_ExtractKeyValue", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ -+ /* Get raw key data from "symKey" */ -+ keyItem = PK11_GetKeyData( symKey ) ; -+ if(keyItem == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "PK11_GetKeyData", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ -+ /* Create key data buffer with raw kwy material */ -+ keyBuf = xmlSecBufferCreate(keyItem->len) ; -+ if(keyBuf == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecBufferCreate", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ -+ xmlSecBufferSetData( keyBuf , keyItem->data , keyItem->len ) ; -+ -+ /* Write raw key material into current xml node */ -+ if( xmlSecBufferBase64NodeContentWrite( keyBuf, node, XMLSEC_BASE64_LINESIZE ) < 0 ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecBufferBase64NodeContentWrite", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlSecBufferDestroy(keyBuf); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ xmlSecBufferDestroy(keyBuf); -+ PK11_FreeSymKey( symKey ) ; -+ } - -- return(xmlSecKeyDataBinaryValueXmlWrite(id, key, node, keyInfoCtx)); -+ return 0 ; - } - - static int - xmlSecNssSymKeyDataBinRead(xmlSecKeyDataId id, xmlSecKeyPtr key, -- const xmlSecByte* buf, xmlSecSize bufSize, -- xmlSecKeyInfoCtxPtr keyInfoCtx) { -- xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); -+ const xmlSecByte* buf, xmlSecSize bufSize, -+ xmlSecKeyInfoCtxPtr keyInfoCtx) { -+ PK11SymKey* symKey ; -+ PK11SlotInfo* slot ; -+ xmlSecKeyDataPtr data; -+ xmlSecNssSymKeyDataCtxPtr ctx; -+ SECItem keyItem ; -+ int ret; - -- return(xmlSecKeyDataBinaryValueBinRead(id, key, buf, bufSize, keyInfoCtx)); -+ xmlSecAssert2(id != xmlSecKeyDataIdUnknown, -1); -+ xmlSecAssert2(key != NULL, -1); -+ xmlSecAssert2(buf != NULL, -1); -+ xmlSecAssert2(bufSize != 0, -1); -+ xmlSecAssert2(keyInfoCtx != NULL, -1); -+ -+ /* Create a new KeyData from a id */ -+ data = xmlSecKeyDataCreate(id); -+ if(data == NULL ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeyDataCreate", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } -+ -+ ctx = xmlSecNssSymKeyDataGetCtx(data); -+ xmlSecAssert2(ctx != NULL, -1); -+ -+ /* Get slot */ -+ slot = xmlSecNssSlotGet(ctx->cipher); -+ if( slot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecNssSlotGet" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ /* Wrap the raw key value SECItem */ -+ keyItem.type = siBuffer ; -+ keyItem.data = buf ; -+ keyItem.len = bufSize ; -+ -+ /* Import the raw key into slot temporalily and get the key handler*/ -+ symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginGenerated, CKA_VALUE, &keyItem, NULL ) ; -+ if( symKey == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "PK11_ImportSymKey" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSlot( slot ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1) ; -+ } -+ -+ /* Adopt the symmetric key into key data */ -+ ret = xmlSecNssSymKeyDataAdoptKey(data, symKey); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeyDataBinaryValueSetBuffer", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSymKey( symKey ) ; -+ PK11_FreeSlot( slot ) ; -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1); -+ } -+ /* symKey has been duplicated into data, it isn't used any more */ -+ PK11_FreeSymKey( symKey ) ; -+ PK11_FreeSlot( slot ) ; -+ -+ /* Check value */ -+ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), data) != 1) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeyReqMatchKeyValue", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlSecKeyDataDestroy( data ) ; -+ return(0); -+ } -+ -+ ret = xmlSecKeySetValue(key, data); -+ if(ret < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecKeySetValue", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ xmlSecKeyDataDestroy( data ) ; -+ return(-1); -+ } -+ -+ return(0); - } - - static int - xmlSecNssSymKeyDataBinWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, -- xmlSecByte** buf, xmlSecSize* bufSize, -- xmlSecKeyInfoCtxPtr keyInfoCtx) { -+ xmlSecByte** buf, xmlSecSize* bufSize, -+ xmlSecKeyInfoCtxPtr keyInfoCtx) { -+ PK11SymKey* symKey ; -+ - xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); -+ xmlSecAssert2(key != NULL, -1); -+ xmlSecAssert2(buf != NULL, -1); -+ xmlSecAssert2(bufSize != 0, -1); -+ xmlSecAssert2(keyInfoCtx != NULL, -1); -+ -+ /* Get symmetric key from "key" */ -+ symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key)); -+ if( symKey != NULL ) { -+ SECItem* keyItem ; -+ -+ /* Extract raw key data from symmetric key */ -+ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "PK11_ExtractKeyValue", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ -+ /* Get raw key data from "symKey" */ -+ keyItem = PK11_GetKeyData( symKey ) ; -+ if(keyItem == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "PK11_GetKeyData", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ -+ *bufSize = keyItem->len; -+ *buf = ( xmlSecByte* )xmlMalloc( *bufSize ); -+ if( *buf == NULL ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ NULL, -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ PK11_FreeSymKey( symKey ) ; -+ return(-1); -+ } -+ -+ memcpy((*buf), keyItem->data, (*bufSize)); -+ PK11_FreeSymKey( symKey ) ; -+ } - -- return(xmlSecKeyDataBinaryValueBinWrite(id, key, buf, bufSize, keyInfoCtx)); -+ return 0 ; - } - - static int - xmlSecNssSymKeyDataGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type ATTRIBUTE_UNUSED) { -- xmlSecBufferPtr buffer; -- -+ PK11SymKey* symkey ; -+ PK11SlotInfo* slot ; -+ xmlSecNssSymKeyDataCtxPtr ctx; -+ int ret; -+ - xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1); - xmlSecAssert2(sizeBits > 0, -1); - -- buffer = xmlSecKeyDataBinaryValueGetBuffer(data); -- xmlSecAssert2(buffer != NULL, -1); -- -- return(xmlSecNssGenerateRandom(buffer, (sizeBits + 7) / 8)); -+ ctx = xmlSecNssSymKeyDataGetCtx(data); -+ xmlSecAssert2(ctx != NULL, -1); -+ -+ if( sizeBits % 8 != 0 ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ NULL, -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "Symmetric key size must be octuple"); -+ return(-1); -+ } -+ -+ /* Get slot */ -+ slot = xmlSecNssSlotGet(ctx->cipher); -+ if( slot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ "xmlSecNssSlotGet" , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1) ; -+ } -+ -+ if( PK11_Authenticate( slot, PR_FALSE , NULL ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "PK11_Authenticate" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSlot( slot ) ; -+ return -1 ; -+ } -+ -+ symkey = PK11_KeyGen( slot , ctx->cipher , NULL , sizeBits/8 , NULL ) ; -+ if( symkey == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "PK11_KeyGen" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSlot( slot ) ; -+ return -1 ; -+ } -+ -+ if( ctx->slot != NULL ) { -+ PK11_FreeSlot( ctx->slot ) ; -+ ctx->slot = NULL ; -+ } -+ ctx->slot = slot ; -+ -+ if( ctx->symkey != NULL ) { -+ PK11_FreeSymKey( ctx->symkey ) ; -+ ctx->symkey = NULL ; -+ } -+ ctx->symkey = symkey ; -+ -+ return 0 ; - } - - static xmlSecKeyDataType - xmlSecNssSymKeyDataGetType(xmlSecKeyDataPtr data) { -- xmlSecBufferPtr buffer; -+ xmlSecNssSymKeyDataCtxPtr context = NULL ; -+ xmlSecKeyDataType type = xmlSecKeyDataTypeUnknown ; - - xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), xmlSecKeyDataTypeUnknown); -+ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), xmlSecKeyDataTypeUnknown ) ; - -- buffer = xmlSecKeyDataBinaryValueGetBuffer(data); -- xmlSecAssert2(buffer != NULL, xmlSecKeyDataTypeUnknown); -+ context = xmlSecNssSymKeyDataGetCtx( data ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "xmlSecNssSymKeyDataGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return xmlSecKeyDataTypeUnknown ; -+ } -+ -+ if( context->symkey != NULL ) { -+ type |= xmlSecKeyDataTypeSymmetric ; -+ } else { -+ type |= xmlSecKeyDataTypeUnknown ; -+ } - -- return((xmlSecBufferGetSize(buffer) > 0) ? xmlSecKeyDataTypeSymmetric : xmlSecKeyDataTypeUnknown); -+ return type ; - } - - static xmlSecSize - xmlSecNssSymKeyDataGetSize(xmlSecKeyDataPtr data) { -+ xmlSecNssSymKeyDataCtxPtr context ; -+ unsigned int length = 0 ; -+ - xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), 0); -- -- return(xmlSecKeyDataBinaryValueGetSize(data)); -+ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), 0 ) ; -+ -+ context = xmlSecNssSymKeyDataGetCtx( data ) ; -+ if( context == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "xmlSecNssSymKeyDataGetCtx" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return 0 ; -+ } -+ -+ if( context->symkey != NULL ) { -+ length = PK11_GetKeyLength( context->symkey ) ; -+ length *= 8 ; -+ } -+ -+ return length ; - } - - static void - xmlSecNssSymKeyDataDebugDump(xmlSecKeyDataPtr data, FILE* output) { - xmlSecAssert(xmlSecNssSymKeyDataCheckId(data)); - -- xmlSecKeyDataBinaryValueDebugDump(data, output); -+ /* print only size, everything else is sensitive */ -+ fprintf( output , "=== %s: size=%d\n" , data->id->dataNodeName , -+ xmlSecKeyDataGetSize(data)) ; - } - - static void - xmlSecNssSymKeyDataDebugXmlDump(xmlSecKeyDataPtr data, FILE* output) { - xmlSecAssert(xmlSecNssSymKeyDataCheckId(data)); - -- xmlSecKeyDataBinaryValueDebugXmlDump(data, output); -+ /* print only size, everything else is sensitive */ -+ fprintf( output , "<%s size=\"%d\" />\n" , data->id->dataNodeName , -+ xmlSecKeyDataGetSize(data)) ; - } - - static int - xmlSecNssSymKeyDataKlassCheck(xmlSecKeyDataKlass* klass) { - #ifndef XMLSEC_NO_DES - if(klass == xmlSecNssKeyDataDesId) { -- return(1); -+ return(1); - } - #endif /* XMLSEC_NO_DES */ - - #ifndef XMLSEC_NO_AES - if(klass == xmlSecNssKeyDataAesId) { -- return(1); -+ return(1); - } - #endif /* XMLSEC_NO_AES */ - - #ifndef XMLSEC_NO_HMAC - if(klass == xmlSecNssKeyDataHmacId) { -- return(1); -+ return(1); - } - #endif /* XMLSEC_NO_HMAC */ - -@@ -199,42 +858,46 @@ - * <xmlsec:AESKeyValue> processing - * - *************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataAesKlass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataAesKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), -- xmlSecKeyDataBinarySize, -+ xmlSecNssSymKeyDataSize, - - /* data */ - xmlSecNameAESKeyValue, - xmlSecKeyDataUsageKeyValueNode | xmlSecKeyDataUsageRetrievalMethodNodeXml, -- /* xmlSecKeyDataUsage usage; */ -- xmlSecHrefAESKeyValue, /* const xmlChar* href; */ -- xmlSecNodeAESKeyValue, /* const xmlChar* dataNodeName; */ -- xmlSecNs, /* const xmlChar* dataNodeNs; */ -+ /* xmlSecKeyDataUsage usage; */ -+ xmlSecHrefAESKeyValue, /* const xmlChar* href; */ -+ xmlSecNodeAESKeyValue, /* const xmlChar* dataNodeName; */ -+ xmlSecNs, /* const xmlChar* dataNodeNs; */ - - /* constructors/destructor */ -- xmlSecNssSymKeyDataInitialize, /* xmlSecKeyDataInitializeMethod initialize; */ -- xmlSecNssSymKeyDataDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */ -- xmlSecNssSymKeyDataFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */ -- xmlSecNssSymKeyDataGenerate, /* xmlSecKeyDataGenerateMethod generate; */ -+ xmlSecNssSymKeyDataInitialize, /* xmlSecKeyDataInitializeMethod initialize; */ -+ xmlSecNssSymKeyDataDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */ -+ xmlSecNssSymKeyDataFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */ -+ xmlSecNssSymKeyDataGenerate, /* xmlSecKeyDataGenerateMethod generate; */ - - /* get info */ -- xmlSecNssSymKeyDataGetType, /* xmlSecKeyDataGetTypeMethod getType; */ -- xmlSecNssSymKeyDataGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */ -- NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */ -+ xmlSecNssSymKeyDataGetType, /* xmlSecKeyDataGetTypeMethod getType; */ -+ xmlSecNssSymKeyDataGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */ -+ NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */ - - /* read/write */ -- xmlSecNssSymKeyDataXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */ -- xmlSecNssSymKeyDataXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */ -- xmlSecNssSymKeyDataBinRead, /* xmlSecKeyDataBinReadMethod binRead; */ -- xmlSecNssSymKeyDataBinWrite, /* xmlSecKeyDataBinWriteMethod binWrite; */ -+ xmlSecNssSymKeyDataXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */ -+ xmlSecNssSymKeyDataXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */ -+ xmlSecNssSymKeyDataBinRead, /* xmlSecKeyDataBinReadMethod binRead; */ -+ xmlSecNssSymKeyDataBinWrite, /* xmlSecKeyDataBinWriteMethod binWrite; */ - - /* debug */ -- xmlSecNssSymKeyDataDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */ -- xmlSecNssSymKeyDataDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */ -+ xmlSecNssSymKeyDataDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */ -+ xmlSecNssSymKeyDataDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */ - - /* reserved for the future */ -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ - }; - - /** -@@ -251,9 +914,9 @@ - - /** - * xmlSecNssKeyDataAesSet: -- * @data: the pointer to AES key data. -- * @buf: the pointer to key value. -- * @bufSize: the key value size (in bytes). -+ * @data: the pointer to AES key data. -+ * @buf: the pointer to key value. -+ * @bufSize: the key value size (in bytes). - * - * Sets the value of AES key data. - * -@@ -280,42 +943,46 @@ - * <xmlsec:DESKeyValue> processing - * - *************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataDesKlass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataDesKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), -- xmlSecKeyDataBinarySize, -+ xmlSecNssSymKeyDataSize, - - /* data */ - xmlSecNameDESKeyValue, - xmlSecKeyDataUsageKeyValueNode | xmlSecKeyDataUsageRetrievalMethodNodeXml, -- /* xmlSecKeyDataUsage usage; */ -- xmlSecHrefDESKeyValue, /* const xmlChar* href; */ -- xmlSecNodeDESKeyValue, /* const xmlChar* dataNodeName; */ -- xmlSecNs, /* const xmlChar* dataNodeNs; */ -+ /* xmlSecKeyDataUsage usage; */ -+ xmlSecHrefDESKeyValue, /* const xmlChar* href; */ -+ xmlSecNodeDESKeyValue, /* const xmlChar* dataNodeName; */ -+ xmlSecNs, /* const xmlChar* dataNodeNs; */ - - /* constructors/destructor */ -- xmlSecNssSymKeyDataInitialize, /* xmlSecKeyDataInitializeMethod initialize; */ -- xmlSecNssSymKeyDataDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */ -- xmlSecNssSymKeyDataFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */ -- xmlSecNssSymKeyDataGenerate, /* xmlSecKeyDataGenerateMethod generate; */ -+ xmlSecNssSymKeyDataInitialize, /* xmlSecKeyDataInitializeMethod initialize; */ -+ xmlSecNssSymKeyDataDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */ -+ xmlSecNssSymKeyDataFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */ -+ xmlSecNssSymKeyDataGenerate, /* xmlSecKeyDataGenerateMethod generate; */ - - /* get info */ -- xmlSecNssSymKeyDataGetType, /* xmlSecKeyDataGetTypeMethod getType; */ -- xmlSecNssSymKeyDataGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */ -- NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */ -+ xmlSecNssSymKeyDataGetType, /* xmlSecKeyDataGetTypeMethod getType; */ -+ xmlSecNssSymKeyDataGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */ -+ NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */ - - /* read/write */ -- xmlSecNssSymKeyDataXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */ -- xmlSecNssSymKeyDataXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */ -- xmlSecNssSymKeyDataBinRead, /* xmlSecKeyDataBinReadMethod binRead; */ -- xmlSecNssSymKeyDataBinWrite, /* xmlSecKeyDataBinWriteMethod binWrite; */ -+ xmlSecNssSymKeyDataXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */ -+ xmlSecNssSymKeyDataXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */ -+ xmlSecNssSymKeyDataBinRead, /* xmlSecKeyDataBinReadMethod binRead; */ -+ xmlSecNssSymKeyDataBinWrite, /* xmlSecKeyDataBinWriteMethod binWrite; */ - - /* debug */ -- xmlSecNssSymKeyDataDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */ -- xmlSecNssSymKeyDataDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */ -+ xmlSecNssSymKeyDataDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */ -+ xmlSecNssSymKeyDataDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */ - - /* reserved for the future */ -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ - }; - - /** -@@ -332,9 +999,9 @@ - - /** - * xmlSecNssKeyDataDesSet: -- * @data: the pointer to DES key data. -- * @buf: the pointer to key value. -- * @bufSize: the key value size (in bytes). -+ * @data: the pointer to DES key data. -+ * @buf: the pointer to key value. -+ * @bufSize: the key value size (in bytes). - * - * Sets the value of DES key data. - * -@@ -362,42 +1029,46 @@ - * <xmlsec:HMACKeyValue> processing - * - *************************************************************************/ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataHmacKlass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataHmacKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), -- xmlSecKeyDataBinarySize, -+ xmlSecNssSymKeyDataSize, - - /* data */ - xmlSecNameHMACKeyValue, - xmlSecKeyDataUsageKeyValueNode | xmlSecKeyDataUsageRetrievalMethodNodeXml, -- /* xmlSecKeyDataUsage usage; */ -- xmlSecHrefHMACKeyValue, /* const xmlChar* href; */ -- xmlSecNodeHMACKeyValue, /* const xmlChar* dataNodeName; */ -- xmlSecNs, /* const xmlChar* dataNodeNs; */ -+ /* xmlSecKeyDataUsage usage; */ -+ xmlSecHrefHMACKeyValue, /* const xmlChar* href; */ -+ xmlSecNodeHMACKeyValue, /* const xmlChar* dataNodeName; */ -+ xmlSecNs, /* const xmlChar* dataNodeNs; */ - - /* constructors/destructor */ -- xmlSecNssSymKeyDataInitialize, /* xmlSecKeyDataInitializeMethod initialize; */ -- xmlSecNssSymKeyDataDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */ -- xmlSecNssSymKeyDataFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */ -- xmlSecNssSymKeyDataGenerate, /* xmlSecKeyDataGenerateMethod generate; */ -+ xmlSecNssSymKeyDataInitialize, /* xmlSecKeyDataInitializeMethod initialize; */ -+ xmlSecNssSymKeyDataDuplicate, /* xmlSecKeyDataDuplicateMethod duplicate; */ -+ xmlSecNssSymKeyDataFinalize, /* xmlSecKeyDataFinalizeMethod finalize; */ -+ xmlSecNssSymKeyDataGenerate, /* xmlSecKeyDataGenerateMethod generate; */ - - /* get info */ -- xmlSecNssSymKeyDataGetType, /* xmlSecKeyDataGetTypeMethod getType; */ -- xmlSecNssSymKeyDataGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */ -- NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */ -+ xmlSecNssSymKeyDataGetType, /* xmlSecKeyDataGetTypeMethod getType; */ -+ xmlSecNssSymKeyDataGetSize, /* xmlSecKeyDataGetSizeMethod getSize; */ -+ NULL, /* xmlSecKeyDataGetIdentifier getIdentifier; */ - - /* read/write */ -- xmlSecNssSymKeyDataXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */ -- xmlSecNssSymKeyDataXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */ -- xmlSecNssSymKeyDataBinRead, /* xmlSecKeyDataBinReadMethod binRead; */ -- xmlSecNssSymKeyDataBinWrite, /* xmlSecKeyDataBinWriteMethod binWrite; */ -+ xmlSecNssSymKeyDataXmlRead, /* xmlSecKeyDataXmlReadMethod xmlRead; */ -+ xmlSecNssSymKeyDataXmlWrite, /* xmlSecKeyDataXmlWriteMethod xmlWrite; */ -+ xmlSecNssSymKeyDataBinRead, /* xmlSecKeyDataBinReadMethod binRead; */ -+ xmlSecNssSymKeyDataBinWrite, /* xmlSecKeyDataBinWriteMethod binWrite; */ - - /* debug */ -- xmlSecNssSymKeyDataDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */ -- xmlSecNssSymKeyDataDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */ -+ xmlSecNssSymKeyDataDebugDump, /* xmlSecKeyDataDebugDumpMethod debugDump; */ -+ xmlSecNssSymKeyDataDebugXmlDump, /* xmlSecKeyDataDebugDumpMethod debugXmlDump; */ - - /* reserved for the future */ -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ - }; - - /** -@@ -414,9 +1085,9 @@ - - /** - * xmlSecNssKeyDataHmacSet: -- * @data: the pointer to HMAC key data. -- * @buf: the pointer to key value. -- * @bufSize: the key value size (in bytes). -+ * @data: the pointer to HMAC key data. -+ * @buf: the pointer to key value. -+ * @bufSize: the key value size (in bytes). - * - * Sets the value of HMAC key data. - * ---- misc/xmlsec1-1.2.6/src/nss/tokens.c 2008-06-29 23:44:40.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/tokens.c 2008-06-29 23:44:19.000000000 +0200 -@@ -1 +1,548 @@ --dummy -+/** -+ * XMLSec library -+ * -+ * This is free software; see Copyright file in the source -+ * distribution for preciese wording. -+ * -+ * Copyright.................................. -+ * -+ * Contributor(s): _____________________________ -+ * -+ */ -+ -+/** -+ * In order to ensure that particular crypto operation is performed on -+ * particular crypto device, a subclass of xmlSecList is used to store slot and -+ * mechanism information. -+ * -+ * In the list, a slot is bound with a mechanism. If the mechanism is available, -+ * this mechanism only can perform on the slot; otherwise, it can perform on -+ * every eligibl slot in the list. -+ * -+ * When try to find a slot for a particular mechanism, the slot bound with -+ * avaliable mechanism will be looked up firstly. -+ */ -+#include "globals.h" -+#include <string.h> -+ -+#include <xmlsec/xmlsec.h> -+#include <xmlsec/errors.h> -+#include <xmlsec/list.h> -+ -+#include <xmlsec/nss/tokens.h> -+ -+int -+xmlSecNssKeySlotSetMechList( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE_PTR mechanismList -+) { -+ int counter ; -+ -+ xmlSecAssert2( keySlot != NULL , -1 ) ; -+ -+ if( keySlot->mechanismList != CK_NULL_PTR ) { -+ xmlFree( keySlot->mechanismList ) ; -+ -+ for( counter = 0 ; *( mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ; -+ keySlot->mechanismList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ; -+ if( keySlot->mechanismList == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ); -+ } -+ for( ; counter >= 0 ; counter -- ) -+ *( keySlot->mechanismList + counter ) = *( mechanismList + counter ) ; -+ } -+ -+ return( 0 ); -+} -+ -+int -+xmlSecNssKeySlotEnableMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE mechanism -+) { -+ int counter ; -+ CK_MECHANISM_TYPE_PTR newList ; -+ -+ xmlSecAssert2( keySlot != NULL , -1 ) ; -+ -+ if( mechanism != CKM_INVALID_MECHANISM ) { -+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ; -+ newList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ; -+ if( newList == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ); -+ } -+ *( newList + counter + 1 ) = CKM_INVALID_MECHANISM ; -+ *( newList + counter ) = mechanism ; -+ for( counter -= 1 ; counter >= 0 ; counter -- ) -+ *( newList + counter ) = *( keySlot->mechanismList + counter ) ; -+ -+ xmlFree( keySlot->mechanismList ) ; -+ keySlot->mechanismList = newList ; -+ } -+ -+ return(0); -+} -+ -+int -+xmlSecNssKeySlotDisableMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE mechanism -+) { -+ int counter ; -+ -+ xmlSecAssert2( keySlot != NULL , -1 ) ; -+ -+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) { -+ if( *( keySlot->mechanismList + counter ) == mechanism ) { -+ for( ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) { -+ *( keySlot->mechanismList + counter ) = *( keySlot->mechanismList + counter + 1 ) ; -+ } -+ -+ break ; -+ } -+ } -+ -+ return(0); -+} -+ -+CK_MECHANISM_TYPE_PTR -+xmlSecNssKeySlotGetMechList( -+ xmlSecNssKeySlotPtr keySlot -+) { -+ if( keySlot != NULL ) -+ return keySlot->mechanismList ; -+ else -+ return NULL ; -+} -+ -+int -+xmlSecNssKeySlotSetSlot( -+ xmlSecNssKeySlotPtr keySlot , -+ PK11SlotInfo* slot -+) { -+ xmlSecAssert2( keySlot != NULL , -1 ) ; -+ -+ if( slot != NULL && keySlot->slot != slot ) { -+ if( keySlot->slot != NULL ) -+ PK11_FreeSlot( keySlot->slot ) ; -+ -+ if( keySlot->mechanismList != NULL ) { -+ xmlFree( keySlot->mechanismList ) ; -+ keySlot->mechanismList = NULL ; -+ } -+ -+ keySlot->slot = PK11_ReferenceSlot( slot ) ; -+ } -+ -+ return(0); -+} -+ -+int -+xmlSecNssKeySlotInitialize( -+ xmlSecNssKeySlotPtr keySlot , -+ PK11SlotInfo* slot -+) { -+ xmlSecAssert2( keySlot != NULL , -1 ) ; -+ xmlSecAssert2( keySlot->slot == NULL , -1 ) ; -+ xmlSecAssert2( keySlot->mechanismList == NULL , -1 ) ; -+ -+ if( slot != NULL ) { -+ keySlot->slot = PK11_ReferenceSlot( slot ) ; -+ } -+ -+ return(0); -+} -+ -+void -+xmlSecNssKeySlotFinalize( -+ xmlSecNssKeySlotPtr keySlot -+) { -+ xmlSecAssert( keySlot != NULL ) ; -+ -+ if( keySlot->mechanismList != NULL ) { -+ xmlFree( keySlot->mechanismList ) ; -+ keySlot->mechanismList = NULL ; -+ } -+ -+ if( keySlot->slot != NULL ) { -+ PK11_FreeSlot( keySlot->slot ) ; -+ keySlot->slot = NULL ; -+ } -+ -+} -+ -+PK11SlotInfo* -+xmlSecNssKeySlotGetSlot( -+ xmlSecNssKeySlotPtr keySlot -+) { -+ if( keySlot != NULL ) -+ return keySlot->slot ; -+ else -+ return NULL ; -+} -+ -+xmlSecNssKeySlotPtr -+xmlSecNssKeySlotCreate() { -+ xmlSecNssKeySlotPtr keySlot ; -+ -+ /* Allocates a new xmlSecNssKeySlot and fill the fields */ -+ keySlot = ( xmlSecNssKeySlotPtr )xmlMalloc( sizeof( xmlSecNssKeySlot ) ) ; -+ if( keySlot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( NULL ); -+ } -+ memset( keySlot, 0, sizeof( xmlSecNssKeySlot ) ) ; -+ -+ return( keySlot ) ; -+} -+ -+int -+xmlSecNssKeySlotCopy( -+ xmlSecNssKeySlotPtr newKeySlot , -+ xmlSecNssKeySlotPtr keySlot -+) { -+ CK_MECHANISM_TYPE_PTR mech ; -+ int counter ; -+ -+ xmlSecAssert2( newKeySlot != NULL , -1 ) ; -+ xmlSecAssert2( keySlot != NULL , -1 ) ; -+ -+ if( keySlot->slot != NULL && newKeySlot->slot != keySlot->slot ) { -+ if( newKeySlot->slot != NULL ) -+ PK11_FreeSlot( newKeySlot->slot ) ; -+ -+ newKeySlot->slot = PK11_ReferenceSlot( keySlot->slot ) ; -+ } -+ -+ if( keySlot->mechanismList != CK_NULL_PTR ) { -+ xmlFree( newKeySlot->mechanismList ) ; -+ -+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ; -+ newKeySlot->mechanismList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ; -+ if( newKeySlot->mechanismList == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ); -+ } -+ for( ; counter >= 0 ; counter -- ) -+ *( newKeySlot->mechanismList + counter ) = *( keySlot->mechanismList + counter ) ; -+ } -+ -+ return( 0 ); -+} -+ -+xmlSecNssKeySlotPtr -+xmlSecNssKeySlotDuplicate( -+ xmlSecNssKeySlotPtr keySlot -+) { -+ xmlSecNssKeySlotPtr newKeySlot ; -+ int ret ; -+ -+ xmlSecAssert2( keySlot != NULL , NULL ) ; -+ -+ newKeySlot = xmlSecNssKeySlotCreate() ; -+ if( newKeySlot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( NULL ); -+ } -+ -+ if( xmlSecNssKeySlotCopy( newKeySlot, keySlot ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( NULL ); -+ } -+ -+ return( newKeySlot ); -+} -+ -+void -+xmlSecNssKeySlotDestroy( -+ xmlSecNssKeySlotPtr keySlot -+) { -+ xmlSecAssert( keySlot != NULL ) ; -+ -+ if( keySlot->mechanismList != NULL ) -+ xmlFree( keySlot->mechanismList ) ; -+ -+ if( keySlot->slot != NULL ) -+ PK11_FreeSlot( keySlot->slot ) ; -+ -+ xmlFree( keySlot ) ; -+} -+ -+int -+xmlSecNssKeySlotBindMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE type -+) { -+ int counter ; -+ -+ xmlSecAssert2( keySlot != NULL , 0 ) ; -+ xmlSecAssert2( keySlot->slot != NULL , 0 ) ; -+ xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ; -+ -+ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) { -+ if( *( keySlot->mechanismList + counter ) == type ) -+ return(1) ; -+ } -+ -+ return( 0 ) ; -+} -+ -+int -+xmlSecNssKeySlotSupportMech( -+ xmlSecNssKeySlotPtr keySlot , -+ CK_MECHANISM_TYPE type -+) { -+ xmlSecAssert2( keySlot != NULL , 0 ) ; -+ xmlSecAssert2( keySlot->slot != NULL , 0 ) ; -+ xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ; -+ -+ if( PK11_DoesMechanism( keySlot->slot , type ) == PR_TRUE ) { -+ return(1); -+ } else -+ return(0); -+} -+ -+void -+xmlSecNssKeySlotDebugDump( -+ xmlSecNssKeySlotPtr keySlot , -+ FILE* output -+) { -+ xmlSecAssert( keySlot != NULL ) ; -+ xmlSecAssert( output != NULL ) ; -+ -+ fprintf( output, "== KEY SLOT\n" ); -+} -+ -+void -+xmlSecNssKeySlotDebugXmlDump( -+ xmlSecNssKeySlotPtr keySlot , -+ FILE* output -+) { -+} -+ -+/** -+ * Key Slot List -+ */ -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecPtrListKlass xmlSecNssKeySlotPtrListKlass = { -+#else -+static xmlSecPtrListKlass xmlSecNssKeySlotPtrListKlass = { -+#endif -+ BAD_CAST "mechanism-list", -+ (xmlSecPtrDuplicateItemMethod)xmlSecNssKeySlotDuplicate, -+ (xmlSecPtrDestroyItemMethod)xmlSecNssKeySlotDestroy, -+ (xmlSecPtrDebugDumpItemMethod)xmlSecNssKeySlotDebugDump, -+ (xmlSecPtrDebugDumpItemMethod)xmlSecNssKeySlotDebugXmlDump, -+}; -+ -+xmlSecPtrListId -+xmlSecNssKeySlotListGetKlass(void) { -+ return(&xmlSecNssKeySlotPtrListKlass); -+} -+ -+ -+/*- -+ * Global PKCS#11 crypto token repository -- Key slot list -+ */ -+static xmlSecPtrListPtr _xmlSecNssKeySlotList = NULL ; -+ -+PK11SlotInfo* -+xmlSecNssSlotGet( -+ CK_MECHANISM_TYPE type -+) { -+ PK11SlotInfo* slot = NULL ; -+ xmlSecNssKeySlotPtr keySlot ; -+ xmlSecSize ksSize ; -+ xmlSecSize ksPos ; -+ char flag ; -+ -+ if( _xmlSecNssKeySlotList == NULL ) { -+ slot = PK11_GetBestSlot( type , NULL ) ; -+ } else { -+ ksSize = xmlSecPtrListGetSize( _xmlSecNssKeySlotList ) ; -+ -+ /*- -+ * Firstly, checking whether the mechanism is bound with a special slot. -+ * If no bound slot, we try to find the first eligible slot in the list. -+ */ -+ for( flag = 0, ksPos = 0 ; ksPos < ksSize ; ksPos ++ ) { -+ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( _xmlSecNssKeySlotList, ksPos ) ; -+ if( keySlot != NULL && xmlSecNssKeySlotBindMech( keySlot, type ) ) { -+ slot = xmlSecNssKeySlotGetSlot( keySlot ) ; -+ flag = 2 ; -+ } else if( flag == 0 && xmlSecNssKeySlotSupportMech( keySlot, type ) ) { -+ slot = xmlSecNssKeySlotGetSlot( keySlot ) ; -+ flag = 1 ; -+ } -+ -+ if( flag == 2 ) -+ break ; -+ } -+ if( slot != NULL ) -+ slot = PK11_ReferenceSlot( slot ) ; -+ } -+ -+ if( slot != NULL && PK11_NeedLogin( slot ) ) { -+ if( PK11_Authenticate( slot , PR_TRUE , NULL ) != SECSuccess ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ PK11_FreeSlot( slot ) ; -+ return( NULL ); -+ } -+ } -+ -+ return slot ; -+} -+ -+int -+xmlSecNssSlotInitialize( -+ void -+) { -+ if( _xmlSecNssKeySlotList != NULL ) { -+ xmlSecPtrListDestroy( _xmlSecNssKeySlotList ) ; -+ _xmlSecNssKeySlotList = NULL ; -+ } -+ -+ _xmlSecNssKeySlotList = xmlSecPtrListCreate( xmlSecNssKeySlotListId ) ; -+ if( _xmlSecNssKeySlotList == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return( -1 ); -+ } -+ -+ return(0); -+} -+ -+void -+xmlSecNssSlotShutdown( -+ void -+) { -+ if( _xmlSecNssKeySlotList != NULL ) { -+ xmlSecPtrListDestroy( _xmlSecNssKeySlotList ) ; -+ _xmlSecNssKeySlotList = NULL ; -+ } -+} -+ -+int -+xmlSecNssSlotAdopt( -+ PK11SlotInfo* slot, -+ CK_MECHANISM_TYPE type -+) { -+ xmlSecNssKeySlotPtr keySlot ; -+ xmlSecSize ksSize ; -+ xmlSecSize ksPos ; -+ char flag ; -+ -+ xmlSecAssert2( _xmlSecNssKeySlotList != NULL, -1 ) ; -+ xmlSecAssert2( slot != NULL, -1 ) ; -+ -+ ksSize = xmlSecPtrListGetSize( _xmlSecNssKeySlotList ) ; -+ -+ /*- -+ * Firstly, checking whether the slot is in the repository already. -+ */ -+ flag = 0 ; -+ for( ksPos = 0 ; ksPos < ksSize ; ksPos ++ ) { -+ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( _xmlSecNssKeySlotList, ksPos ) ; -+ /* If find the slot in the list */ -+ if( keySlot != NULL && xmlSecNssKeySlotGetSlot( keySlot ) == slot ) { -+ /* If mechnism type is valid, bind the slot with the mechanism */ -+ if( type != CKM_INVALID_MECHANISM ) { -+ if( xmlSecNssKeySlotEnableMech( keySlot, type ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ } -+ -+ flag = 1 ; -+ } -+ } -+ -+ /* If the slot do not in the list, add a new item to the list */ -+ if( flag == 0 ) { -+ /* Create a new KeySlot */ -+ keySlot = xmlSecNssKeySlotCreate() ; -+ if( keySlot == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return(-1); -+ } -+ -+ /* Initialize the keySlot with a slot */ -+ if( xmlSecNssKeySlotInitialize( keySlot, slot ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecNssKeySlotDestroy( keySlot ) ; -+ return(-1); -+ } -+ -+ /* If mechnism type is valid, bind the slot with the mechanism */ -+ if( type != CKM_INVALID_MECHANISM ) { -+ if( xmlSecNssKeySlotEnableMech( keySlot, type ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecNssKeySlotDestroy( keySlot ) ; -+ return(-1); -+ } -+ } -+ -+ /* Add keySlot into the list */ -+ if( xmlSecPtrListAdd( _xmlSecNssKeySlotList, keySlot ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ NULL , -+ NULL , -+ XMLSEC_ERRORS_R_XMLSEC_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ xmlSecNssKeySlotDestroy( keySlot ) ; -+ return(-1); -+ } -+ } -+ -+ return(0); -+} -+ ---- misc/xmlsec1-1.2.6/src/nss/x509.c 2003-09-26 05:53:09.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/x509.c 2008-06-29 23:44:19.000000000 +0200 -@@ -34,7 +34,6 @@ - #include <xmlsec/keys.h> - #include <xmlsec/keyinfo.h> - #include <xmlsec/keysmngr.h> --#include <xmlsec/x509.h> - #include <xmlsec/base64.h> - #include <xmlsec/errors.h> - -@@ -61,37 +60,21 @@ - static int xmlSecNssX509CertificateNodeRead (xmlSecKeyDataPtr data, - xmlNodePtr node, - xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssX509CertificateNodeWrite (CERTCertificate* cert, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); - static int xmlSecNssX509SubjectNameNodeRead (xmlSecKeyDataPtr data, - xmlNodePtr node, - xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssX509SubjectNameNodeWrite (CERTCertificate* cert, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); - static int xmlSecNssX509IssuerSerialNodeRead (xmlSecKeyDataPtr data, - xmlNodePtr node, - xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssX509IssuerSerialNodeWrite (CERTCertificate* cert, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); - static int xmlSecNssX509SKINodeRead (xmlSecKeyDataPtr data, - xmlNodePtr node, - xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssX509SKINodeWrite (CERTCertificate* cert, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); - static int xmlSecNssX509CRLNodeRead (xmlSecKeyDataPtr data, - xmlNodePtr node, - xmlSecKeyInfoCtxPtr keyInfoCtx); --static int xmlSecNssX509CRLNodeWrite (CERTSignedCrl* crl, -- xmlNodePtr node, -- xmlSecKeyInfoCtxPtr keyInfoCtx); - static int xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data, - xmlSecKeyPtr key, - xmlSecKeyInfoCtxPtr keyInfoCtx); -- - static CERTCertificate* xmlSecNssX509CertDerRead (const xmlSecByte* buf, - xmlSecSize size); - static CERTCertificate* xmlSecNssX509CertBase64DerRead (xmlChar* buf); -@@ -104,9 +87,6 @@ - xmlSecKeyInfoCtxPtr keyInfoCtx); - static xmlChar* xmlSecNssX509CrlBase64DerWrite (CERTSignedCrl* crl, - int base64LineWrap); --static xmlChar* xmlSecNssX509NameWrite (CERTName* nm); --static xmlChar* xmlSecNssASN1IntegerWrite (SECItem *num); --static xmlChar* xmlSecNssX509SKIWrite (CERTCertificate* cert); - static void xmlSecNssX509CertDebugDump (CERTCertificate* cert, - FILE* output); - static void xmlSecNssX509CertDebugXmlDump (CERTCertificate* cert, -@@ -254,7 +234,11 @@ - - - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataX509Klass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataX509Klass = { -+#endif - sizeof(xmlSecKeyDataKlass), - xmlSecNssX509DataSize, - -@@ -378,7 +362,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "CERT_NewCertList", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - } -@@ -389,7 +373,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "CERT_AddCertToListTail", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - ctx->numCerts++; -@@ -588,7 +572,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)), - "CERT_DupCertificate", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -627,7 +611,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)), - "SEC_DupCrl", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -@@ -652,7 +636,7 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(dst)), - "CERT_DupCertificate", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - ret = xmlSecNssKeyDataX509AdoptKeyCert(dst, certDst); -@@ -752,31 +736,22 @@ - xmlSecNssKeyDataX509XmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, - xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlSecKeyDataPtr data; -+ xmlNodePtr cur; -+ xmlChar* buf; - CERTCertificate* cert; - CERTSignedCrl* crl; - xmlSecSize size, pos; -- int content = 0; -- int ret; - - xmlSecAssert2(id == xmlSecNssKeyDataX509Id, -1); - xmlSecAssert2(key != NULL, -1); - xmlSecAssert2(node != NULL, -1); - xmlSecAssert2(keyInfoCtx != NULL, -1); - -- content = xmlSecX509DataGetNodeContent (node, 1, keyInfoCtx); -- if (content < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecX509DataGetNodeContent", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "content=%d", content); -- return(-1); -- } else if(content == 0) { -- /* by default we are writing certificates and crls */ -- content = XMLSEC_X509DATA_DEFAULT; -+ /* todo: flag in ctx remove all existing content */ -+ if(0) { -+ xmlNodeSetContent(node, NULL); - } - -- /* get x509 data */ - data = xmlSecKeyGetData(key, id); - if(data == NULL) { - /* no x509 data in the key */ -@@ -795,80 +770,75 @@ - "pos=%d", pos); - return(-1); - } -- -- if((content & XMLSEC_X509DATA_CERTIFICATE_NODE) != 0) { -- ret = xmlSecNssX509CertificateNodeWrite(cert, node, keyInfoCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecNssX509CertificateNodeWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "pos=%d", pos); -- return(-1); -- } -+ -+ /* set base64 lines size from context */ -+ buf = xmlSecNssX509CertBase64DerWrite(cert, keyInfoCtx->base64LineSize); -+ if(buf == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecNssX509CertBase64DerWrite", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); - } -- -- if((content & XMLSEC_X509DATA_SUBJECTNAME_NODE) != 0) { -- ret = xmlSecNssX509SubjectNameNodeWrite(cert, node, keyInfoCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecNssX509SubjectNameNodeWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "pos=%d", pos); -- return(-1); -- } -+ -+ cur = xmlSecAddChild(node, xmlSecNodeX509Certificate, xmlSecDSigNs); -+ if(cur == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecAddChild", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "node=%s", -+ xmlSecErrorsSafeString(xmlSecNodeX509Certificate)); -+ xmlFree(buf); -+ return(-1); - } -+ /* todo: add \n around base64 data - from context */ -+ /* todo: add errors check */ -+ xmlNodeSetContent(cur, xmlSecStringCR); -+ xmlNodeSetContent(cur, buf); -+ xmlFree(buf); -+ } - -- if((content & XMLSEC_X509DATA_ISSUERSERIAL_NODE) != 0) { -- ret = xmlSecNssX509IssuerSerialNodeWrite(cert, node, keyInfoCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecNssX509IssuerSerialNodeWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "pos=%d", pos); -- return(-1); -- } -- } -+ /* write crls */ -+ size = xmlSecNssKeyDataX509GetCrlsSize(data); -+ for(pos = 0; pos < size; ++pos) { -+ crl = xmlSecNssKeyDataX509GetCrl(data, pos); -+ if(crl == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecNssKeyDataX509GetCrl", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "pos=%d", pos); -+ return(-1); -+ } - -- if((content & XMLSEC_X509DATA_SKI_NODE) != 0) { -- ret = xmlSecNssX509SKINodeWrite(cert, node, keyInfoCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecNssX509SKINodeWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "pos=%d", pos); -- return(-1); -- } -- } -- } -+ /* set base64 lines size from context */ -+ buf = xmlSecNssX509CrlBase64DerWrite(crl, keyInfoCtx->base64LineSize); -+ if(buf == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecNssX509CrlBase64DerWrite", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); -+ } - -- /* write crls if needed */ -- if((content & XMLSEC_X509DATA_CRL_NODE) != 0) { -- size = xmlSecNssKeyDataX509GetCrlsSize(data); -- for(pos = 0; pos < size; ++pos) { -- crl = xmlSecNssKeyDataX509GetCrl(data, pos); -- if(crl == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecNssKeyDataX509GetCrl", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "pos=%d", pos); -- return(-1); -- } -- -- ret = xmlSecNssX509CRLNodeWrite(crl, node, keyInfoCtx); -- if(ret < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -- "xmlSecNssX509CRLNodeWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "pos=%d", pos); -- return(-1); -- } -- } -+ cur = xmlSecAddChild(node, xmlSecNodeX509CRL, xmlSecDSigNs); -+ if(cur == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), -+ "xmlSecAddChild", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "new_node=%s", -+ xmlSecErrorsSafeString(xmlSecNodeX509CRL)); -+ xmlFree(buf); -+ return(-1); -+ } -+ /* todo: add \n around base64 data - from context */ -+ /* todo: add errors check */ -+ xmlNodeSetContent(cur, xmlSecStringCR); -+ xmlNodeSetContent(cur, buf); - } - - return(0); -@@ -1015,19 +985,13 @@ - xmlSecAssert2(keyInfoCtx != NULL, -1); - - content = xmlNodeGetContent(node); -- if((content == NULL) || (xmlSecIsEmptyString(content) == 1)) { -- if(content != NULL) { -- xmlFree(content); -- } -- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -- xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -- XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- return(0); -+ if(content == NULL){ -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -+ XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); - } - - cert = xmlSecNssX509CertBase64DerRead(content); -@@ -1057,46 +1021,6 @@ - return(0); - } - --static int --xmlSecNssX509CertificateNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { -- xmlChar* buf; -- xmlNodePtr cur; -- -- xmlSecAssert2(cert != NULL, -1); -- xmlSecAssert2(node != NULL, -1); -- xmlSecAssert2(keyInfoCtx != NULL, -1); -- -- /* set base64 lines size from context */ -- buf = xmlSecNssX509CertBase64DerWrite(cert, keyInfoCtx->base64LineSize); -- if(buf == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509CertBase64DerWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- -- cur = xmlSecAddChild(node, xmlSecNodeX509Certificate, xmlSecDSigNs); -- if(cur == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509Certificate)); -- xmlFree(buf); -- return(-1); -- } -- -- /* todo: add \n around base64 data - from context */ -- /* todo: add errors check */ -- xmlNodeSetContent(cur, xmlSecStringCR); -- xmlNodeSetContent(cur, buf); -- xmlFree(buf); -- return(0); --} -- - static int - xmlSecNssX509SubjectNameNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlSecKeyDataStorePtr x509Store; -@@ -1120,19 +1044,13 @@ - } - - subject = xmlNodeGetContent(node); -- if((subject == NULL) || (xmlSecIsEmptyString(subject) == 1)) { -- if(subject != NULL) { -- xmlFree(subject); -- } -- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -- xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -- XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- return(0); -+ if(subject == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -+ XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); - } - - cert = xmlSecNssX509StoreFindCert(x509Store, subject, NULL, NULL, NULL, keyInfoCtx); -@@ -1167,40 +1085,6 @@ - return(0); - } - --static int --xmlSecNssX509SubjectNameNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) { -- xmlChar* buf = NULL; -- xmlNodePtr cur = NULL; -- -- xmlSecAssert2(cert != NULL, -1); -- xmlSecAssert2(node != NULL, -1); -- -- buf = xmlSecNssX509NameWrite(&(cert->subject)); -- if(buf == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509NameWrite(&(cert->subject))", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- -- cur = xmlSecAddChild(node, xmlSecNodeX509SubjectName, xmlSecDSigNs); -- if(cur == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509SubjectName)); -- xmlFree(buf); -- return(-1); -- } -- xmlNodeSetContent(cur, buf); -- xmlFree(buf); -- return(0); --} -- - static int - xmlSecNssX509IssuerSerialNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlSecKeyDataStorePtr x509Store; -@@ -1226,21 +1110,9 @@ - } - - cur = xmlSecGetNextElementNode(node->children); -- if(cur == NULL) { -- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -- xmlSecErrorsSafeString(xmlSecNodeX509IssuerName), -- XMLSEC_ERRORS_R_NODE_NOT_FOUND, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeGetName(cur))); -- return(-1); -- } -- return(0); -- } -- -+ - /* the first is required node X509IssuerName */ -- if(!xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs)) { -+ if((cur == NULL) || !xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs)) { - xmlSecError(XMLSEC_ERRORS_HERE, - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - xmlSecErrorsSafeString(xmlSecNodeX509IssuerName), -@@ -1332,78 +1204,6 @@ - return(0); - } - --static int --xmlSecNssX509IssuerSerialNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) { -- xmlNodePtr cur; -- xmlNodePtr issuerNameNode; -- xmlNodePtr issuerNumberNode; -- xmlChar* buf; -- -- xmlSecAssert2(cert != NULL, -1); -- xmlSecAssert2(node != NULL, -1); -- -- /* create xml nodes */ -- cur = xmlSecAddChild(node, xmlSecNodeX509IssuerSerial, xmlSecDSigNs); -- if(cur == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509IssuerSerial)); -- return(-1); -- } -- -- issuerNameNode = xmlSecAddChild(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs); -- if(issuerNameNode == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509IssuerName)); -- return(-1); -- } -- -- issuerNumberNode = xmlSecAddChild(cur, xmlSecNodeX509SerialNumber, xmlSecDSigNs); -- if(issuerNumberNode == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509SerialNumber)); -- return(-1); -- } -- -- /* write data */ -- buf = xmlSecNssX509NameWrite(&(cert->issuer)); -- if(buf == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509NameWrite(&(cert->issuer))", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- xmlNodeSetContent(issuerNameNode, buf); -- xmlFree(buf); -- -- buf = xmlSecNssASN1IntegerWrite(&(cert->serialNumber)); -- if(buf == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssASN1IntegerWrite(&(cert->serialNumber))", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- xmlNodeSetContent(issuerNumberNode, buf); -- xmlFree(buf); -- -- return(0); --} -- - static int - xmlSecNssX509SKINodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlSecKeyDataStorePtr x509Store; -@@ -1427,20 +1227,14 @@ - } - - ski = xmlNodeGetContent(node); -- if((ski == NULL) || (xmlSecIsEmptyString(ski) == 1)) { -- if(ski != NULL) { -- xmlFree(ski); -- } -- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -- xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -- XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -- "node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509SKI)); -- return(-1); -- } -- return(0); -+ if(ski == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -+ XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -+ "node=%s", -+ xmlSecErrorsSafeString(xmlSecNodeX509SKI)); -+ return(-1); - } - - cert = xmlSecNssX509StoreFindCert(x509Store, NULL, NULL, NULL, ski, keyInfoCtx); -@@ -1475,41 +1269,6 @@ - return(0); - } - --static int --xmlSecNssX509SKINodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) { -- xmlChar *buf = NULL; -- xmlNodePtr cur = NULL; -- -- xmlSecAssert2(cert != NULL, -1); -- xmlSecAssert2(node != NULL, -1); -- -- buf = xmlSecNssX509SKIWrite(cert); -- if(buf == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509SKIWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- -- cur = xmlSecAddChild(node, xmlSecNodeX509SKI, xmlSecDSigNs); -- if(cur == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "new_node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509SKI)); -- xmlFree(buf); -- return(-1); -- } -- xmlNodeSetContent(cur, buf); -- xmlFree(buf); -- -- return(0); --} -- - static int - xmlSecNssX509CRLNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlChar *content; -@@ -1520,19 +1279,13 @@ - xmlSecAssert2(keyInfoCtx != NULL, -1); - - content = xmlNodeGetContent(node); -- if((content == NULL) || (xmlSecIsEmptyString(content) == 1)) { -- if(content != NULL) { -- xmlFree(content); -- } -- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -- xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -- XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- return(0); -+ if(content == NULL){ -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), -+ xmlSecErrorsSafeString(xmlSecNodeGetName(node)), -+ XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, -+ XMLSEC_ERRORS_NO_MESSAGE); -+ return(-1); - } - - crl = xmlSecNssX509CrlBase64DerRead(content, keyInfoCtx); -@@ -1552,47 +1305,6 @@ - } - - static int --xmlSecNssX509CRLNodeWrite(CERTSignedCrl* crl, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { -- xmlChar* buf = NULL; -- xmlNodePtr cur = NULL; -- -- xmlSecAssert2(crl != NULL, -1); -- xmlSecAssert2(node != NULL, -1); -- xmlSecAssert2(keyInfoCtx != NULL, -1); -- -- /* set base64 lines size from context */ -- buf = xmlSecNssX509CrlBase64DerWrite(crl, keyInfoCtx->base64LineSize); -- if(buf == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509CrlBase64DerWrite", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- -- cur = xmlSecAddChild(node, xmlSecNodeX509CRL, xmlSecDSigNs); -- if(cur == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecAddChild", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "new_node=%s", -- xmlSecErrorsSafeString(xmlSecNodeX509CRL)); -- xmlFree(buf); -- return(-1); -- } -- /* todo: add \n around base64 data - from context */ -- /* todo: add errors check */ -- xmlNodeSetContent(cur, xmlSecStringCR); -- xmlNodeSetContent(cur, buf); -- xmlFree(buf); -- -- return(0); --} -- -- --static int - xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data, xmlSecKeyPtr key, - xmlSecKeyInfoCtxPtr keyInfoCtx) { - xmlSecNssX509DataCtxPtr ctx; -@@ -1600,6 +1312,10 @@ - int ret; - SECStatus status; - PRTime notBefore, notAfter; -+ -+ PK11SlotInfo* slot ; -+ SECKEYPublicKey *pubKey = NULL; -+ SECKEYPrivateKey *priKey = NULL; - - xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataX509Id), -1); - xmlSecAssert2(key != NULL, -1); -@@ -1632,10 +1348,13 @@ - xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), - "CERT_DupCertificate", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(-1); - } - -+ /*- -+ * Get Public key from cert, which does not always work for sign action. -+ * - keyValue = xmlSecNssX509CertGetKey(ctx->keyCert); - if(keyValue == NULL) { - xmlSecError(XMLSEC_ERRORS_HERE, -@@ -1645,6 +1364,54 @@ - XMLSEC_ERRORS_NO_MESSAGE); - return(-1); - } -+ */ -+ -+ /*- -+ * I'll search key according to KeyReq. -+ */ -+ slot = cert->slot ; -+ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) { -+ if( ( priKey = PK11_FindPrivateKeyFromCert( slot , cert , NULL ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "PK11_FindPrivateKeyFromCert" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } -+ } -+ -+ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) { -+ if( ( pubKey = CERT_ExtractPublicKey( cert ) ) == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "CERT_ExtractPublicKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ if( priKey != NULL ) -+ SECKEY_DestroyPrivateKey( priKey ) ; -+ return -1 ; -+ } -+ } -+ -+ keyValue = xmlSecNssPKIAdoptKey(priKey, pubKey); -+ if( keyValue == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE , -+ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , -+ "xmlSecNssPKIAdoptKey" , -+ XMLSEC_ERRORS_R_CRYPTO_FAILED , -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ if( priKey != NULL ) -+ SECKEY_DestroyPrivateKey( priKey ) ; -+ -+ if( pubKey != NULL ) -+ SECKEY_DestroyPublicKey( pubKey ) ; -+ -+ return -1 ; -+ } -+ /* Modify keyValue get Done */ - - /* verify that the key matches our expectations */ - if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), keyValue) != 1) { -@@ -1725,14 +1492,6 @@ - return(0); - } - --/** -- * xmlSecNssX509CertGetKey: -- * @cert: the certificate. -- * -- * Extracts public key from the @cert. -- * -- * Returns public key value or NULL if an error occurs. -- */ - xmlSecKeyDataPtr - xmlSecNssX509CertGetKey(CERTCertificate* cert) { - xmlSecKeyDataPtr data; -@@ -1746,7 +1505,7 @@ - NULL, - "CERT_ExtractPublicKey", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(NULL); - } - -@@ -1804,7 +1563,7 @@ - NULL, - "__CERT_NewTempCertificate", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(NULL); - } - -@@ -1827,7 +1586,7 @@ - NULL, - "cert->derCert", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(NULL); - } - -@@ -1890,7 +1649,7 @@ - NULL, - "PK11_GetInternalKeySlot", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return NULL; - } - -@@ -1905,7 +1664,7 @@ - NULL, - "PK11_ImportCRL", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - PK11_FreeSlot(slot); - return(NULL); - } -@@ -1929,7 +1688,7 @@ - NULL, - "crl->derCrl", - XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -+ "error code=%d", PORT_GetError()); - return(NULL); - } - -@@ -1946,86 +1705,6 @@ - return(res); - } - --static xmlChar* --xmlSecNssX509NameWrite(CERTName* nm) { -- xmlChar *res = NULL; -- char *str; -- -- xmlSecAssert2(nm != NULL, NULL); -- -- str = CERT_NameToAscii(nm); -- if (str == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CERT_NameToAscii", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(NULL); -- } -- -- res = xmlStrdup(BAD_CAST str); -- if(res == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlStrdup", -- XMLSEC_ERRORS_R_MALLOC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- PORT_Free(str); -- return(NULL); -- } -- PORT_Free(str); -- return(res); --} -- --static xmlChar* --xmlSecNssASN1IntegerWrite(SECItem *num) { -- xmlChar *res = NULL; -- -- xmlSecAssert2(num != NULL, NULL); -- -- /* TODO : to be implemented after -- * NSS bug http://bugzilla.mozilla.org/show_bug.cgi?id=212864 is fixed -- */ -- return(res); --} -- --static xmlChar* --xmlSecNssX509SKIWrite(CERTCertificate* cert) { -- xmlChar *res = NULL; -- SECItem ski; -- SECStatus rv; -- -- xmlSecAssert2(cert != NULL, NULL); -- -- memset(&ski, 0, sizeof(ski)); -- -- rv = CERT_FindSubjectKeyIDExtension(cert, &ski); -- if (rv != SECSuccess) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CERT_FindSubjectKeyIDExtension", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- SECITEM_FreeItem(&ski, PR_FALSE); -- return(NULL); -- } -- -- res = xmlSecBase64Encode(ski.data, ski.len, 0); -- if(res == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBase64Encode", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- SECITEM_FreeItem(&ski, PR_FALSE); -- return(NULL); -- } -- SECITEM_FreeItem(&ski, PR_FALSE); -- -- return(res); --} -- -- - static void - xmlSecNssX509CertDebugDump(CERTCertificate* cert, FILE* output) { - SECItem *sn; -@@ -2084,7 +1763,11 @@ - xmlSecSize bufSize, - xmlSecKeyInfoCtxPtr keyInfoCtx); - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataKlass xmlSecNssKeyDataRawX509CertKlass = { -+#else - static xmlSecKeyDataKlass xmlSecNssKeyDataRawX509CertKlass = { -+#endif - sizeof(xmlSecKeyDataKlass), - sizeof(xmlSecKeyData), - ---- misc/xmlsec1-1.2.6/src/nss/x509vfy.c 2003-09-26 02:58:15.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/src/nss/x509vfy.c 2008-06-29 23:44:19.000000000 +0200 -@@ -30,6 +30,7 @@ - #include <xmlsec/keyinfo.h> - #include <xmlsec/keysmngr.h> - #include <xmlsec/base64.h> -+#include <xmlsec/bn.h> - #include <xmlsec/errors.h> - - #include <xmlsec/nss/crypto.h> -@@ -43,8 +44,8 @@ - typedef struct _xmlSecNssX509StoreCtx xmlSecNssX509StoreCtx, - *xmlSecNssX509StoreCtxPtr; - struct _xmlSecNssX509StoreCtx { -- CERTCertList* certsList; /* just keeping a reference to destroy later */ --}; -+ CERTCertList* certsList; /* just keeping a reference to destroy later */ -+}; - - /**************************************************************************** - * -@@ -54,45 +55,40 @@ - * - ***************************************************************************/ - #define xmlSecNssX509StoreGetCtx(store) \ -- ((xmlSecNssX509StoreCtxPtr)(((xmlSecByte*)(store)) + \ -- sizeof(xmlSecKeyDataStoreKlass))) -+ ((xmlSecNssX509StoreCtxPtr)(((xmlSecByte*)(store)) + \ -+ sizeof(xmlSecKeyDataStoreKlass))) - #define xmlSecNssX509StoreSize \ -- (sizeof(xmlSecKeyDataStoreKlass) + sizeof(xmlSecNssX509StoreCtx)) -+ (sizeof(xmlSecKeyDataStoreKlass) + sizeof(xmlSecNssX509StoreCtx)) - - static int xmlSecNssX509StoreInitialize (xmlSecKeyDataStorePtr store); - static void xmlSecNssX509StoreFinalize (xmlSecKeyDataStorePtr store); --static int xmlSecNssX509NameStringRead (xmlSecByte **str, -- int *strLen, -- xmlSecByte *res, -- int resLen, -- xmlSecByte delim, -- int ingoreTrailingSpaces); --static xmlSecByte * xmlSecNssX509NameRead (xmlSecByte *str, -- int len); -- --static void xmlSecNssNumToItem(SECItem *it, unsigned long num); - -+static int xmlSecNssIntegerToItem( const xmlChar* integer , SECItem *it ) ; - -+#ifdef __MINGW32__ // for runtime-pseudo-reloc -+static struct _xmlSecKeyDataStoreKlass xmlSecNssX509StoreKlass = { -+#else - static xmlSecKeyDataStoreKlass xmlSecNssX509StoreKlass = { -- sizeof(xmlSecKeyDataStoreKlass), -- xmlSecNssX509StoreSize, -- -- /* data */ -- xmlSecNameX509Store, /* const xmlChar* name; */ -- -- /* constructors/destructor */ -- xmlSecNssX509StoreInitialize, /* xmlSecKeyDataStoreInitializeMethod initialize; */ -- xmlSecNssX509StoreFinalize, /* xmlSecKeyDataStoreFinalizeMethod finalize; */ -- -- /* reserved for the future */ -- NULL, /* void* reserved0; */ -- NULL, /* void* reserved1; */ -+#endif -+ sizeof(xmlSecKeyDataStoreKlass), -+ xmlSecNssX509StoreSize, -+ -+ /* data */ -+ xmlSecNameX509Store, /* const xmlChar* name; */ -+ -+ /* constructors/destructor */ -+ xmlSecNssX509StoreInitialize, /* xmlSecKeyDataStoreInitializeMethod initialize; */ -+ xmlSecNssX509StoreFinalize, /* xmlSecKeyDataStoreFinalizeMethod finalize; */ -+ -+ /* reserved for the future */ -+ NULL, /* void* reserved0; */ -+ NULL, /* void* reserved1; */ - }; - - static CERTCertificate* xmlSecNssX509FindCert(xmlChar *subjectName, -- xmlChar *issuerName, -- xmlChar *issuerSerial, -- xmlChar *ski); -+ xmlChar *issuerName, -+ xmlChar *issuerSerial, -+ xmlChar *ski); - - - /** -@@ -104,7 +100,7 @@ - */ - xmlSecKeyDataStoreId - xmlSecNssX509StoreGetKlass(void) { -- return(&xmlSecNssX509StoreKlass); -+ return(&xmlSecNssX509StoreKlass); - } - - /** -@@ -125,15 +121,15 @@ - xmlSecNssX509StoreFindCert(xmlSecKeyDataStorePtr store, xmlChar *subjectName, - xmlChar *issuerName, xmlChar *issuerSerial, - xmlChar *ski, xmlSecKeyInfoCtx* keyInfoCtx) { -- xmlSecNssX509StoreCtxPtr ctx; -- -- xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), NULL); -- xmlSecAssert2(keyInfoCtx != NULL, NULL); -+ xmlSecNssX509StoreCtxPtr ctx; -+ -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), NULL); -+ xmlSecAssert2(keyInfoCtx != NULL, NULL); - -- ctx = xmlSecNssX509StoreGetCtx(store); -- xmlSecAssert2(ctx != NULL, NULL); -+ ctx = xmlSecNssX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, NULL); - -- return(xmlSecNssX509FindCert(subjectName, issuerName, issuerSerial, ski)); -+ return(xmlSecNssX509FindCert(subjectName, issuerName, issuerSerial, ski)); - } - - /** -@@ -148,116 +144,130 @@ - */ - CERTCertificate * - xmlSecNssX509StoreVerify(xmlSecKeyDataStorePtr store, CERTCertList* certs, -- xmlSecKeyInfoCtx* keyInfoCtx) { -- xmlSecNssX509StoreCtxPtr ctx; -- CERTCertListNode* head; -- CERTCertificate* cert = NULL; -- CERTCertListNode* head1; -- CERTCertificate* cert1 = NULL; -- SECStatus status = SECFailure; -- int64 timeboundary; -- int64 tmp1, tmp2; -- -- xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), NULL); -- xmlSecAssert2(certs != NULL, NULL); -- xmlSecAssert2(keyInfoCtx != NULL, NULL); -- -- ctx = xmlSecNssX509StoreGetCtx(store); -- xmlSecAssert2(ctx != NULL, NULL); -- -- for (head = CERT_LIST_HEAD(certs); -- !CERT_LIST_END(head, certs); -- head = CERT_LIST_NEXT(head)) { -- cert = head->cert; -+ xmlSecKeyInfoCtx* keyInfoCtx) { -+ xmlSecNssX509StoreCtxPtr ctx; -+ CERTCertListNode* head; -+ CERTCertificate* cert = NULL; -+ CERTCertListNode* head1; -+ CERTCertificate* cert1 = NULL; -+ SECStatus status = SECFailure; -+ int64 timeboundary; -+ int64 tmp1, tmp2; -+ -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), NULL); -+ xmlSecAssert2(certs != NULL, NULL); -+ xmlSecAssert2(keyInfoCtx != NULL, NULL); -+ -+ ctx = xmlSecNssX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, NULL); -+ -+ for (head = CERT_LIST_HEAD(certs); -+ !CERT_LIST_END(head, certs); -+ head = CERT_LIST_NEXT(head)) { -+ cert = head->cert; - if(keyInfoCtx->certsVerificationTime > 0) { -- /* convert the time since epoch in seconds to microseconds */ -- LL_UI2L(timeboundary, keyInfoCtx->certsVerificationTime); -- tmp1 = (int64)PR_USEC_PER_SEC; -- tmp2 = timeboundary; -- LL_MUL(timeboundary, tmp1, tmp2); -+ /* convert the time since epoch in seconds to microseconds */ -+ LL_UI2L(timeboundary, keyInfoCtx->certsVerificationTime); -+ tmp1 = (int64)PR_USEC_PER_SEC; -+ tmp2 = timeboundary; -+ LL_MUL(timeboundary, tmp1, tmp2); - } else { -- timeboundary = PR_Now(); -+ timeboundary = PR_Now(); - } - - /* if cert is the issuer of any other cert in the list, then it is - * to be skipped */ - for (head1 = CERT_LIST_HEAD(certs); -- !CERT_LIST_END(head1, certs); -- head1 = CERT_LIST_NEXT(head1)) { -+ !CERT_LIST_END(head1, certs); -+ head1 = CERT_LIST_NEXT(head1)) { - -- cert1 = head1->cert; -- if (cert1 == cert) { -+ cert1 = head1->cert; -+ if (cert1 == cert) { - continue; -- } -+ } - -- if (SECITEM_CompareItem(&cert1->derIssuer, &cert->derSubject) -- == SECEqual) { -+ if (SECITEM_CompareItem(&cert1->derIssuer, &cert->derSubject) -+ == SECEqual) { - break; -- } -+ } - } - - if (!CERT_LIST_END(head1, certs)) { -- continue; -+ continue; - } -- -- status = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), -- cert, PR_FALSE, -- (SECCertificateUsage)0, -- timeboundary , NULL, NULL, NULL); -- if (status == SECSuccess) { -- break; -+ /* JL: OpenOffice.org implements its own certificate verification routine. -+ The goal is to seperate validation of the signature -+ and the certificate. For example, OOo could show that the document signature is valid, -+ but the certificate could not be verified. If we do not prevent the verification of -+ the certificate by libxmlsec and the verification fails, then the XML signature may not be -+ verified. This would happen, for example, if the root certificate is not installed. -+ -+ In the store schould only be the certificate from the X509Certificate element -+ and the X509IssuerSerial element. The latter is only there -+ if the certificate is installed. Both certificates must be the same! -+ In case of writing the signature, the store contains only the certificate that -+ was created based on the information from the X509IssuerSerial element. */ -+ status = SECSuccess; -+ break; -+/* status = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), -+ cert, PR_FALSE, -+ (SECCertificateUsage)0, -+ timeboundary , NULL, NULL, NULL); -+ if (status == SECSuccess) { -+ break; -+ } */ - } -- } - -- if (status == SECSuccess) { -+ if (status == SECSuccess) { - return (cert); -- } -- -- switch(PORT_GetError()) { -+ } -+ -+ switch(PORT_GetError()) { - case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: - case SEC_ERROR_CA_CERT_INVALID: - case SEC_ERROR_UNKNOWN_SIGNER: -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -- NULL, -- XMLSEC_ERRORS_R_CERT_ISSUER_FAILED, -- "cert with subject name %s could not be verified because the issuer's cert is expired/invalid or not found", -- cert->subjectName); -- break; -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ NULL, -+ XMLSEC_ERRORS_R_CERT_ISSUER_FAILED, -+ "cert with subject name %s could not be verified because the issuer's cert is expired/invalid or not found", -+ cert->subjectName); -+ break; - case SEC_ERROR_EXPIRED_CERTIFICATE: -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -- NULL, -- XMLSEC_ERRORS_R_CERT_HAS_EXPIRED, -- "cert with subject name %s has expired", -- cert->subjectName); -- break; -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ NULL, -+ XMLSEC_ERRORS_R_CERT_HAS_EXPIRED, -+ "cert with subject name %s has expired", -+ cert->subjectName); -+ break; - case SEC_ERROR_REVOKED_CERTIFICATE: -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -- NULL, -- XMLSEC_ERRORS_R_CERT_REVOKED, -- "cert with subject name %s has been revoked", -- cert->subjectName); -- break; -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ NULL, -+ XMLSEC_ERRORS_R_CERT_REVOKED, -+ "cert with subject name %s has been revoked", -+ cert->subjectName); -+ break; - default: -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -- NULL, -- XMLSEC_ERRORS_R_CERT_VERIFY_FAILED, -- "cert with subject name %s could not be verified", -- cert->subjectName); -- break; -- } -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ NULL, -+ XMLSEC_ERRORS_R_CERT_VERIFY_FAILED, -+ "cert with subject name %s could not be verified, errcode %d", -+ cert->subjectName, -+ PORT_GetError()); -+ break; -+ } - -- return (NULL); -+ return (NULL); - } - - /** - * xmlSecNssX509StoreAdoptCert: -- * @store: the pointer to X509 key data store klass. -- * @cert: the pointer to NSS X509 certificate. -- * @type: the certificate type (trusted/untrusted). -+ * @store: the pointer to X509 key data store klass. -+ * @cert: the pointer to NSS X509 certificate. -+ * @type: the certificate type (trusted/untrusted). - * - * Adds trusted (root) or untrusted certificate to the store. - * -@@ -265,67 +275,67 @@ - */ - int - xmlSecNssX509StoreAdoptCert(xmlSecKeyDataStorePtr store, CERTCertificate* cert, xmlSecKeyDataType type ATTRIBUTE_UNUSED) { -- xmlSecNssX509StoreCtxPtr ctx; -- int ret; -+ xmlSecNssX509StoreCtxPtr ctx; -+ int ret; - -- xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), -1); -- xmlSecAssert2(cert != NULL, -1); -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), -1); -+ xmlSecAssert2(cert != NULL, -1); - -- ctx = xmlSecNssX509StoreGetCtx(store); -- xmlSecAssert2(ctx != NULL, -1); -+ ctx = xmlSecNssX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, -1); - -- if(ctx->certsList == NULL) { -- ctx->certsList = CERT_NewCertList(); -- if(ctx->certsList == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -- "CERT_NewCertList", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -- } -- -- ret = CERT_AddCertToListTail(ctx->certsList, cert); -- if(ret != SECSuccess) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -- "CERT_AddCertToListTail", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(-1); -- } -+ if(ctx->certsList == NULL) { -+ ctx->certsList = CERT_NewCertList(); -+ if(ctx->certsList == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CERT_NewCertList", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code=%d", PORT_GetError()); -+ return(-1); -+ } -+ } - -- return(0); -+ ret = CERT_AddCertToListTail(ctx->certsList, cert); -+ if(ret != SECSuccess) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ xmlSecErrorsSafeString(xmlSecKeyDataStoreGetName(store)), -+ "CERT_AddCertToListTail", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code=%d", PORT_GetError()); -+ return(-1); -+ } -+ -+ return(0); - } - - static int - xmlSecNssX509StoreInitialize(xmlSecKeyDataStorePtr store) { -- xmlSecNssX509StoreCtxPtr ctx; -- xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), -1); -+ xmlSecNssX509StoreCtxPtr ctx; -+ xmlSecAssert2(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId), -1); - -- ctx = xmlSecNssX509StoreGetCtx(store); -- xmlSecAssert2(ctx != NULL, -1); -+ ctx = xmlSecNssX509StoreGetCtx(store); -+ xmlSecAssert2(ctx != NULL, -1); - -- memset(ctx, 0, sizeof(xmlSecNssX509StoreCtx)); -+ memset(ctx, 0, sizeof(xmlSecNssX509StoreCtx)); - -- return(0); -+ return(0); - } - - static void - xmlSecNssX509StoreFinalize(xmlSecKeyDataStorePtr store) { -- xmlSecNssX509StoreCtxPtr ctx; -- xmlSecAssert(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId)); -+ xmlSecNssX509StoreCtxPtr ctx; -+ xmlSecAssert(xmlSecKeyDataStoreCheckId(store, xmlSecNssX509StoreId)); - -- ctx = xmlSecNssX509StoreGetCtx(store); -- xmlSecAssert(ctx != NULL); -- -- if (ctx->certsList) { -+ ctx = xmlSecNssX509StoreGetCtx(store); -+ xmlSecAssert(ctx != NULL); -+ -+ if (ctx->certsList) { - CERT_DestroyCertList(ctx->certsList); - ctx->certsList = NULL; -- } -+ } - -- memset(ctx, 0, sizeof(xmlSecNssX509StoreCtx)); -+ memset(ctx, 0, sizeof(xmlSecNssX509StoreCtx)); - } - - -@@ -340,376 +350,213 @@ - */ - static CERTCertificate* - xmlSecNssX509FindCert(xmlChar *subjectName, xmlChar *issuerName, -- xmlChar *issuerSerial, xmlChar *ski) { -- CERTCertificate *cert = NULL; -- xmlChar *p = NULL; -- CERTName *name = NULL; -- SECItem *nameitem = NULL; -- PRArenaPool *arena = NULL; -- -- if (subjectName != NULL) { -- p = xmlSecNssX509NameRead(subjectName, xmlStrlen(subjectName)); -- if (p == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509NameRead", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "subject=%s", -- xmlSecErrorsSafeString(subjectName)); -- goto done; -- } -- -- arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); -- if (arena == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "PORT_NewArena", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- -- name = CERT_AsciiToName((char*)p); -- if (name == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CERT_AsciiToName", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- -- nameitem = SEC_ASN1EncodeItem(arena, NULL, (void *)name, -- SEC_ASN1_GET(CERT_NameTemplate)); -- if (nameitem == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "SEC_ASN1EncodeItem", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- -- cert = CERT_FindCertByName(CERT_GetDefaultCertDB(), nameitem); -- goto done; -- } -- -- if((issuerName != NULL) && (issuerSerial != NULL)) { -- CERTIssuerAndSN issuerAndSN; -- -- p = xmlSecNssX509NameRead(issuerName, xmlStrlen(issuerName)); -- if (p == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509NameRead", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "issuer=%s", -- xmlSecErrorsSafeString(issuerName)); -- goto done; -- } -- -- arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); -- if (arena == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "PORT_NewArena", -- XMLSEC_ERRORS_R_CRYPTO_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- -- name = CERT_AsciiToName((char*)p); -- if (name == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "CERT_AsciiToName", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- -- nameitem = SEC_ASN1EncodeItem(arena, NULL, (void *)name, -- SEC_ASN1_GET(CERT_NameTemplate)); -- if (nameitem == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "SEC_ASN1EncodeItem", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- -- memset(&issuerAndSN, 0, sizeof(issuerAndSN)); -+ xmlChar *issuerSerial, xmlChar *ski) { -+ CERTCertificate *cert = NULL; -+ CERTName *name = NULL; -+ SECItem *nameitem = NULL; -+ PRArenaPool *arena = NULL; -+ -+ if (subjectName != NULL) { -+ arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); -+ if (arena == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PORT_NewArena", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code=%d", PORT_GetError()); -+ goto done; -+ } - -- issuerAndSN.derIssuer.data = nameitem->data; -- issuerAndSN.derIssuer.len = nameitem->len; -+ name = CERT_AsciiToName((char*)subjectName); -+ if (name == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "CERT_AsciiToName", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "error code=%d", PORT_GetError()); -+ goto done; -+ } - -- /* TBD: serial num can be arbitrarily long */ -- xmlSecNssNumToItem(&issuerAndSN.serialNumber, PORT_Atoi((char *)issuerSerial)); -+ nameitem = SEC_ASN1EncodeItem(arena, NULL, (void *)name, -+ SEC_ASN1_GET(CERT_NameTemplate)); -+ if (nameitem == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "SEC_ASN1EncodeItem", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "error code=%d", PORT_GetError()); -+ goto done; -+ } - -- cert = CERT_FindCertByIssuerAndSN(CERT_GetDefaultCertDB(), -- &issuerAndSN); -- SECITEM_FreeItem(&issuerAndSN.serialNumber, PR_FALSE); -- goto done; -- } -- -- if(ski != NULL) { -- SECItem subjKeyID; -- int len; -- -- len = xmlSecBase64Decode(ski, (xmlSecByte*)ski, xmlStrlen(ski)); -- if(len < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecBase64Decode", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- "ski=%s", -- xmlSecErrorsSafeString(ski)); -- goto done; -- } -- -- memset(&subjKeyID, 0, sizeof(subjKeyID)); -- subjKeyID.data = ski; -- subjKeyID.len = xmlStrlen(ski); -- cert = CERT_FindCertBySubjectKeyID(CERT_GetDefaultCertDB(), -- &subjKeyID); -- } -+ cert = CERT_FindCertByName(CERT_GetDefaultCertDB(), nameitem); -+ goto done; -+ } - --done: -- if (p != NULL) { -- PORT_Free(p); -- } -- if (arena != NULL) { -- PORT_FreeArena(arena, PR_FALSE); -- } -- if (name != NULL) { -- CERT_DestroyName(name); -- } -+ if((issuerName != NULL) && (issuerSerial != NULL)) { -+ CERTIssuerAndSN issuerAndSN; - -- return(cert); --} -+ arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); -+ if (arena == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "PORT_NewArena", -+ XMLSEC_ERRORS_R_CRYPTO_FAILED, -+ "error code=%d", PORT_GetError()); -+ goto done; -+ } - --/** -- * xmlSecNssX509NameRead: -- */ --static xmlSecByte * --xmlSecNssX509NameRead(xmlSecByte *str, int len) { -- xmlSecByte name[256]; -- xmlSecByte value[256]; -- xmlSecByte *retval = NULL; -- xmlSecByte *p = NULL; -- int nameLen, valueLen; -- -- xmlSecAssert2(str != NULL, NULL); -- -- /* return string should be no longer than input string */ -- retval = (xmlSecByte *)PORT_Alloc(len+1); -- if(retval == NULL) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "PORT_Alloc", -- XMLSEC_ERRORS_R_MALLOC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- return(NULL); -- } -- p = retval; -- -- while(len > 0) { -- /* skip spaces after comma or semicolon */ -- while((len > 0) && isspace(*str)) { -- ++str; --len; -- } -- -- nameLen = xmlSecNssX509NameStringRead(&str, &len, name, sizeof(name), '=', 0); -- if(nameLen < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- "xmlSecNssX509NameStringRead", -- XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- memcpy(p, name, nameLen); -- p+=nameLen; -- *p++='='; -- if(len > 0) { -- ++str; --len; -- if((*str) == '\"') { -- valueLen = xmlSecNssX509NameStringRead(&str, &len, -- value, sizeof(value), '"', 1); -- if(valueLen < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -+ name = CERT_AsciiToName((char*)issuerName); -+ if (name == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, - NULL, -- "xmlSecNssX509NameStringRead", -+ "CERT_AsciiToName", - XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- /* skip spaces before comma or semicolon */ -- while((len > 0) && isspace(*str)) { -- ++str; --len; -+ "error code=%d", PORT_GetError()); -+ goto done; - } -- if((len > 0) && ((*str) != ',')) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "comma is expected"); -- goto done; -- } -- if(len > 0) { -- ++str; --len; -+ -+ nameitem = SEC_ASN1EncodeItem(arena, NULL, (void *)name, -+ SEC_ASN1_GET(CERT_NameTemplate)); -+ if (nameitem == NULL) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "SEC_ASN1EncodeItem", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "error code=%d", PORT_GetError()); -+ goto done; - } -- *p++='\"'; -- memcpy(p, value, valueLen); -- p+=valueLen; -- *p++='\"'; -- } else if((*str) == '#') { -- /* TODO: read octect values */ -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "reading octect values is not implemented yet"); -- goto done; -- } else { -- valueLen = xmlSecNssX509NameStringRead(&str, &len, -- value, sizeof(value), ',', 1); -- if(valueLen < 0) { -- xmlSecError(XMLSEC_ERRORS_HERE, -+ -+ memset(&issuerAndSN, 0, sizeof(issuerAndSN)); -+ -+ issuerAndSN.derIssuer.data = nameitem->data; -+ issuerAndSN.derIssuer.len = nameitem->len; -+ -+ if( xmlSecNssIntegerToItem( issuerSerial, &issuerAndSN.serialNumber ) < 0 ) { -+ xmlSecError(XMLSEC_ERRORS_HERE, - NULL, -- "xmlSecNssX509NameStringRead", -+ "xmlSecNssIntegerToItem", - XMLSEC_ERRORS_R_XMLSEC_FAILED, -- XMLSEC_ERRORS_NO_MESSAGE); -- goto done; -- } -- memcpy(p, value, valueLen); -- p+=valueLen; -- if (len > 0) -- *p++=','; -- } -- } else { -- valueLen = 0; -+ "serial number=%s", -+ xmlSecErrorsSafeString(issuerSerial)); -+ goto done; -+ } -+ -+ cert = CERT_FindCertByIssuerAndSN(CERT_GetDefaultCertDB(), -+ &issuerAndSN); -+ SECITEM_FreeItem(&issuerAndSN.serialNumber, PR_FALSE); -+ goto done; -+ } -+ -+ if(ski != NULL) { -+ SECItem subjKeyID; -+ int len; -+ -+ len = xmlSecBase64Decode(ski, (xmlSecByte*)ski, xmlStrlen(ski)); -+ if(len < 0) { -+ xmlSecError(XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBase64Decode", -+ XMLSEC_ERRORS_R_XMLSEC_FAILED, -+ "ski=%s", -+ xmlSecErrorsSafeString(ski)); -+ goto done; -+ } -+ -+ memset(&subjKeyID, 0, sizeof(subjKeyID)); -+ subjKeyID.data = ski; -+ subjKeyID.len = xmlStrlen(ski); -+ cert = CERT_FindCertBySubjectKeyID(CERT_GetDefaultCertDB(), -+ &subjKeyID); - } -- if(len > 0) { -- ++str; --len; -- } -- } -- -- *p = 0; -- return(retval); -- -+ - done: -- PORT_Free(retval); -- return (NULL); -+ if (arena != NULL) { -+ PORT_FreeArena(arena, PR_FALSE); -+ } -+ if (name != NULL) { -+ CERT_DestroyName(name); -+ } -+ -+ return(cert); - } - -+static int -+xmlSecNssIntegerToItem( -+ const xmlChar* integer , -+ SECItem *item -+) { -+ xmlSecBn bn ; -+ xmlSecSize i, length ; -+ const xmlSecByte* bnInteger ; - -+ xmlSecAssert2( integer != NULL, -1 ) ; -+ xmlSecAssert2( item != NULL, -1 ) ; - --/** -- * xmlSecNssX509NameStringRead: -- */ --static int --xmlSecNssX509NameStringRead(xmlSecByte **str, int *strLen, -- xmlSecByte *res, int resLen, -- xmlSecByte delim, int ingoreTrailingSpaces) { -- xmlSecByte *p, *q, *nonSpace; -- -- xmlSecAssert2(str != NULL, -1); -- xmlSecAssert2(strLen != NULL, -1); -- xmlSecAssert2(res != NULL, -1); -- -- p = (*str); -- nonSpace = q = res; -- while(((p - (*str)) < (*strLen)) && ((*p) != delim) && ((q - res) < resLen)) { -- if((*p) != '\\') { -- if(ingoreTrailingSpaces && !isspace(*p)) { -- nonSpace = q; -- } -- *(q++) = *(p++); -- } else { -- ++p; -- nonSpace = q; -- if(xmlSecIsHex((*p))) { -- if((p - (*str) + 1) >= (*strLen)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "two hex digits expected"); -- return(-1); -- } -- *(q++) = xmlSecGetHex(p[0]) * 16 + xmlSecGetHex(p[1]); -- p += 2; -- } else { -- if(((++p) - (*str)) >= (*strLen)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_INVALID_DATA, -- "escaped symbol missed"); -- return(-1); -- } -- *(q++) = *(p++); -- } -- } -- } -- if(((p - (*str)) < (*strLen)) && ((*p) != delim)) { -- xmlSecError(XMLSEC_ERRORS_HERE, -- NULL, -- NULL, -- XMLSEC_ERRORS_R_INVALID_SIZE, -- "buffer is too small"); -- return(-1); -- } -- (*strLen) -= (p - (*str)); -- (*str) = p; -- return((ingoreTrailingSpaces) ? nonSpace - res + 1 : q - res); --} -+ if( xmlSecBnInitialize( &bn, 0 ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnInitialize", -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ return -1 ; -+ } - --/* code lifted from NSS */ --static void --xmlSecNssNumToItem(SECItem *it, unsigned long ui) --{ -- unsigned char bb[5]; -- int len; -- -- bb[0] = 0; -- bb[1] = (unsigned char) (ui >> 24); -- bb[2] = (unsigned char) (ui >> 16); -- bb[3] = (unsigned char) (ui >> 8); -- bb[4] = (unsigned char) (ui); -- -- /* -- ** Small integers are encoded in a single byte. Larger integers -- ** require progressively more space. -- */ -- if (ui > 0x7f) { -- if (ui > 0x7fff) { -- if (ui > 0x7fffffL) { -- if (ui >= 0x80000000L) { -- len = 5; -- } else { -- len = 4; -- } -- } else { -- len = 3; -- } -- } else { -- len = 2; -- } -- } else { -- len = 1; -- } -- -- it->data = (unsigned char *)PORT_Alloc(len); -- if (it->data == NULL) { -- return; -- } -+ if( xmlSecBnFromDecString( &bn, integer ) < 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnFromDecString", -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecBnFinalize( &bn ) ; -+ return -1 ; -+ } -+ -+ length = xmlSecBnGetSize( &bn ) ; -+ if( length <= 0 ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnGetSize", -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecBnFinalize( &bn ) ; -+ return -1 ; -+ } -+ -+ bnInteger = xmlSecBnGetData( &bn ) ; -+ if( bnInteger == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ NULL, -+ "xmlSecBnGetData", -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ XMLSEC_ERRORS_NO_MESSAGE ) ; - -- it->len = len; -- PORT_Memcpy(it->data, bb + (sizeof(bb) - len), len); -+ xmlSecBnFinalize( &bn ) ; -+ return -1 ; -+ } -+ -+ item->data = ( unsigned char * )PORT_Alloc( length ); -+ if( item->data == NULL ) { -+ xmlSecError( XMLSEC_ERRORS_HERE, -+ NULL, -+ "PORT_Alloc", -+ XMLSEC_ERRORS_R_INVALID_DATA, -+ XMLSEC_ERRORS_NO_MESSAGE ) ; -+ -+ xmlSecBnFinalize( &bn ) ; -+ return -1 ; -+ } -+ -+ item->len = length; -+ -+ for( i = 0 ; i < length ; i ++ ) -+ item->data[i] = *( bnInteger + i ) ; -+ -+ xmlSecBnFinalize( &bn ) ; -+ -+ return 0 ; - } --#endif /* XMLSEC_NO_X509 */ - -+#endif /* XMLSEC_NO_X509 */ - ---- misc/xmlsec1-1.2.6/win32/Makefile.msvc 2004-06-09 16:35:12.000000000 +0200 -+++ misc/build/xmlsec1-1.2.6/win32/Makefile.msvc 2008-06-29 23:44:19.000000000 +0200 -@@ -223,6 +223,10 @@ - $(XMLSEC_OPENSSL_INTDIR_A)\x509vfy.obj - - XMLSEC_NSS_OBJS = \ -+ $(XMLSEC_NSS_INTDIR)\akmngr.obj\ -+ $(XMLSEC_NSS_INTDIR)\keytrans.obj\ -+ $(XMLSEC_NSS_INTDIR)\keywrapers.obj\ -+ $(XMLSEC_NSS_INTDIR)\tokens.obj\ - $(XMLSEC_NSS_INTDIR)\app.obj\ - $(XMLSEC_NSS_INTDIR)\bignum.obj\ - $(XMLSEC_NSS_INTDIR)\ciphers.obj \ -@@ -235,9 +239,6 @@ - $(XMLSEC_NSS_INTDIR)\x509.obj\ - $(XMLSEC_NSS_INTDIR)\x509vfy.obj\ - $(XMLSEC_NSS_INTDIR)\keysstore.obj\ -- $(XMLSEC_NSS_INTDIR)\kt_rsa.obj\ -- $(XMLSEC_NSS_INTDIR)\kw_des.obj\ -- $(XMLSEC_NSS_INTDIR)\kw_aes.obj\ - $(XMLSEC_NSS_INTDIR)\strings.obj - XMLSEC_NSS_OBJS_A = \ - $(XMLSEC_NSS_INTDIR_A)\app.obj\ -@@ -258,6 +259,7 @@ - $(XMLSEC_NSS_INTDIR_A)\strings.obj - - XMLSEC_MSCRYPTO_OBJS = \ -+ $(XMLSEC_MSCRYPTO_INTDIR)\akmngr.obj\ - $(XMLSEC_MSCRYPTO_INTDIR)\app.obj\ - $(XMLSEC_MSCRYPTO_INTDIR)\crypto.obj \ - $(XMLSEC_MSCRYPTO_INTDIR)\ciphers.obj \ -@@ -376,7 +378,7 @@ - XMLSEC_OPENSSL_SOLIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib - XMLSEC_OPENSSL_ALIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib - --XMLSEC_NSS_SOLIBS = smime3.lib ssl3.lib nss3.lib libnspr4.lib libplds4.lib libplc4.lib kernel32.lib user32.lib gdi32.lib -+XMLSEC_NSS_SOLIBS = smime3.lib nss3.lib nspr4.lib kernel32.lib user32.lib gdi32.lib - XMLSEC_NSS_ALIBS = smime3.lib ssl3.lib nss3.lib libnspr4_s.lib libplds4_s.lib libplc4_s.lib kernel32.lib user32.lib gdi32.lib - - XMLSEC_MSCRYPTO_SOLIBS = kernel32.lib user32.lib gdi32.lib Crypt32.lib Advapi32.lib diff --git a/libxmlsec/xmlsec1-configure-libxml-libxslt.patch b/libxmlsec/xmlsec1-configure-libxml-libxslt.patch new file mode 100644 index 0000000..fdf39ad --- /dev/null +++ b/libxmlsec/xmlsec1-configure-libxml-libxslt.patch @@ -0,0 +1,40 @@ +--- misc/xmlsec1-1.2.14/configure Wed Jun 30 11:55:36 2010 ++++ misc/build/xmlsec1-1.2.14/configure Wed Jun 30 11:57:28 2010 +@@ -12077,7 +12077,7 @@ + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-as_dummy="$with_libxml/bin:$PATH" ++as_dummy="$with_libxml${with_libxml:+/bin:}$PATH" + for as_dir in $as_dummy + do + IFS=$as_save_IFS +@@ -12258,7 +12258,7 @@ + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-as_dummy="$with_libxslt/bin:$PATH" ++as_dummy="$with_libxslt${with_libxslt:+/bin:}$PATH" + for as_dir in $as_dummy + do + IFS=$as_save_IFS +--- misc/xmlsec1-1.2.14/configure.in Wed Jun 30 11:55:37 2010 ++++ misc/build/xmlsec1-1.2.14/configure.in Wed Jun 30 11:53:55 2010 +@@ -231,7 +231,7 @@ + if test "z$LIBXML_FOUND" = "zno" ; then + if test "z$with_libxml" != "zyes" ; then + AC_PATH_PROG([LIBXML_CONFIG], [$LIBXML_CONFIG], [], +- [$with_libxml/bin:$PATH]) ++ [$with_libxml${with_libxml:+/bin:}$PATH]) + fi + AC_MSG_CHECKING([libxml2 $LIBXML_CONFIG ]) + if ! LIBXML_VERSION=`$LIBXML_CONFIG --version 2>/dev/null`; then +@@ -296,7 +296,7 @@ + if test "z$LIBXSLT_FOUND" = "zno" ; then + if test "z$with_libxslt" != "zyes" ; then + AC_PATH_PROG([LIBXSLT_CONFIG], [$LIBXSLT_CONFIG], [], +- [$with_libxslt/bin:$PATH]) ++ [$with_libxslt${with_libxslt:+/bin:}:$PATH]) + fi + AC_MSG_CHECKING(for libxslt libraries >= $LIBXSLT_MIN_VERSION) + if ! LIBXSLT_VERSION=`$LIBXSLT_CONFIG --version 2>/dev/null`; then diff --git a/libxmlsec/xmlsec1-configure.patch b/libxmlsec/xmlsec1-configure.patch new file mode 100644 index 0000000..943ac98 --- /dev/null +++ b/libxmlsec/xmlsec1-configure.patch @@ -0,0 +1,747 @@ +--- misc/xmlsec1-1.2.14/Makefile.in 2009-06-25 22:53:34.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/Makefile.in 2009-10-01 10:32:48.708515261 +0200 +@@ -341,8 +341,9 @@ + top_srcdir = @top_srcdir@ + NULL = + SAFE_VERSION = @XMLSEC_VERSION_SAFE@ +-SUBDIRS = include src apps man docs +-TEST_APP = apps/xmlsec1$(EXEEXT) ++#Do not build xmlsec1 app. It is not needed. Also the libtool includes ++#a -L/path_to_lib_dir which may contain an incompatible lixbml2. ++SUBDIRS = include src man docs + DEFAULT_CRYPTO = @XMLSEC_CRYPTO@ + bin_SCRIPTS = xmlsec1-config + pkgconfig_DATA = xmlsec1.pc @XMLSEC_CRYPTO_PC_FILES_LIST@ +--- misc/xmlsec1-1.2.14/configure 2009-06-25 22:53:35.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/configure 2009-10-01 10:28:50.980389049 +0200 +@@ -1,12 +1,14 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.64 for xmlsec1 1.2.14. ++# Generated by GNU Autoconf 2.65 for xmlsec1 1.2.14. + # + # Report bugs to <http://www.aleksey.com/xmlsec>. + # ++# + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software +-# Foundation, Inc. ++# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, ++# Inc. ++# + # + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. +@@ -676,7 +678,8 @@ + + + +-exec 7<&0 </dev/null 6>&1 ++test -n "$DJDIR" || exec 7<&0 </dev/null ++exec 6>&1 + + # Name of the host. + # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +@@ -1749,7 +1752,7 @@ + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> +- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if ++ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CPP C preprocessor + PKG_CONFIG path to pkg-config utility +@@ -1837,7 +1840,7 @@ + if $ac_init_version; then + cat <<\_ACEOF + xmlsec1 configure 1.2.14 +-generated by GNU Autoconf 2.64 ++generated by GNU Autoconf 2.65 + + Copyright (C) 2009 Free Software Foundation, Inc. + This configure script is free software; the Free Software Foundation +@@ -1884,7 +1887,7 @@ + ac_retval=1 + fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +- return $ac_retval ++ as_fn_set_status $ac_retval + + } # ac_fn_c_try_compile + +@@ -1921,7 +1924,7 @@ + ac_retval=1 + fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +- return $ac_retval ++ as_fn_set_status $ac_retval + + } # ac_fn_c_try_cpp + +@@ -1963,7 +1966,7 @@ + fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +- return $ac_retval ++ as_fn_set_status $ac_retval + + } # ac_fn_c_try_run + +@@ -2009,7 +2012,7 @@ + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +- return $ac_retval ++ as_fn_set_status $ac_retval + + } # ac_fn_c_try_link + +@@ -2378,7 +2381,7 @@ + + fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} +- return $ac_retval ++ as_fn_set_status $ac_retval + + } # ac_fn_c_compute_int + cat >config.log <<_ACEOF +@@ -2386,7 +2389,7 @@ + running configure, to aid debugging if configure makes a mistake. + + It was created by xmlsec1 $as_me 1.2.14, which was +-generated by GNU Autoconf 2.64. Invocation command line was ++generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +@@ -2639,7 +2642,7 @@ + for ac_site_file in "$ac_site_file1" "$ac_site_file2" + do + test "x$ac_site_file" = xNONE && continue +- if test -r "$ac_site_file"; then ++ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 + $as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 +@@ -2648,9 +2651,9 @@ + done + + if test -r "$cache_file"; then +- # Some versions of bash will fail to source /dev/null (special +- # files actually), so we avoid doing that. +- if test -f "$cache_file"; then ++ # Some versions of bash will fail to source /dev/null (special files ++ # actually), so we avoid doing that. DJGPP emulates it as a regular file. ++ if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 + $as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in +@@ -3160,6 +3163,7 @@ + + fi + ++ test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else +@@ -3167,7 +3171,6 @@ + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. +- test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi + fi +@@ -3753,32 +3756,30 @@ + ... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 +- rm -f conftest.er1 conftest.err + fi ++ rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + done + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-#include <stdio.h> ++ + int + main () + { +-FILE *f = fopen ("conftest.out", "w"); +- return ferror (f) || fclose (f) != 0; + + ; + return 0; + } + _ACEOF + ac_clean_files_save=$ac_clean_files +-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" ++ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" + # Try to create an executable without -o first, disregard a.out. + # It will help us diagnose broken compilers, and finding out an intuition + # of exeext. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +-$as_echo_n "checking for C compiler default output file name... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 ++$as_echo_n "checking whether the C compiler works... " >&6; } + ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + + # The possible output files: +@@ -3840,10 +3841,10 @@ + else + ac_file='' + fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +-$as_echo "$ac_file" >&6; } + if test -z "$ac_file"; then : +- $as_echo "$as_me: failed program was:" >&5 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++$as_echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +@@ -3851,51 +3852,18 @@ + { as_fn_set_status 77 + as_fn_error "C compiler cannot create executables + See \`config.log' for more details." "$LINENO" 5; }; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } + fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 ++$as_echo_n "checking for C compiler default output file name... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 ++$as_echo "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext + +-# Check that the compiler produces executables we can run. If not, either +-# the compiler is broken, or we cross compile. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +-$as_echo_n "checking whether the C compiler works... " >&6; } +-# If not cross compiling, check that we can run a simple program. +-if test "$cross_compiling" != yes; then +- if { ac_try='./$ac_file' +- { { case "(($ac_try" in +- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; +- *) ac_try_echo=$ac_try;; +-esac +-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +-$as_echo "$ac_try_echo"; } >&5 +- (eval "$ac_try") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; }; then +- cross_compiling=no +- else +- if test "$cross_compiling" = maybe; then +- cross_compiling=yes +- else +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error "cannot run C compiled programs. +-If you meant to cross compile, use \`--host'. +-See \`config.log' for more details." "$LINENO" 5; } +- fi +- fi +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- +-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out ++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out + ac_clean_files=$ac_clean_files_save +-# Check that the compiler produces executables we can run. If not, either +-# the compiler is broken, or we cross compile. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +-$as_echo_n "checking whether we are cross compiling... " >&6; } +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +-$as_echo "$cross_compiling" >&6; } +- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 + $as_echo_n "checking for suffix of executables... " >&6; } + if { { ac_try="$ac_link" +@@ -3928,13 +3896,72 @@ + as_fn_error "cannot compute suffix of executables: cannot compile and link + See \`config.log' for more details." "$LINENO" 5; } + fi +-rm -f conftest$ac_cv_exeext ++rm -f conftest conftest$ac_cv_exeext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 + $as_echo "$ac_cv_exeext" >&6; } + + rm -f conftest.$ac_ext + EXEEXT=$ac_cv_exeext + ac_exeext=$EXEEXT ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <stdio.h> ++int ++main () ++{ ++FILE *f = fopen ("conftest.out", "w"); ++ return ferror (f) || fclose (f) != 0; ++ ++ ; ++ return 0; ++} ++_ACEOF ++ac_clean_files="$ac_clean_files conftest.out" ++# Check that the compiler produces executables we can run. If not, either ++# the compiler is broken, or we cross compile. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 ++$as_echo_n "checking whether we are cross compiling... " >&6; } ++if test "$cross_compiling" != yes; then ++ { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if { ac_try='./conftest$ac_cv_exeext' ++ { { case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ cross_compiling=no ++ else ++ if test "$cross_compiling" = maybe; then ++ cross_compiling=yes ++ else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error "cannot run C compiled programs. ++If you meant to cross compile, use \`--host'. ++See \`config.log' for more details." "$LINENO" 5; } ++ fi ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 ++$as_echo "$cross_compiling" >&6; } ++ ++rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ++ac_clean_files=$ac_clean_files_save + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 + $as_echo_n "checking for suffix of object files... " >&6; } + if test "${ac_cv_objext+set}" = set; then : +@@ -5249,13 +5276,13 @@ + else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext +- (eval echo "\"\$as_me:5252: $ac_compile\"" >&5) ++ (eval echo "\"\$as_me:5279: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 +- (eval echo "\"\$as_me:5255: $NM \\\"conftest.$ac_objext\\\"\"" >&5) ++ (eval echo "\"\$as_me:5282: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 +- (eval echo "\"\$as_me:5258: output\"" >&5) ++ (eval echo "\"\$as_me:5285: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" +@@ -6460,7 +6487,7 @@ + ;; + *-*-irix6*) + # Find out which ABI we are using. +- echo '#line 6463 "configure"' > conftest.$ac_ext ++ echo '#line 6490 "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? +@@ -7736,11 +7763,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:7739: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:7766: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:7743: \$? = $ac_status" >&5 ++ echo "$as_me:7770: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -8075,11 +8102,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8078: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8105: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 +- echo "$as_me:8082: \$? = $ac_status" >&5 ++ echo "$as_me:8109: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. +@@ -8180,11 +8207,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8183: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8210: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:8187: \$? = $ac_status" >&5 ++ echo "$as_me:8214: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -8235,11 +8262,11 @@ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` +- (eval echo "\"\$as_me:8238: $lt_compile\"" >&5) ++ (eval echo "\"\$as_me:8265: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 +- echo "$as_me:8242: \$? = $ac_status" >&5 ++ echo "$as_me:8269: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized +@@ -10618,7 +10645,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10621 "configure" ++#line 10648 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10714,7 +10741,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10717 "configure" ++#line 10744 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -11804,8 +11831,12 @@ + fi + fi + +-LIBXML_MIN_VERSION="2.7.4" + LIBXML_CONFIG="xml2-config" ++if test -f "$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xml2-config" ; then ++ LIBXML_CONFIG="$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xml2-config" ++else ++ LIBXML_CONFIG="xml2-config" ++fi + LIBXML_CFLAGS="" + LIBXML_LIBS="" + LIBXML_FOUND="no" +@@ -12757,12 +12788,26 @@ + + XMLSEC_NO_NSS="1" + MOZILLA_MIN_VERSION="1.4" ++if test "z$MOZ_FLAVOUR" = "zfirefox" ; then ++ MOZILLA_MIN_VERSION="1.0" ++fi + NSS_MIN_VERSION="3.2" + NSPR_MIN_VERSION="4.0" + NSS_CFLAGS="" + NSS_LIBS="" +-NSS_LIBS_LIST="-lnss3 -lsmime3" +-NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" ++ ++case $host_os in ++cygwin* | mingw* | pw32*) ++ NSS_LIBS_LIST="-lnss3 -lsmime3" ++ NSPR_LIBS_LIST="-lnspr4" ++ ;; ++ ++*) ++ NSS_LIBS_LIST="-lnss3 -lsoftokn3 -lsmime3" ++ NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" ++ ;; ++esac ++ + NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss" + NSS_FOUND="no" + NSPR_PACKAGE=mozilla-nspr +@@ -12811,6 +12856,79 @@ + pkg_cv_NSS_CFLAGS="$NSS_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$MOZ_FLAVOUR-nspr >= \$MOZILLA_MIN_VERSION \$MOZ_FLAVOUR >= \$MOZILLA_MIN_VERSION\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_NSS_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION" 2>/dev/null` ++else ++ pkg_failed=yes ++fi ++ fi ++else ++ pkg_failed=untried ++fi ++if test -n "$PKG_CONFIG"; then ++ if test -n "$NSS_LIBS"; then ++ pkg_cv_NSS_LIBS="$NSS_LIBS" ++ else ++ if test -n "$PKG_CONFIG" && \ ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$MOZ_FLAVOUR-nspr >= \$MOZILLA_MIN_VERSION \$MOZ_FLAVOUR >= \$MOZILLA_MIN_VERSION\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ pkg_cv_NSS_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION" 2>/dev/null` ++else ++ pkg_failed=yes ++fi ++ fi ++else ++ pkg_failed=untried ++fi ++ ++ ++ ++if test $pkg_failed = yes; then ++ ++if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then ++ _pkg_short_errors_supported=yes ++else ++ _pkg_short_errors_supported=no ++fi ++ if test $_pkg_short_errors_supported = yes; then ++ NSS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION"` ++ else ++ NSS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION"` ++ fi ++ # Put the nasty error message in config.log where it belongs ++ echo "$NSS_PKG_ERRORS" >&5 ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ NSS_FOUND=no ++elif test $pkg_failed = untried; then ++ NSS_FOUND=no ++else ++ NSS_CFLAGS=$pkg_cv_NSS_CFLAGS ++ NSS_LIBS=$pkg_cv_NSS_LIBS ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ NSS_FOUND=yes NSPR_PACKAGE=$MOZ_FLAVOUR-nspr NSS_PACKAGE=$MOZ_FLAVOUR-nss ++fi ++ fi ++ if test "z$NSS_FOUND" = "zno" ; then ++ ++pkg_failed=no ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSS" >&5 ++$as_echo_n "checking for NSS... " >&6; } ++ ++if test -n "$PKG_CONFIG"; then ++ if test -n "$NSS_CFLAGS"; then ++ pkg_cv_NSS_CFLAGS="$NSS_CFLAGS" ++ else ++ if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mozilla-nspr >= \$MOZILLA_MIN_VERSION mozilla-nss >= \$MOZILLA_MIN_VERSION\""; } >&5 + ($PKG_CONFIG --exists --print-errors "mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION") 2>&5 + ac_status=$? +@@ -13030,8 +13148,8 @@ + ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION + fi + +- ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name" +- ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name" ++ ac_nss_lib_dir="${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT}" ++ ac_nss_inc_dir="${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/mozilla" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nspr libraries >= $NSPR_MIN_VERSION" >&5 + $as_echo_n "checking for nspr libraries >= $NSPR_MIN_VERSION... " >&6; } +@@ -13066,7 +13184,7 @@ + done + + for dir in $ac_nss_lib_dir ; do +- if test -f $dir/libnspr4$shrext ; then ++ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then + if test "z$dir" = "z/usr/lib" ; then + NSPR_LIBS="$NSPR_LIBS_LIST" + else +@@ -13148,7 +13266,7 @@ + done + + for dir in $ac_nss_lib_dir ; do +- if test -f $dir/libnss3$shrext ; then ++ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then + if test "z$dir" = "z/usr/lib" ; then + NSS_LIBS="$NSS_LIBS_LIST" + else +@@ -15036,7 +15154,7 @@ + # values after options handling. + ac_log=" + This file was extended by xmlsec1 $as_me 1.2.14, which was +-generated by GNU Autoconf 2.64. Invocation command line was ++generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS +@@ -15076,6 +15194,7 @@ + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit ++ --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files +@@ -15098,10 +15217,11 @@ + + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ + xmlsec1 config.status 1.2.14 +-configured by $0, generated by GNU Autoconf 2.64, +- with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" ++configured by $0, generated by GNU Autoconf 2.65, ++ with options \\"\$ac_cs_config\\" + + Copyright (C) 2009 Free Software Foundation, Inc. + This config.status script is free software; the Free Software Foundation +@@ -15139,6 +15259,8 @@ + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; ++ --config | --confi | --conf | --con | --co | --c ) ++ $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) +@@ -15606,7 +15728,7 @@ + t delim + :nl + h +-s/\(.\{148\}\).*/\1/ ++s/\(.\{148\}\)..*/\1/ + t more1 + s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ + p +@@ -15620,7 +15742,7 @@ + t nl + :delim + h +-s/\(.\{148\}\).*/\1/ ++s/\(.\{148\}\)..*/\1/ + t more2 + s/["\\]/\\&/g; s/^/"/; s/$/"/ + p +--- misc/xmlsec1-1.2.14/configure.in 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/configure.in 2009-10-01 10:28:50.990755126 +0200 +@@ -190,8 +190,12 @@ + dnl ========================================================================== + dnl find libxml + dnl ========================================================================== +-LIBXML_MIN_VERSION="2.7.4" + LIBXML_CONFIG="xml2-config" ++if test -f "$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xml2-config" ; then ++ LIBXML_CONFIG="$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xml2-config" ++else ++ LIBXML_CONFIG="xml2-config" ++fi + LIBXML_CFLAGS="" + LIBXML_LIBS="" + LIBXML_FOUND="no" +@@ -555,12 +559,26 @@ + + XMLSEC_NO_NSS="1" + MOZILLA_MIN_VERSION="1.4" ++if test "z$MOZ_FLAVOUR" = "zfirefox" ; then ++ MOZILLA_MIN_VERSION="1.0" ++fi + NSS_MIN_VERSION="3.2" + NSPR_MIN_VERSION="4.0" + NSS_CFLAGS="" + NSS_LIBS="" +-NSS_LIBS_LIST="-lnss3 -lsmime3" +-NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" ++ ++case $host_os in ++cygwin* | mingw* | pw32*) ++ NSS_LIBS_LIST="-lnss3 -lsmime3" ++ NSPR_LIBS_LIST="-lnspr4" ++ ;; ++ ++*) ++ NSS_LIBS_LIST="-lnss3 -lsoftokn3 -lsmime3" ++ NSPR_LIBS_LIST="-lnspr4 -lplds4 -lplc4" ++ ;; ++esac ++ + NSS_CRYPTO_LIB="$XMLSEC_PACKAGE-nss" + NSS_FOUND="no" + NSPR_PACKAGE=mozilla-nspr +@@ -586,6 +604,11 @@ + dnl We are going to try all options + dnl + if test "z$NSS_FOUND" = "zno" ; then ++ PKG_CHECK_MODULES(NSS, $MOZ_FLAVOUR-nspr >= $MOZILLA_MIN_VERSION $MOZ_FLAVOUR >= $MOZILLA_MIN_VERSION, ++ [NSS_FOUND=yes NSPR_PACKAGE=$MOZ_FLAVOUR-nspr NSS_PACKAGE=$MOZ_FLAVOUR-nss], ++ [NSS_FOUND=no]) ++ fi ++ if test "z$NSS_FOUND" = "zno" ; then + PKG_CHECK_MODULES(NSS, mozilla-nspr >= $MOZILLA_MIN_VERSION mozilla-nss >= $MOZILLA_MIN_VERSION, + [NSS_FOUND=yes NSPR_PACKAGE=mozilla-nspr NSS_PACKAGE=mozilla-nss], + [NSS_FOUND=no]) +@@ -612,8 +635,8 @@ + ac_mozilla_name=mozilla-$MOZILLA_MIN_VERSION + fi + +- ac_nss_lib_dir="/usr/lib /usr/lib64 /usr/local/lib /usr/lib/$ac_mozilla_name /usr/local/lib/$ac_mozilla_name" +- ac_nss_inc_dir="/usr/include /usr/include/mozilla /usr/local/include /usr/local/include/mozilla /usr/include/$ac_mozilla_name /usr/local/include/$ac_mozilla_name" ++ ac_nss_lib_dir="${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT}" ++ ac_nss_inc_dir="${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/mozilla" + + AC_MSG_CHECKING(for nspr libraries >= $NSPR_MIN_VERSION) + NSPR_INCLUDES_FOUND="no" +@@ -648,7 +671,7 @@ + done + + for dir in $ac_nss_lib_dir ; do +- if test -f $dir/libnspr4$shrext ; then ++ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then + dnl do not add -L/usr/lib because compiler does it anyway + if test "z$dir" = "z/usr/lib" ; then + NSPR_LIBS="$NSPR_LIBS_LIST" +@@ -719,7 +742,7 @@ + done + + for dir in $ac_nss_lib_dir ; do +- if test -f $dir/libnss3$shrext ; then ++ if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then + dnl do not add -L/usr/lib because compiler does it anyway + if test "z$dir" = "z/usr/lib" ; then + NSS_LIBS="$NSS_LIBS_LIST" +--- misc/xmlsec1-1.2.14/win32/Makefile.msvc 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/win32/Makefile.msvc 2009-10-01 10:28:50.997747312 +0200 +@@ -376,7 +376,7 @@ + XMLSEC_OPENSSL_SOLIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib + XMLSEC_OPENSSL_ALIBS = libeay32.lib wsock32.lib kernel32.lib user32.lib gdi32.lib + +-XMLSEC_NSS_SOLIBS = smime3.lib ssl3.lib nss3.lib libnspr4.lib libplds4.lib libplc4.lib kernel32.lib user32.lib gdi32.lib ++XMLSEC_NSS_SOLIBS = smime3.lib nss3.lib nspr4.lib kernel32.lib user32.lib gdi32.lib + XMLSEC_NSS_ALIBS = smime3.lib ssl3.lib nss3.lib libnspr4_s.lib libplds4_s.lib libplc4_s.lib kernel32.lib user32.lib gdi32.lib + + XMLSEC_MSCRYPTO_SOLIBS = kernel32.lib user32.lib gdi32.lib Crypt32.lib Advapi32.lib diff --git a/libxmlsec/xmlsec1-customkeymanage.patch b/libxmlsec/xmlsec1-customkeymanage.patch new file mode 100644 index 0000000..8bc97c4 --- /dev/null +++ b/libxmlsec/xmlsec1-customkeymanage.patch @@ -0,0 +1,6065 @@ +--- misc/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.am 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.am 2009-09-21 14:02:48.563253008 +0200 +@@ -3,6 +3,7 @@ + xmlsecmscryptoincdir = $(includedir)/xmlsec1/xmlsec/mscrypto + + xmlsecmscryptoinc_HEADERS = \ ++akmngr.h \ + app.h \ + certkeys.h \ + crypto.h \ +--- misc/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.in 2009-06-25 22:53:30.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/mscrypto/Makefile.in 2009-09-21 14:02:48.571021349 +0200 +@@ -281,6 +281,7 @@ + NULL = + xmlsecmscryptoincdir = $(includedir)/xmlsec1/xmlsec/mscrypto + xmlsecmscryptoinc_HEADERS = \ ++akmngr.h \ + app.h \ + certkeys.h \ + crypto.h \ +--- misc/xmlsec1-1.2.14/include/xmlsec/mscrypto/akmngr.h 2009-09-21 14:07:19.052318336 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/mscrypto/akmngr.h 2009-09-21 14:02:48.504966762 +0200 +@@ -1 +1,71 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright .......................... ++ */ ++#ifndef __XMLSEC_MSCRYPTO_AKMNGR_H__ ++#define __XMLSEC_MSCRYPTO_AKMNGR_H__ ++ ++#include <windows.h> ++#include <wincrypt.h> ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/keys.h> ++#include <xmlsec/transforms.h> ++ ++#ifdef __cplusplus ++extern "C" { ++#endif /* __cplusplus */ ++ ++XMLSEC_CRYPTO_EXPORT xmlSecKeysMngrPtr ++xmlSecMSCryptoAppliedKeysMngrCreate( ++ HCERTSTORE keyStore , ++ HCERTSTORE certStore ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ HCRYPTKEY symKey ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ HCRYPTKEY pubKey ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ HCRYPTKEY priKey ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore ( ++ xmlSecKeysMngrPtr mngr , ++ HCERTSTORE keyStore ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore ( ++ xmlSecKeysMngrPtr mngr , ++ HCERTSTORE trustedStore ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore ( ++ xmlSecKeysMngrPtr mngr , ++ HCERTSTORE untrustedStore ++) ; ++ ++#ifdef __cplusplus ++} ++#endif /* __cplusplus */ ++ ++#endif /* __XMLSEC_MSCRYPTO_AKMNGR_H__ */ ++ ++ +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.am 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.am 2009-09-21 14:02:48.577933031 +0200 +@@ -10,6 +10,9 @@ + keysstore.h \ + pkikeys.h \ + x509.h \ ++akmngr.h \ ++tokens.h \ ++ciphers.h \ + $(NULL) + + install-exec-hook: +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.in 2009-06-25 22:53:31.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/Makefile.in 2009-09-21 14:02:48.585376325 +0200 +@@ -288,6 +288,9 @@ + keysstore.h \ + pkikeys.h \ + x509.h \ ++akmngr.h \ ++tokens.h \ ++ciphers.h \ + $(NULL) + + all: all-am +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/akmngr.h 2009-09-21 14:07:19.105517659 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/akmngr.h 2009-09-21 14:02:48.510978278 +0200 +@@ -1 +1,56 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright .......................... ++ */ ++#ifndef __XMLSEC_NSS_AKMNGR_H__ ++#define __XMLSEC_NSS_AKMNGR_H__ ++ ++#include <nss.h> ++#include <nspr.h> ++#include <pk11func.h> ++#include <cert.h> ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/keys.h> ++#include <xmlsec/transforms.h> ++ ++#ifdef __cplusplus ++extern "C" { ++#endif /* __cplusplus */ ++ ++XMLSEC_CRYPTO_EXPORT xmlSecKeysMngrPtr ++xmlSecNssAppliedKeysMngrCreate( ++ PK11SlotInfo** slots, ++ int cSlots, ++ CERTCertDBHandle* handler ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssAppliedKeysMngrSymKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ PK11SymKey* symKey ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssAppliedKeysMngrPubKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ SECKEYPublicKey* pubKey ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssAppliedKeysMngrPriKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ SECKEYPrivateKey* priKey ++) ; ++ ++#ifdef __cplusplus ++} ++#endif /* __cplusplus */ ++ ++#endif /* __XMLSEC_NSS_AKMNGR_H__ */ ++ ++ +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/app.h 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/app.h 2009-09-21 14:02:48.612847068 +0200 +@@ -22,6 +22,9 @@ + #include <xmlsec/keysmngr.h> + #include <xmlsec/transforms.h> + ++#include <xmlsec/nss/tokens.h> ++#include <xmlsec/nss/akmngr.h> ++ + /** + * Init/shutdown + */ +@@ -36,6 +39,8 @@ + xmlSecKeyPtr key); + XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrLoad (xmlSecKeysMngrPtr mngr, + const char* uri); ++XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrAdoptKeySlot(xmlSecKeysMngrPtr mngr, ++ xmlSecNssKeySlotPtr keySlot); + XMLSEC_CRYPTO_EXPORT int xmlSecNssAppDefaultKeysMngrSave (xmlSecKeysMngrPtr mngr, + const char* filename, + xmlSecKeyDataType type); +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/ciphers.h 2009-09-21 14:07:19.146496548 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/ciphers.h 2009-09-21 14:02:48.516689712 +0200 +@@ -1 +1,35 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright .......................... ++ */ ++#ifndef __XMLSEC_NSS_CIPHERS_H__ ++#define __XMLSEC_NSS_CIPHERS_H__ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif /* __cplusplus */ ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/keys.h> ++#include <xmlsec/transforms.h> ++ ++ ++XMLSEC_CRYPTO_EXPORT int xmlSecNssSymKeyDataAdoptKey( xmlSecKeyDataPtr data, ++ PK11SymKey* symkey ) ; ++ ++XMLSEC_CRYPTO_EXPORT xmlSecKeyDataPtr xmlSecNssSymKeyDataKeyAdopt( PK11SymKey* symKey ) ; ++ ++XMLSEC_CRYPTO_EXPORT PK11SymKey* xmlSecNssSymKeyDataGetKey(xmlSecKeyDataPtr data); ++ ++ ++#ifdef __cplusplus ++} ++#endif /* __cplusplus */ ++ ++#endif /* __XMLSEC_NSS_CIPHERS_H__ */ ++ ++ +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/keysstore.h 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/keysstore.h 2009-09-21 14:02:48.626261748 +0200 +@@ -16,6 +16,8 @@ + #endif /* __cplusplus */ + + #include <xmlsec/xmlsec.h> ++#include <xmlsec/keysmngr.h> ++#include <xmlsec/nss/tokens.h> + + /**************************************************************************** + * +@@ -31,6 +33,8 @@ + XMLSEC_CRYPTO_EXPORT xmlSecKeyStoreId xmlSecNssKeysStoreGetKlass (void); + XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKey (xmlSecKeyStorePtr store, + xmlSecKeyPtr key); ++XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreAdoptKeySlot(xmlSecKeyStorePtr store, ++ xmlSecNssKeySlotPtr keySlot); + XMLSEC_CRYPTO_EXPORT int xmlSecNssKeysStoreLoad (xmlSecKeyStorePtr store, + const char *uri, + xmlSecKeysMngrPtr keysMngr); +--- misc/xmlsec1-1.2.14/include/xmlsec/nss/tokens.h 2009-09-21 14:07:19.172421448 +0200 ++++ misc/build/xmlsec1-1.2.14/include/xmlsec/nss/tokens.h 2009-09-21 14:02:48.522913605 +0200 +@@ -1 +1,182 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright (c) 2003 Sun Microsystems, Inc. All rights reserved. ++ * ++ * Contributor(s): _____________________________ ++ * ++ */ ++#ifndef __XMLSEC_NSS_TOKENS_H__ ++#define __XMLSEC_NSS_TOKENS_H__ ++ ++#include <string.h> ++ ++#include <nss.h> ++#include <pk11func.h> ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/list.h> ++ ++#ifdef __cplusplus ++extern "C" { ++#endif /* __cplusplus */ ++ ++/** ++ * xmlSecNssKeySlotListId ++ * ++ * The crypto mechanism list klass ++ */ ++#define xmlSecNssKeySlotListId xmlSecNssKeySlotListGetKlass() ++XMLSEC_CRYPTO_EXPORT xmlSecPtrListId xmlSecNssKeySlotListGetKlass( void ) ; ++ ++/******************************************* ++ * KeySlot interfaces ++ *******************************************/ ++/** ++ * Internal NSS key slot data ++ * @mechanismList: the mechanisms that the slot bound with. ++ * @slot: the pkcs slot ++ * ++ * This context is located after xmlSecPtrList ++ */ ++typedef struct _xmlSecNssKeySlot xmlSecNssKeySlot ; ++typedef struct _xmlSecNssKeySlot* xmlSecNssKeySlotPtr ; ++ ++struct _xmlSecNssKeySlot { ++ CK_MECHANISM_TYPE_PTR mechanismList ; /* mech. array, NULL ternimated */ ++ PK11SlotInfo* slot ; ++} ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotSetMechList( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE_PTR mechanismList ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotEnableMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE mechanism ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotDisableMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE mechanism ++) ; ++ ++XMLSEC_CRYPTO_EXPORT CK_MECHANISM_TYPE_PTR ++xmlSecNssKeySlotGetMechList( ++ xmlSecNssKeySlotPtr keySlot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotSetSlot( ++ xmlSecNssKeySlotPtr keySlot , ++ PK11SlotInfo* slot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotInitialize( ++ xmlSecNssKeySlotPtr keySlot , ++ PK11SlotInfo* slot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT void ++xmlSecNssKeySlotFinalize( ++ xmlSecNssKeySlotPtr keySlot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT PK11SlotInfo* ++xmlSecNssKeySlotGetSlot( ++ xmlSecNssKeySlotPtr keySlot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT xmlSecNssKeySlotPtr ++xmlSecNssKeySlotCreate() ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotCopy( ++ xmlSecNssKeySlotPtr newKeySlot , ++ xmlSecNssKeySlotPtr keySlot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT xmlSecNssKeySlotPtr ++xmlSecNssKeySlotDuplicate( ++ xmlSecNssKeySlotPtr keySlot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT void ++xmlSecNssKeySlotDestroy( ++ xmlSecNssKeySlotPtr keySlot ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotBindMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE type ++) ; ++ ++XMLSEC_CRYPTO_EXPORT int ++xmlSecNssKeySlotSupportMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE type ++) ; ++ ++ ++/************************************************************************ ++ * PKCS#11 crypto token interfaces ++ * ++ * A PKCS#11 slot repository will be defined internally. From the ++ * repository, a user can specify a particular slot for a certain crypto ++ * mechanism. ++ * ++ * In some situation, some cryptographic operation should act in a user ++ * designated devices. The interfaces defined here provide the way. If ++ * the user do not initialize the repository distinctly, the interfaces ++ * use the default functions provided by NSS itself. ++ * ++ ************************************************************************/ ++/** ++ * Initialize NSS pkcs#11 slot repository ++ * ++ * Returns 0 if success or -1 if an error occurs. ++ */ ++XMLSEC_CRYPTO_EXPORT int xmlSecNssSlotInitialize( void ) ; ++ ++/** ++ * Shutdown and destroy NSS pkcs#11 slot repository ++ */ ++XMLSEC_CRYPTO_EXPORT void xmlSecNssSlotShutdown() ; ++ ++/** ++ * Get PKCS#11 slot handler ++ * @type the mechanism that the slot must support. ++ * ++ * Returns a pointer to PKCS#11 slot or NULL if an error occurs. ++ * ++ * Notes: The returned handler must be destroied distinctly. ++ */ ++XMLSEC_CRYPTO_EXPORT PK11SlotInfo* xmlSecNssSlotGet( CK_MECHANISM_TYPE type ) ; ++ ++/** ++ * Adopt a pkcs#11 slot with a mechanism into the repository ++ * @slot: the pkcs#11 slot. ++ * @mech: the mechanism. ++ * ++ * If @mech is available( @mech != CKM_INVALID_MECHANISM ), every operation with ++ * this mechanism only can perform on the @slot. ++ * ++ * Returns 0 if success or -1 if an error occurs. ++ */ ++XMLSEC_CRYPTO_EXPORT int xmlSecNssSlotAdopt( PK11SlotInfo* slot, CK_MECHANISM_TYPE mech ) ; ++ ++#ifdef __cplusplus ++} ++#endif /* __cplusplus */ ++ ++#endif /* __XMLSEC_NSS_TOKENS_H__ */ ++ +--- misc/xmlsec1-1.2.14/src/mscrypto/akmngr.c 2009-09-21 14:07:19.078910929 +0200 ++++ misc/build/xmlsec1-1.2.14/src/mscrypto/akmngr.c 2009-09-21 14:02:48.531281225 +0200 +@@ -1 +1,236 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright......................... ++ */ ++#include "globals.h" ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/keys.h> ++#include <xmlsec/keysmngr.h> ++#include <xmlsec/transforms.h> ++#include <xmlsec/errors.h> ++ ++#include <xmlsec/mscrypto/crypto.h> ++#include <xmlsec/mscrypto/keysstore.h> ++#include <xmlsec/mscrypto/akmngr.h> ++#include <xmlsec/mscrypto/x509.h> ++ ++/** ++ * xmlSecMSCryptoAppliedKeysMngrCreate: ++ * @hKeyStore: the pointer to key store. ++ * @hCertStore: the pointer to certificate database. ++ * ++ * Create and load key store and certificate database into keys manager ++ * ++ * Returns keys manager pointer on success or NULL otherwise. ++ */ ++xmlSecKeysMngrPtr ++xmlSecMSCryptoAppliedKeysMngrCreate( ++ HCERTSTORE hKeyStore , ++ HCERTSTORE hCertStore ++) { ++ xmlSecKeyDataStorePtr certStore = NULL ; ++ xmlSecKeysMngrPtr keyMngr = NULL ; ++ xmlSecKeyStorePtr keyStore = NULL ; ++ ++ keyStore = xmlSecKeyStoreCreate( xmlSecMSCryptoKeysStoreId ) ; ++ if( keyStore == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeyStoreCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * At present, MS Crypto engine do not provide a way to setup a key store. ++ */ ++ if( keyStore != NULL ) { ++ /*TODO: binding key store.*/ ++ } ++ ++ keyMngr = xmlSecKeysMngrCreate() ; ++ if( keyMngr == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Add key store to manager, from now on keys manager destroys the store if ++ * needed ++ */ ++ if( xmlSecKeysMngrAdoptKeysStore( keyMngr, keyStore ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecKeysMngrAdoptKeyStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ xmlSecKeysMngrDestroy( keyMngr ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Initialize crypto library specific data in keys manager ++ */ ++ if( xmlSecMSCryptoKeysMngrInit( keyMngr ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecMSCryptoKeysMngrInit" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeysMngrDestroy( keyMngr ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Set certificate databse to X509 key data store ++ */ ++ /*- ++ * At present, MS Crypto engine do not provide a way to setup a cert store. ++ */ ++ ++ /*- ++ * Set the getKey callback ++ */ ++ keyMngr->getKey = xmlSecKeysMngrGetKey ; ++ ++ return keyMngr ; ++} ++ ++int ++xmlSecMSCryptoAppliedKeysMngrSymKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ HCRYPTKEY symKey ++) { ++ /*TODO: import the key into keys manager.*/ ++ return(0) ; ++} ++ ++int ++xmlSecMSCryptoAppliedKeysMngrPubKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ HCRYPTKEY pubKey ++) { ++ /*TODO: import the key into keys manager.*/ ++ return(0) ; ++} ++ ++int ++xmlSecMSCryptoAppliedKeysMngrPriKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ HCRYPTKEY priKey ++) { ++ /*TODO: import the key into keys manager.*/ ++ return(0) ; ++} ++ ++int ++xmlSecMSCryptoAppliedKeysMngrAdoptKeyStore ( ++ xmlSecKeysMngrPtr mngr , ++ HCERTSTORE keyStore ++) { ++ xmlSecKeyDataStorePtr x509Store ; ++ ++ xmlSecAssert2( mngr != NULL, -1 ) ; ++ xmlSecAssert2( keyStore != NULL, -1 ) ; ++ ++ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ; ++ if( x509Store == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrGetDataStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ) ; ++ } ++ ++ if( xmlSecMSCryptoX509StoreAdoptKeyStore( x509Store, keyStore ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) , ++ "xmlSecMSCryptoX509StoreAdoptKeyStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ) ; ++ } ++ ++ return( 0 ) ; ++} ++ ++int ++xmlSecMSCryptoAppliedKeysMngrAdoptTrustedStore ( ++ xmlSecKeysMngrPtr mngr , ++ HCERTSTORE trustedStore ++) { ++ xmlSecKeyDataStorePtr x509Store ; ++ ++ xmlSecAssert2( mngr != NULL, -1 ) ; ++ xmlSecAssert2( trustedStore != NULL, -1 ) ; ++ ++ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ; ++ if( x509Store == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrGetDataStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ) ; ++ } ++ ++ if( xmlSecMSCryptoX509StoreAdoptTrustedStore( x509Store, trustedStore ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) , ++ "xmlSecMSCryptoX509StoreAdoptKeyStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ) ; ++ } ++ ++ return( 0 ) ; ++} ++ ++int ++xmlSecMSCryptoAppliedKeysMngrAdoptUntrustedStore ( ++ xmlSecKeysMngrPtr mngr , ++ HCERTSTORE untrustedStore ++) { ++ xmlSecKeyDataStorePtr x509Store ; ++ ++ xmlSecAssert2( mngr != NULL, -1 ) ; ++ xmlSecAssert2( untrustedStore != NULL, -1 ) ; ++ ++ x509Store = xmlSecKeysMngrGetDataStore( mngr, xmlSecMSCryptoX509StoreId ) ; ++ if( x509Store == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrGetDataStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ) ; ++ } ++ ++ if( xmlSecMSCryptoX509StoreAdoptUntrustedStore( x509Store, untrustedStore ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataStoreGetName( x509Store ) ) , ++ "xmlSecMSCryptoX509StoreAdoptKeyStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ) ; ++ } ++ ++ return( 0 ) ; ++} ++ +--- misc/xmlsec1-1.2.14/src/nss/Makefile.am 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/Makefile.am 2009-09-21 14:02:48.591560472 +0200 +@@ -35,6 +35,9 @@ + kw_des.c \ + kw_aes.c \ + globals.h \ ++ akmngr.c \ ++ keywrapers.c \ ++ tokens.c \ + $(NULL) + + if SHAREDLIB_HACK +--- misc/xmlsec1-1.2.14/src/nss/Makefile.in 2009-06-25 22:53:33.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/Makefile.in 2009-09-21 14:02:48.599339718 +0200 +@@ -72,7 +72,8 @@ + am__libxmlsec1_nss_la_SOURCES_DIST = app.c bignum.c ciphers.c crypto.c \ + digests.c hmac.c pkikeys.c signatures.c symkeys.c x509.c \ + x509vfy.c keysstore.c keytrans.c kw_des.c kw_aes.c globals.h \ +- ../strings.c ++ ../strings.c \ ++ akmngr.c keywrapers.c tokens.c + am__objects_1 = + @SHAREDLIB_HACK_TRUE@am__objects_2 = libxmlsec1_nss_la-strings.lo + am_libxmlsec1_nss_la_OBJECTS = libxmlsec1_nss_la-app.lo \ +@@ -83,6 +84,8 @@ + libxmlsec1_nss_la-x509.lo libxmlsec1_nss_la-x509vfy.lo \ + libxmlsec1_nss_la-keysstore.lo libxmlsec1_nss_la-keytrans.lo \ + libxmlsec1_nss_la-kw_des.lo libxmlsec1_nss_la-kw_aes.lo \ ++ libxmlsec1_nss_la-akmngr.lo libxmlsec1_nss_la-keywrapers.lo \ ++ libxmlsec1_nss_la-tokens.lo \ + $(am__objects_1) $(am__objects_2) + libxmlsec1_nss_la_OBJECTS = $(am_libxmlsec1_nss_la_OBJECTS) + libxmlsec1_nss_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +@@ -333,6 +336,7 @@ + libxmlsec1_nss_la_SOURCES = app.c bignum.c ciphers.c crypto.c \ + digests.c hmac.c pkikeys.c signatures.c symkeys.c x509.c \ + x509vfy.c keysstore.c keytrans.c kw_des.c kw_aes.c globals.h \ ++ akmngr.c keywrapers.c tokens.c \ + $(NULL) $(am__append_1) + libxmlsec1_nss_la_LIBADD = \ + ../libxmlsec1.la \ +@@ -439,6 +443,9 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-symkeys.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-x509.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-x509vfy.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-akmngr.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_nss_la-tokens.Plo@am__quote@ + + .c.o: + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@@ -468,6 +475,27 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-app.lo `test -f 'app.c' || echo '$(srcdir)/'`app.c + ++libxmlsec1_nss_la-akmngr.lo: akmngr.c ++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-akmngr.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Tpo" -c -o libxmlsec1_nss_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Tpo" "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_nss_la-akmngr.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='akmngr.c' object='libxmlsec1_nss_la-akmngr.lo' libtool=yes @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c ++ ++libxmlsec1_nss_la-keywrapers.lo: keywrapers.c ++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-keywrapers.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Tpo" -c -o libxmlsec1_nss_la-keywrapers.lo `test -f 'keywrapers.c' || echo '$(srcdir)/'`keywrapers.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Tpo" "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_nss_la-keywrapers.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keywrapers.c' object='libxmlsec1_nss_la-keywrapers.lo' libtool=yes @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-keywrapers.lo `test -f 'keywrapers.c' || echo '$(srcdir)/'`keywrapers.c ++ ++libxmlsec1_nss_la-tokens.lo: tokens.c ++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-tokens.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_nss_la-tokens.Tpo" -c -o libxmlsec1_nss_la-tokens.lo `test -f 'tokens.c' || echo '$(srcdir)/'`tokens.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_nss_la-tokens.Tpo" "$(DEPDIR)/libxmlsec1_nss_la-tokens.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_nss_la-tokens.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='tokens.c' object='libxmlsec1_nss_la-tokens.lo' libtool=yes @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_nss_la-tokens.lo `test -f 'tokens.c' || echo '$(srcdir)/'`tokens.c ++ + libxmlsec1_nss_la-bignum.lo: bignum.c + @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_nss_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_nss_la-bignum.lo -MD -MP -MF $(DEPDIR)/libxmlsec1_nss_la-bignum.Tpo -c -o libxmlsec1_nss_la-bignum.lo `test -f 'bignum.c' || echo '$(srcdir)/'`bignum.c + @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxmlsec1_nss_la-bignum.Tpo $(DEPDIR)/libxmlsec1_nss_la-bignum.Plo +--- misc/xmlsec1-1.2.14/src/nss/akmngr.c 2009-09-21 14:07:19.197249962 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/akmngr.c 2009-09-21 14:02:48.539616129 +0200 +@@ -1 +1,384 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright......................... ++ */ ++#include "globals.h" ++ ++#include <nspr.h> ++#include <nss.h> ++#include <pk11func.h> ++#include <cert.h> ++#include <keyhi.h> ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/keys.h> ++#include <xmlsec/transforms.h> ++#include <xmlsec/errors.h> ++ ++#include <xmlsec/nss/crypto.h> ++#include <xmlsec/nss/tokens.h> ++#include <xmlsec/nss/akmngr.h> ++#include <xmlsec/nss/pkikeys.h> ++#include <xmlsec/nss/ciphers.h> ++#include <xmlsec/nss/keysstore.h> ++ ++/** ++ * xmlSecNssAppliedKeysMngrCreate: ++ * @slot: array of pointers to NSS PKCS#11 slot infomation. ++ * @cSlots: number of slots in the array ++ * @handler: the pointer to NSS certificate database. ++ * ++ * Create and load NSS crypto slot and certificate database into keys manager ++ * ++ * Returns keys manager pointer on success or NULL otherwise. ++ */ ++xmlSecKeysMngrPtr ++xmlSecNssAppliedKeysMngrCreate( ++ PK11SlotInfo** slots, ++ int cSlots, ++ CERTCertDBHandle* handler ++) { ++ xmlSecKeyDataStorePtr certStore = NULL ; ++ xmlSecKeysMngrPtr keyMngr = NULL ; ++ xmlSecKeyStorePtr keyStore = NULL ; ++ int islot = 0; ++ keyStore = xmlSecKeyStoreCreate( xmlSecNssKeysStoreId ) ; ++ if( keyStore == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeyStoreCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return NULL ; ++ } ++ ++ for (islot = 0; islot < cSlots; islot++) ++ { ++ xmlSecNssKeySlotPtr keySlot ; ++ ++ /* Create a key slot */ ++ keySlot = xmlSecNssKeySlotCreate() ; ++ if( keySlot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecNssKeySlotCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ return NULL ; ++ } ++ ++ /* Set slot */ ++ if( xmlSecNssKeySlotSetSlot( keySlot , slots[islot] ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecNssKeySlotSetSlot" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ xmlSecNssKeySlotDestroy( keySlot ) ; ++ return NULL ; ++ } ++ ++ /* Adopt keySlot */ ++ if( xmlSecNssKeysStoreAdoptKeySlot( keyStore , keySlot ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecNssKeysStoreAdoptKeySlot" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ xmlSecNssKeySlotDestroy( keySlot ) ; ++ return NULL ; ++ } ++ } ++ ++ keyMngr = xmlSecKeysMngrCreate() ; ++ if( keyMngr == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Add key store to manager, from now on keys manager destroys the store if ++ * needed ++ */ ++ if( xmlSecKeysMngrAdoptKeysStore( keyMngr, keyStore ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecKeysMngrAdoptKeyStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyStoreDestroy( keyStore ) ; ++ xmlSecKeysMngrDestroy( keyMngr ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Initialize crypto library specific data in keys manager ++ */ ++ if( xmlSecNssKeysMngrInit( keyMngr ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeysMngrDestroy( keyMngr ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Set certificate databse to X509 key data store ++ */ ++ /** ++ * Because Tej's implementation of certDB use the default DB, so I ignore ++ * the certDB handler at present. I'll modify the cert store sources to ++ * accept particular certDB instead of default ones. ++ certStore = xmlSecKeysMngrGetDataStore( keyMngr , xmlSecNssKeyDataStoreX509Id ) ; ++ if( certStore == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecKeysMngrGetDataStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeysMngrDestroy( keyMngr ) ; ++ return NULL ; ++ } ++ ++ if( xmlSecNssKeyDataStoreX509SetCertDb( certStore , handler ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( keyStore ) ) , ++ "xmlSecNssKeyDataStoreX509SetCertDb" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeysMngrDestroy( keyMngr ) ; ++ return NULL ; ++ } ++ */ ++ ++ /*- ++ * Set the getKey callback ++ */ ++ keyMngr->getKey = xmlSecKeysMngrGetKey ; ++ ++ return keyMngr ; ++} ++ ++int ++xmlSecNssAppliedKeysMngrSymKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ PK11SymKey* symKey ++) { ++ xmlSecKeyPtr key ; ++ xmlSecKeyDataPtr data ; ++ xmlSecKeyStorePtr keyStore ; ++ ++ xmlSecAssert2( mngr != NULL , -1 ) ; ++ xmlSecAssert2( symKey != NULL , -1 ) ; ++ ++ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ; ++ if( keyStore == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrGetKeysStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ; ++ ++ data = xmlSecNssSymKeyDataKeyAdopt( symKey ) ; ++ if( data == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ ++ key = xmlSecKeyCreate() ; ++ if( key == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ if( xmlSecKeySetValue( key , data ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDestroy( key ) ; ++ return(-1) ; ++ } ++ ++ return(0) ; ++} ++ ++int ++xmlSecNssAppliedKeysMngrPubKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ SECKEYPublicKey* pubKey ++) { ++ xmlSecKeyPtr key ; ++ xmlSecKeyDataPtr data ; ++ xmlSecKeyStorePtr keyStore ; ++ ++ xmlSecAssert2( mngr != NULL , -1 ) ; ++ xmlSecAssert2( pubKey != NULL , -1 ) ; ++ ++ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ; ++ if( keyStore == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrGetKeysStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ; ++ ++ data = xmlSecNssPKIAdoptKey( NULL, pubKey ) ; ++ if( data == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssPKIAdoptKey" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ ++ key = xmlSecKeyCreate() ; ++ if( key == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ if( xmlSecKeySetValue( key , data ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDestroy( key ) ; ++ return(-1) ; ++ } ++ ++ return(0) ; ++} ++ ++int ++xmlSecNssAppliedKeysMngrPriKeyLoad( ++ xmlSecKeysMngrPtr mngr , ++ SECKEYPrivateKey* priKey ++) { ++ xmlSecKeyPtr key ; ++ xmlSecKeyDataPtr data ; ++ xmlSecKeyStorePtr keyStore ; ++ ++ xmlSecAssert2( mngr != NULL , -1 ) ; ++ xmlSecAssert2( priKey != NULL , -1 ) ; ++ ++ keyStore = xmlSecKeysMngrGetKeysStore( mngr ) ; ++ if( keyStore == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeysMngrGetKeysStore" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ xmlSecAssert2( xmlSecKeyStoreCheckId( keyStore , xmlSecNssKeysStoreId ) , -1 ) ; ++ ++ data = xmlSecNssPKIAdoptKey( priKey, NULL ) ; ++ if( data == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssPKIAdoptKey" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ ++ key = xmlSecKeyCreate() ; ++ if( key == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ if( xmlSecKeySetValue( key , data ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ if( xmlSecNssKeysStoreAdoptKey( keyStore, key ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataKeyAdopt" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDestroy( key ) ; ++ return(-1) ; ++ } ++ ++ return(0) ; ++} ++ +--- misc/xmlsec1-1.2.14/src/nss/hmac.c 2009-06-26 06:18:13.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/hmac.c 2009-09-21 14:02:48.649065288 +0200 +@@ -23,8 +23,8 @@ + #include <xmlsec/transforms.h> + #include <xmlsec/errors.h> + +-#include <xmlsec/nss/app.h> + #include <xmlsec/nss/crypto.h> ++#include <xmlsec/nss/tokens.h> + + /* sizes in bits */ + #define XMLSEC_NSS_MIN_HMAC_SIZE 80 +@@ -286,13 +286,13 @@ + keyItem.data = xmlSecBufferGetData(buffer); + keyItem.len = xmlSecBufferGetSize(buffer); + +- slot = PK11_GetBestSlot(ctx->digestType, NULL); ++ slot = xmlSecNssSlotGet(ctx->digestType); + if(slot == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), +- "PK11_GetBestSlot", ++ "xmlSecNssSlotGet", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + return(-1); + } + +--- misc/xmlsec1-1.2.14/src/nss/keysstore.c 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/keysstore.c 2009-09-21 14:02:48.633533885 +0200 +@@ -1,36 +1,56 @@ + /** + * XMLSec library + * +- * Nss keys store that uses Simple Keys Store under the hood. Uses the +- * Nss DB as a backing store for the finding keys, but the NSS DB is +- * not written to by the keys store. +- * So, if store->findkey is done and the key is not found in the simple +- * keys store, the NSS DB is looked up. +- * If store is called to adopt a key, that key is not written to the NSS +- * DB. +- * Thus, the NSS DB can be used to pre-load keys and becomes an alternate +- * source of keys for xmlsec +- * + * This is free software; see Copyright file in the source + * distribution for precise wording. + * + * Copyright (c) 2003 America Online, Inc. All rights reserved. + */ ++ ++/** ++ * NSS key store uses a key list and a slot list as the key repository. NSS slot ++ * list is a backup repository for the finding keys. If a key is not found from ++ * the key list, the NSS slot list is looked up. ++ * ++ * Any key in the key list will not save to pkcs11 slot. When a store to called ++ * to adopt a key, the key is resident in the key list; While a store to called ++ * to set a is resident in the key list; While a store to called to set a slot ++ * list, which means that the keys in the listed slot can be used for xml sign- ++ * nature or encryption. ++ * ++ * Then, a user can adjust slot list to effect the crypto behaviors of xmlSec. ++ * ++ * The framework will decrease the user interfaces to administrate xmlSec crypto ++ * engine. He can only focus on NSS layer functions. For examples, after the ++ * user set up a slot list handler to the keys store, he do not need to do any ++ * other work atop xmlSec interfaces, his action on the slot list handler, such ++ * as add a token to, delete a token from the list, will directly effect the key ++ * store behaviors. ++ * ++ * For example, a scenariio: ++ * 0. Create a slot list;( NSS interfaces ) ++ * 1. Create a keys store;( xmlSec interfaces ) ++ * 2. Set slot list with the keys store;( xmlSec Interfaces ) ++ * 3. Add a slot to the slot list;( NSS interfaces ) ++ * 4. Perform xml signature; ( xmlSec Interfaces ) ++ * 5. Deleter a slot from the slot list;( NSS interfaces ) ++ * 6. Perform xml encryption; ( xmlSec Interfaces ) ++ * 7. Perform xml signature;( xmlSec Interfaces ) ++ * 8. Destroy the keys store;( xmlSec Interfaces ) ++ * 8. Destroy the slot list.( NSS Interfaces ) ++ */ + #include "globals.h" + + #include <stdlib.h> + #include <string.h> + + #include <nss.h> +-#include <cert.h> + #include <pk11func.h> ++#include <prinit.h> + #include <keyhi.h> + +-#include <libxml/tree.h> +- + #include <xmlsec/xmlsec.h> +-#include <xmlsec/buffer.h> +-#include <xmlsec/base64.h> ++#include <xmlsec/keys.h> + #include <xmlsec/errors.h> + #include <xmlsec/xmltree.h> + +@@ -38,82 +58,461 @@ + + #include <xmlsec/nss/crypto.h> + #include <xmlsec/nss/keysstore.h> +-#include <xmlsec/nss/x509.h> ++#include <xmlsec/nss/tokens.h> ++#include <xmlsec/nss/ciphers.h> + #include <xmlsec/nss/pkikeys.h> + + /**************************************************************************** + * +- * Nss Keys Store. Uses Simple Keys Store under the hood ++ * Internal NSS key store context + * +- * Simple Keys Store ptr is located after xmlSecKeyStore ++ * This context is located after xmlSecKeyStore + * + ***************************************************************************/ ++typedef struct _xmlSecNssKeysStoreCtx xmlSecNssKeysStoreCtx ; ++typedef struct _xmlSecNssKeysStoreCtx* xmlSecNssKeysStoreCtxPtr ; ++ ++struct _xmlSecNssKeysStoreCtx { ++ xmlSecPtrListPtr keyList ; ++ xmlSecPtrListPtr slotList ; ++} ; ++ + #define xmlSecNssKeysStoreSize \ +- (sizeof(xmlSecKeyStore) + sizeof(xmlSecKeyStorePtr)) ++ ( sizeof( xmlSecKeyStore ) + sizeof( xmlSecNssKeysStoreCtx ) ) + +-#define xmlSecNssKeysStoreGetSS(store) \ +- ((xmlSecKeyStoreCheckSize((store), xmlSecNssKeysStoreSize)) ? \ +- (xmlSecKeyStorePtr*)(((xmlSecByte*)(store)) + sizeof(xmlSecKeyStore)) : \ +- (xmlSecKeyStorePtr*)NULL) +- +-static int xmlSecNssKeysStoreInitialize (xmlSecKeyStorePtr store); +-static void xmlSecNssKeysStoreFinalize (xmlSecKeyStorePtr store); +-static xmlSecKeyPtr xmlSecNssKeysStoreFindKey (xmlSecKeyStorePtr store, +- const xmlChar* name, +- xmlSecKeyInfoCtxPtr keyInfoCtx); ++#define xmlSecNssKeysStoreGetCtx( data ) \ ++ ( ( xmlSecNssKeysStoreCtxPtr )( ( ( xmlSecByte* )( data ) ) + sizeof( xmlSecKeyStore ) ) ) + +-static xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = { +- sizeof(xmlSecKeyStoreKlass), +- xmlSecNssKeysStoreSize, ++int xmlSecNssKeysStoreAdoptKeySlot( ++ xmlSecKeyStorePtr store , ++ xmlSecNssKeySlotPtr keySlot ++) { ++ xmlSecNssKeysStoreCtxPtr context = NULL ; ++ ++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ; ++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ; ++ context = xmlSecNssKeysStoreGetCtx( store ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecNssKeysStoreGetCtx" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( context->slotList == NULL ) { ++ if( ( context->slotList = xmlSecPtrListCreate( xmlSecNssKeySlotListId ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecPtrListCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ } ++ ++ if( !xmlSecPtrListCheckId( context->slotList , xmlSecNssKeySlotListId ) ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecPtrListCheckId" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( xmlSecPtrListAdd( context->slotList , keySlot ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecPtrListAdd" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ return 0 ; ++} + +- /* data */ +- BAD_CAST "NSS-keys-store", /* const xmlChar* name; */ +- +- /* constructors/destructor */ +- xmlSecNssKeysStoreInitialize, /* xmlSecKeyStoreInitializeMethod initialize; */ +- xmlSecNssKeysStoreFinalize, /* xmlSecKeyStoreFinalizeMethod finalize; */ +- xmlSecNssKeysStoreFindKey, /* xmlSecKeyStoreFindKeyMethod findKey; */ +- +- /* reserved for the future */ +- NULL, /* void* reserved0; */ +- NULL, /* void* reserved1; */ +-}; ++int xmlSecNssKeysStoreAdoptKey( ++ xmlSecKeyStorePtr store , ++ xmlSecKeyPtr key ++) { ++ xmlSecNssKeysStoreCtxPtr context = NULL ; ++ ++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ; ++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ; ++ ++ context = xmlSecNssKeysStoreGetCtx( store ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecNssKeysStoreGetCtx" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( context->keyList == NULL ) { ++ if( ( context->keyList = xmlSecPtrListCreate( xmlSecKeyPtrListId ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecPtrListCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ } ++ ++ if( !xmlSecPtrListCheckId( context->keyList , xmlSecKeyPtrListId ) ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecPtrListCheckId" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( xmlSecPtrListAdd( context->keyList , key ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecPtrListAdd" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } + +-/** +- * xmlSecNssKeysStoreGetKlass: +- * +- * The Nss list based keys store klass. ++ return 0 ; ++} ++ ++/* ++ * xmlSecKeyStoreInitializeMethod: ++ * @store: the store. ++ * ++ * Keys store specific initialization method. + * +- * Returns: Nss list based keys store klass. ++ * Returns 0 on success or a negative value if an error occurs. + */ +-xmlSecKeyStoreId +-xmlSecNssKeysStoreGetKlass(void) { +- return(&xmlSecNssKeysStoreKlass); ++static int ++xmlSecNssKeysStoreInitialize( ++ xmlSecKeyStorePtr store ++) { ++ xmlSecNssKeysStoreCtxPtr context = NULL ; ++ ++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , -1 ) ; ++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , -1 ) ; ++ ++ context = xmlSecNssKeysStoreGetCtx( store ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecNssKeysStoreGetCtx" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ context->keyList = NULL ; ++ context->slotList = NULL ; ++ ++ return 0 ; + } + + /** +- * xmlSecNssKeysStoreAdoptKey: +- * @store: the pointer to Nss keys store. +- * @key: the pointer to key. +- * +- * Adds @key to the @store. + * +- * Returns: 0 on success or a negative value if an error occurs. ++ * xmlSecKeyStoreFinalizeMethod: ++ * @store: the store. ++ * ++ * Keys store specific finalization (destroy) method. + */ +-int +-xmlSecNssKeysStoreAdoptKey(xmlSecKeyStorePtr store, xmlSecKeyPtr key) { +- xmlSecKeyStorePtr *ss; +- +- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1); +- xmlSecAssert2((key != NULL), -1); ++void ++xmlSecNssKeysStoreFinalize( ++ xmlSecKeyStorePtr store ++) { ++ xmlSecNssKeysStoreCtxPtr context = NULL ; ++ ++ xmlSecAssert( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) ) ; ++ xmlSecAssert( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) ) ; ++ ++ context = xmlSecNssKeysStoreGetCtx( store ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecNssKeysStoreGetCtx" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return ; ++ } ++ ++ if( context->keyList != NULL ) { ++ xmlSecPtrListDestroy( context->keyList ) ; ++ context->keyList = NULL ; ++ } ++ ++ if( context->slotList != NULL ) { ++ xmlSecPtrListDestroy( context->slotList ) ; ++ context->slotList = NULL ; ++ } ++} ++ ++xmlSecKeyPtr ++xmlSecNssKeysStoreFindKeyFromSlot( ++ PK11SlotInfo* slot, ++ const xmlChar* name, ++ xmlSecKeyInfoCtxPtr keyInfoCtx ++) { ++ xmlSecKeyPtr key = NULL ; ++ xmlSecKeyDataPtr data = NULL ; ++ int length ; ++ ++ xmlSecAssert2( slot != NULL , NULL ) ; ++ xmlSecAssert2( name != NULL , NULL ) ; ++ xmlSecAssert2( keyInfoCtx != NULL , NULL ) ; ++ ++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypeSymmetric ) == xmlSecKeyDataTypeSymmetric ) { ++ PK11SymKey* symKey ; ++ PK11SymKey* curKey ; ++ ++ /* Find symmetric key from the slot by name */ ++ symKey = PK11_ListFixedKeysInSlot( slot , ( char* )name , NULL ) ; ++ for( curKey = symKey ; curKey != NULL ; curKey = PK11_GetNextSymKey( curKey ) ) { ++ /* Check the key request */ ++ length = PK11_GetKeyLength( curKey ) ; ++ length *= 8 ; ++ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) && ++ ( length > 0 ) && ++ ( length < keyInfoCtx->keyReq.keyBitsSize ) ) ++ continue ; ++ ++ /* We find a eligible key */ ++ data = xmlSecNssSymKeyDataKeyAdopt( curKey ) ; ++ if( data == NULL ) { ++ /* Do nothing */ ++ } ++ break ; ++ } ++ ++ /* Destroy the sym key list */ ++ for( curKey = symKey ; curKey != NULL ; ) { ++ symKey = curKey ; ++ curKey = PK11_GetNextSymKey( symKey ) ; ++ PK11_FreeSymKey( symKey ) ; ++ } ++ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) { ++ SECKEYPublicKeyList* pubKeyList ; ++ SECKEYPublicKey* pubKey ; ++ SECKEYPublicKeyListNode* curPub ; ++ ++ /* Find asymmetric key from the slot by name */ ++ pubKeyList = PK11_ListPublicKeysInSlot( slot , ( char* )name ) ; ++ pubKey = NULL ; ++ curPub = PUBKEY_LIST_HEAD(pubKeyList); ++ for( ; !PUBKEY_LIST_END(curPub, pubKeyList) ; curPub = PUBKEY_LIST_NEXT( curPub ) ) { ++ /* Check the key request */ ++ length = SECKEY_PublicKeyStrength( curPub->key ) ; ++ length *= 8 ; ++ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) && ++ ( length > 0 ) && ++ ( length < keyInfoCtx->keyReq.keyBitsSize ) ) ++ continue ; ++ ++ /* We find a eligible key */ ++ pubKey = curPub->key ; ++ break ; ++ } ++ ++ if( pubKey != NULL ) { ++ data = xmlSecNssPKIAdoptKey( NULL, pubKey ) ; ++ if( data == NULL ) { ++ /* Do nothing */ ++ } ++ } ++ ++ /* Destroy the public key list */ ++ SECKEY_DestroyPublicKeyList( pubKeyList ) ; ++ } else if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) { ++ SECKEYPrivateKeyList* priKeyList = NULL ; ++ SECKEYPrivateKey* priKey = NULL ; ++ SECKEYPrivateKeyListNode* curPri ; ++ ++ /* Find asymmetric key from the slot by name */ ++ priKeyList = PK11_ListPrivKeysInSlot( slot , ( char* )name , NULL ) ; ++ priKey = NULL ; ++ curPri = PRIVKEY_LIST_HEAD(priKeyList); ++ for( ; !PRIVKEY_LIST_END(curPri, priKeyList) ; curPri = PRIVKEY_LIST_NEXT( curPri ) ) { ++ /* Check the key request */ ++ length = PK11_SignatureLen( curPri->key ) ; ++ length *= 8 ; ++ if( ( keyInfoCtx->keyReq.keyBitsSize > 0 ) && ++ ( length > 0 ) && ++ ( length < keyInfoCtx->keyReq.keyBitsSize ) ) ++ continue ; ++ ++ /* We find a eligible key */ ++ priKey = curPri->key ; ++ break ; ++ } ++ ++ if( priKey != NULL ) { ++ data = xmlSecNssPKIAdoptKey( priKey, NULL ) ; ++ if( data == NULL ) { ++ /* Do nothing */ ++ } ++ } ++ ++ /* Destroy the private key list */ ++ SECKEY_DestroyPrivateKeyList( priKeyList ) ; ++ } ++ ++ /* If we have gotten the key value */ ++ if( data != NULL ) { ++ if( ( key = xmlSecKeyCreate() ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeyCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyDataDestroy( data ) ; ++ return NULL ; ++ } ++ ++ if( xmlSecKeySetValue( key , data ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeySetValue" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyDestroy( key ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return NULL ; ++ } ++ } + +- ss = xmlSecNssKeysStoreGetSS(store); +- xmlSecAssert2(((ss != NULL) && (*ss != NULL) && +- (xmlSecKeyStoreCheckId(*ss, xmlSecSimpleKeysStoreId))), -1); ++ return(key); ++} ++ ++/** ++ * xmlSecKeyStoreFindKeyMethod: ++ * @store: the store. ++ * @name: the desired key name. ++ * @keyInfoCtx: the pointer to key info context. ++ * ++ * Keys store specific find method. The caller is responsible for destroying ++ * the returned key using #xmlSecKeyDestroy method. ++ * ++ * Returns the pointer to a key or NULL if key is not found or an error occurs. ++ */ ++static xmlSecKeyPtr ++xmlSecNssKeysStoreFindKey( ++ xmlSecKeyStorePtr store , ++ const xmlChar* name , ++ xmlSecKeyInfoCtxPtr keyInfoCtx ++) { ++ xmlSecNssKeysStoreCtxPtr context = NULL ; ++ xmlSecKeyPtr key = NULL ; ++ xmlSecNssKeySlotPtr keySlot = NULL ; ++ xmlSecSize pos ; ++ xmlSecSize size ; ++ ++ xmlSecAssert2( xmlSecKeyStoreCheckId( store , xmlSecNssKeysStoreId ) , NULL ) ; ++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ) , NULL ) ; ++ xmlSecAssert2( keyInfoCtx != NULL , NULL ) ; ++ ++ context = xmlSecNssKeysStoreGetCtx( store ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecNssKeysStoreGetCtx" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return NULL ; ++ } ++ ++ /*- ++ * Look for key at keyList at first. ++ */ ++ if( context->keyList != NULL ) { ++ size = xmlSecPtrListGetSize( context->keyList ) ; ++ for( pos = 0 ; pos < size ; pos ++ ) { ++ key = ( xmlSecKeyPtr )xmlSecPtrListGetItem( context->keyList , pos ) ; ++ if( key != NULL && xmlSecKeyMatch( key , name , &( keyInfoCtx->keyReq ) ) ) { ++ return xmlSecKeyDuplicate( key ) ; ++ } ++ } ++ } ++ ++ /*- ++ * Find the key from slotList ++ */ ++ if( context->slotList != NULL ) { ++ PK11SlotInfo* slot = NULL ; ++ ++ size = xmlSecPtrListGetSize( context->slotList ) ; ++ for( pos = 0 ; pos < size ; pos ++ ) { ++ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( context->slotList , pos ) ; ++ slot = xmlSecNssKeySlotGetSlot( keySlot ) ; ++ if( slot == NULL ) { ++ continue ; ++ } else { ++ key = xmlSecNssKeysStoreFindKeyFromSlot( slot, name, keyInfoCtx ) ; ++ if( key == NULL ) { ++ continue ; ++ } else { ++ return( key ) ; ++ } ++ } ++ } ++ } ++ ++ /*- ++ * Create a session key if we can not find the key from keyList and slotList ++ */ ++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypeSession ) == xmlSecKeyDataTypeSession ) { ++ key = xmlSecKeyGenerate( keyInfoCtx->keyReq.keyId , keyInfoCtx->keyReq.keyBitsSize , xmlSecKeyDataTypeSession ) ; ++ if( key == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyStoreGetName( store ) ) , ++ "xmlSecKeySetValue" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return NULL ; ++ } ++ ++ return key ; ++ } ++ ++ /** ++ * We have no way to find the key any more. ++ */ ++ return NULL ; ++} ++ ++static xmlSecKeyStoreKlass xmlSecNssKeysStoreKlass = { ++ sizeof( xmlSecKeyStoreKlass ) , ++ xmlSecNssKeysStoreSize , ++ BAD_CAST "implicit_nss_keys_store" , ++ xmlSecNssKeysStoreInitialize , ++ xmlSecNssKeysStoreFinalize , ++ xmlSecNssKeysStoreFindKey , ++ NULL , ++ NULL ++} ; + +- return (xmlSecSimpleKeysStoreAdoptKey(*ss, key)); ++/** ++ * xmlSecNssKeysStoreGetKlass: ++ * ++ * The simple list based keys store klass. ++ * ++ */ ++xmlSecKeyStoreId ++xmlSecNssKeysStoreGetKlass( void ) { ++ return &xmlSecNssKeysStoreKlass ; + } + ++/************************** ++ * Application routines ++ */ ++ + /** + * xmlSecNssKeysStoreLoad: + * @store: the pointer to Nss keys store. +@@ -252,234 +651,147 @@ + */ + int + xmlSecNssKeysStoreSave(xmlSecKeyStorePtr store, const char *filename, xmlSecKeyDataType type) { +- xmlSecKeyStorePtr *ss; ++ xmlSecKeyInfoCtx keyInfoCtx; ++ xmlSecNssKeysStoreCtxPtr context ; ++ xmlSecPtrListPtr list; ++ xmlSecKeyPtr key; ++ xmlSecSize i, keysSize; ++ xmlDocPtr doc; ++ xmlNodePtr cur; ++ xmlSecKeyDataPtr data; ++ xmlSecPtrListPtr idsList; ++ xmlSecKeyDataId dataId; ++ xmlSecSize idsSize, j; ++ int ret; + + xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1); +- xmlSecAssert2((filename != NULL), -1); +- +- ss = xmlSecNssKeysStoreGetSS(store); +- xmlSecAssert2(((ss != NULL) && (*ss != NULL) && +- (xmlSecKeyStoreCheckId(*ss, xmlSecSimpleKeysStoreId))), -1); +- +- return (xmlSecSimpleKeysStoreSave(*ss, filename, type)); +-} +- +-static int +-xmlSecNssKeysStoreInitialize(xmlSecKeyStorePtr store) { +- xmlSecKeyStorePtr *ss; ++ xmlSecAssert2( xmlSecKeyStoreCheckSize( store , xmlSecNssKeysStoreSize ), -1 ) ; ++ xmlSecAssert2(filename != NULL, -1); + +- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), -1); ++ context = xmlSecNssKeysStoreGetCtx( store ) ; ++ xmlSecAssert2( context != NULL, -1 ); + +- ss = xmlSecNssKeysStoreGetSS(store); +- xmlSecAssert2((*ss == NULL), -1); ++ list = context->keyList ; ++ xmlSecAssert2( list != NULL, -1 ); ++ xmlSecAssert2(xmlSecPtrListCheckId(list, xmlSecKeyPtrListId), -1); + +- *ss = xmlSecKeyStoreCreate(xmlSecSimpleKeysStoreId); +- if(*ss == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, ++ /* create doc */ ++ doc = xmlSecCreateTree(BAD_CAST "Keys", xmlSecNs); ++ if(doc == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), +- "xmlSecKeyStoreCreate", ++ "xmlSecCreateTree", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "xmlSecSimpleKeysStoreId"); ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + +- return(0); +-} +- +-static void +-xmlSecNssKeysStoreFinalize(xmlSecKeyStorePtr store) { +- xmlSecKeyStorePtr *ss; +- +- xmlSecAssert(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId)); +- +- ss = xmlSecNssKeysStoreGetSS(store); +- xmlSecAssert((ss != NULL) && (*ss != NULL)); +- +- xmlSecKeyStoreDestroy(*ss); +-} +- +-static xmlSecKeyPtr +-xmlSecNssKeysStoreFindKey(xmlSecKeyStorePtr store, const xmlChar* name, +- xmlSecKeyInfoCtxPtr keyInfoCtx) { +- xmlSecKeyStorePtr* ss; +- xmlSecKeyPtr key = NULL; +- xmlSecKeyPtr retval = NULL; +- xmlSecKeyReqPtr keyReq = NULL; +- CERTCertificate *cert = NULL; +- SECKEYPublicKey *pubkey = NULL; +- SECKEYPrivateKey *privkey = NULL; +- xmlSecKeyDataPtr data = NULL; +- xmlSecKeyDataPtr x509Data = NULL; +- int ret; +- +- xmlSecAssert2(xmlSecKeyStoreCheckId(store, xmlSecNssKeysStoreId), NULL); +- xmlSecAssert2(keyInfoCtx != NULL, NULL); +- +- ss = xmlSecNssKeysStoreGetSS(store); +- xmlSecAssert2(((ss != NULL) && (*ss != NULL)), NULL); +- +- key = xmlSecKeyStoreFindKey(*ss, name, keyInfoCtx); +- if (key != NULL) { +- return (key); +- } +- +- /* Try to find the key in the NSS DB, and construct an xmlSecKey. +- * we must have a name to lookup keys in NSS DB. +- */ +- if (name == NULL) { +- goto done; +- } ++ idsList = xmlSecKeyDataIdsGet(); ++ xmlSecAssert2(idsList != NULL, -1); + +- /* what type of key are we looking for? +- * TBD: For now, we'll look only for public/private keys using the +- * name as a cert nickname. Later on, we can attempt to find +- * symmetric keys using PK11_FindFixedKey +- */ +- keyReq = &(keyInfoCtx->keyReq); +- if (keyReq->keyType & +- (xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate)) { +- cert = CERT_FindCertByNickname (CERT_GetDefaultCertDB(), (char *)name); +- if (cert == NULL) { +- goto done; +- } ++ keysSize = xmlSecPtrListGetSize(list); ++ idsSize = xmlSecPtrListGetSize(idsList); ++ for(i = 0; i < keysSize; ++i) { ++ key = (xmlSecKeyPtr)xmlSecPtrListGetItem(list, i); ++ xmlSecAssert2(key != NULL, -1); + +- if (keyReq->keyType & xmlSecKeyDataTypePublic) { +- pubkey = CERT_ExtractPublicKey(cert); +- if (pubkey == NULL) { ++ cur = xmlSecAddChild(xmlDocGetRootElement(doc), xmlSecNodeKeyInfo, xmlSecDSigNs); ++ if(cur == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "CERT_ExtractPublicKey", +- XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- goto done; +- } ++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), ++ "xmlSecAddChild", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "node=%s", ++ xmlSecErrorsSafeString(xmlSecNodeKeyInfo)); ++ xmlFreeDoc(doc); ++ return(-1); + } + +- if (keyReq->keyType & xmlSecKeyDataTypePrivate) { +- privkey = PK11_FindKeyByAnyCert(cert, NULL); +- if (privkey == NULL) { ++ /* special data key name */ ++ if(xmlSecKeyGetName(key) != NULL) { ++ if(xmlSecAddChild(cur, xmlSecNodeKeyName, xmlSecDSigNs) == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "PK11_FindKeyByAnyCert", +- XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- goto done; ++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), ++ "xmlSecAddChild", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "node=%s", ++ xmlSecErrorsSafeString(xmlSecNodeKeyName)); ++ xmlFreeDoc(doc); ++ return(-1); + } + } + +- data = xmlSecNssPKIAdoptKey(privkey, pubkey); +- if(data == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssPKIAdoptKey", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- goto done; +- } +- privkey = NULL; +- pubkey = NULL; +- +- key = xmlSecKeyCreate(); +- if (key == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecKeyCreate", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return (NULL); +- } +- +- x509Data = xmlSecKeyDataCreate(xmlSecNssKeyDataX509Id); +- if(x509Data == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecKeyDataCreate", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "transform=%s", +- xmlSecErrorsSafeString(xmlSecTransformKlassGetName(xmlSecNssKeyDataX509Id))); +- goto done; +- } ++ /* create nodes for other keys data */ ++ for(j = 0; j < idsSize; ++j) { ++ dataId = (xmlSecKeyDataId)xmlSecPtrListGetItem(idsList, j); ++ xmlSecAssert2(dataId != xmlSecKeyDataIdUnknown, -1); ++ ++ if(dataId->dataNodeName == NULL) { ++ continue; ++ } ++ ++ data = xmlSecKeyGetData(key, dataId); ++ if(data == NULL) { ++ continue; ++ } + +- ret = xmlSecNssKeyDataX509AdoptKeyCert(x509Data, cert); +- if (ret < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssKeyDataX509AdoptKeyCert", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "data=%s", +- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); +- goto done; +- } +- cert = CERT_DupCertificate(cert); +- if (cert == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "CERT_DupCertificate", +- XMLSEC_ERRORS_R_CRYPTO_FAILED, +- "data=%s", +- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); +- goto done; ++ if(xmlSecAddChild(cur, dataId->dataNodeName, dataId->dataNodeNs) == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), ++ "xmlSecAddChild", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "node=%s", ++ xmlSecErrorsSafeString(dataId->dataNodeName)); ++ xmlFreeDoc(doc); ++ return(-1); ++ } + } + +- ret = xmlSecNssKeyDataX509AdoptCert(x509Data, cert); ++ ret = xmlSecKeyInfoCtxInitialize(&keyInfoCtx, NULL); + if (ret < 0) { + xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssKeyDataX509AdoptCert", ++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), ++ "xmlSecKeyInfoCtxInitialize", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "data=%s", +- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); +- goto done; ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlFreeDoc(doc); ++ return(-1); + } +- cert = NULL; + +- ret = xmlSecKeySetValue(key, data); +- if (ret < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecKeySetValue", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "data=%s", +- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data))); +- goto done; +- } +- data = NULL; ++ keyInfoCtx.mode = xmlSecKeyInfoModeWrite; ++ keyInfoCtx.keyReq.keyId = xmlSecKeyDataIdUnknown; ++ keyInfoCtx.keyReq.keyType = type; ++ keyInfoCtx.keyReq.keyUsage = xmlSecKeyDataUsageAny; + +- ret = xmlSecKeyAdoptData(key, x509Data); ++ /* finally write key in the node */ ++ ret = xmlSecKeyInfoNodeWrite(cur, key, &keyInfoCtx); + if (ret < 0) { + xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecKeyAdoptData", ++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), ++ "xmlSecKeyInfoNodeWrite", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "data=%s", +- xmlSecErrorsSafeString(xmlSecKeyDataGetName(x509Data))); +- goto done; +- } +- x509Data = NULL; ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecKeyInfoCtxFinalize(&keyInfoCtx); ++ xmlFreeDoc(doc); ++ return(-1); ++ } + +- retval = key; +- key = NULL; ++ xmlSecKeyInfoCtxFinalize(&keyInfoCtx); + } + +-done: +- if (cert != NULL) { +- CERT_DestroyCertificate(cert); +- } +- if (pubkey != NULL) { +- SECKEY_DestroyPublicKey(pubkey); +- } +- if (privkey != NULL) { +- SECKEY_DestroyPrivateKey(privkey); +- } +- if (data != NULL) { +- xmlSecKeyDataDestroy(data); +- } +- if (x509Data != NULL) { +- xmlSecKeyDataDestroy(x509Data); +- } +- if (key != NULL) { +- xmlSecKeyDestroy(key); ++ /* now write result */ ++ ret = xmlSaveFormatFile(filename, doc, 1); ++ if (ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyStoreGetName(store)), ++ "xmlSaveFormatFile", ++ XMLSEC_ERRORS_R_XML_FAILED, ++ "filename=%s", ++ xmlSecErrorsSafeString(filename)); ++ xmlFreeDoc(doc); ++ return(-1); + } + +- return (retval); ++ xmlFreeDoc(doc); ++ return(0); + } +--- misc/xmlsec1-1.2.14/src/nss/keywrapers.c 2009-09-21 14:07:19.223802688 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/keywrapers.c 2009-09-21 14:02:48.548869372 +0200 +@@ -1 +1,1213 @@ +-dummy ++/** ++ * ++ * XMLSec library ++ * ++ * AES Algorithm support ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright ................................. ++ */ ++#include "globals.h" ++ ++#include <stdlib.h> ++#include <stdio.h> ++#include <string.h> ++ ++#include <nss.h> ++#include <pk11func.h> ++#include <hasht.h> ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/xmltree.h> ++#include <xmlsec/keys.h> ++#include <xmlsec/transforms.h> ++#include <xmlsec/errors.h> ++ ++#include <xmlsec/nss/crypto.h> ++#include <xmlsec/nss/ciphers.h> ++ ++#define XMLSEC_NSS_AES128_KEY_SIZE 16 ++#define XMLSEC_NSS_AES192_KEY_SIZE 24 ++#define XMLSEC_NSS_AES256_KEY_SIZE 32 ++#define XMLSEC_NSS_DES3_KEY_SIZE 24 ++#define XMLSEC_NSS_DES3_KEY_LENGTH 24 ++#define XMLSEC_NSS_DES3_IV_LENGTH 8 ++#define XMLSEC_NSS_DES3_BLOCK_LENGTH 8 ++ ++static xmlSecByte xmlSecNssKWDes3Iv[XMLSEC_NSS_DES3_IV_LENGTH] = { ++ 0x4a, 0xdd, 0xa2, 0x2c, 0x79, 0xe8, 0x21, 0x05 ++}; ++ ++/********************************************************************* ++ * ++ * key wrap transforms ++ * ++ ********************************************************************/ ++typedef struct _xmlSecNssKeyWrapCtx xmlSecNssKeyWrapCtx ; ++typedef struct _xmlSecNssKeyWrapCtx* xmlSecNssKeyWrapCtxPtr ; ++ ++#define xmlSecNssKeyWrapSize \ ++ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssKeyWrapCtx ) ) ++ ++#define xmlSecNssKeyWrapGetCtx( transform ) \ ++ ( ( xmlSecNssKeyWrapCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) ) ++ ++struct _xmlSecNssKeyWrapCtx { ++ CK_MECHANISM_TYPE cipher ; ++ PK11SymKey* symkey ; ++ xmlSecKeyDataId keyId ; ++ xmlSecBufferPtr material ; /* to be encrypted/decrypted key material */ ++} ; ++ ++static int xmlSecNssKeyWrapInitialize(xmlSecTransformPtr transform); ++static void xmlSecNssKeyWrapFinalize(xmlSecTransformPtr transform); ++static int xmlSecNssKeyWrapSetKeyReq(xmlSecTransformPtr transform, ++ xmlSecKeyReqPtr keyReq); ++static int xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform, ++ xmlSecKeyPtr key); ++static int xmlSecNssKeyWrapExecute(xmlSecTransformPtr transform, ++ int last, ++ xmlSecTransformCtxPtr transformCtx); ++static xmlSecSize xmlSecNssKeyWrapGetKeySize(xmlSecTransformPtr transform); ++ ++static int ++xmlSecNssKeyWrapCheckId( ++ xmlSecTransformPtr transform ++) { ++ #ifndef XMLSEC_NO_DES ++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWDes3Id ) ) { ++ return(1); ++ } ++ #endif /* XMLSEC_NO_DES */ ++ ++ #ifndef XMLSEC_NO_AES ++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes128Id ) || ++ xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes192Id ) || ++ xmlSecTransformCheckId( transform, xmlSecNssTransformKWAes256Id ) ) { ++ ++ return(1); ++ } ++ #endif /* XMLSEC_NO_AES */ ++ ++ return(0); ++} ++ ++static xmlSecSize ++xmlSecNssKeyWrapGetKeySize(xmlSecTransformPtr transform) { ++#ifndef XMLSEC_NO_DES ++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformKWDes3Id ) ) { ++ return(XMLSEC_NSS_DES3_KEY_SIZE); ++ } else ++#endif /* XMLSEC_NO_DES */ ++ ++#ifndef XMLSEC_NO_AES ++ if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes128Id)) { ++ return(XMLSEC_NSS_AES128_KEY_SIZE); ++ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes192Id)) { ++ return(XMLSEC_NSS_AES192_KEY_SIZE); ++ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes256Id)) { ++ return(XMLSEC_NSS_AES256_KEY_SIZE); ++ } else if(xmlSecTransformCheckId(transform, xmlSecNssTransformKWAes256Id)) { ++ return(XMLSEC_NSS_AES256_KEY_SIZE); ++ } else ++#endif /* XMLSEC_NO_AES */ ++ ++ if(1) ++ return(0); ++} ++ ++ ++static int ++xmlSecNssKeyWrapInitialize(xmlSecTransformPtr transform) { ++ xmlSecNssKeyWrapCtxPtr context ; ++ int ret; ++ ++ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1); ++ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1); ++ ++ context = xmlSecNssKeyWrapGetCtx( transform ) ; ++ xmlSecAssert2( context != NULL , -1 ) ; ++ ++ #ifndef XMLSEC_NO_DES ++ if( transform->id == xmlSecNssTransformKWDes3Id ) { ++ context->cipher = CKM_DES3_CBC ; ++ context->keyId = xmlSecNssKeyDataDesId ; ++ } else ++ #endif /* XMLSEC_NO_DES */ ++ ++ #ifndef XMLSEC_NO_AES ++ if( transform->id == xmlSecNssTransformKWAes128Id ) { ++ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/ ++ context->cipher = CKM_AES_CBC ; ++ context->keyId = xmlSecNssKeyDataAesId ; ++ } else ++ if( transform->id == xmlSecNssTransformKWAes192Id ) { ++ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/ ++ context->cipher = CKM_AES_CBC ; ++ context->keyId = xmlSecNssKeyDataAesId ; ++ } else ++ if( transform->id == xmlSecNssTransformKWAes256Id ) { ++ /* context->cipher = CKM_NETSCAPE_AES_KEY_WRAP ;*/ ++ context->cipher = CKM_AES_CBC ; ++ context->keyId = xmlSecNssKeyDataAesId ; ++ } else ++ #endif /* XMLSEC_NO_AES */ ++ ++ ++ if( 1 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), ++ NULL , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ context->symkey = NULL ; ++ context->material = NULL ; ++ ++ return(0); ++} ++ ++static void ++xmlSecNssKeyWrapFinalize(xmlSecTransformPtr transform) { ++ xmlSecNssKeyWrapCtxPtr context ; ++ ++ xmlSecAssert(xmlSecNssKeyWrapCheckId(transform)); ++ xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize)); ++ ++ context = xmlSecNssKeyWrapGetCtx( transform ) ; ++ xmlSecAssert( context != NULL ) ; ++ ++ if( context->symkey != NULL ) { ++ PK11_FreeSymKey( context->symkey ) ; ++ context->symkey = NULL ; ++ } ++ ++ if( context->material != NULL ) { ++ xmlSecBufferDestroy(context->material); ++ context->material = NULL ; ++ } ++} ++ ++static int ++xmlSecNssKeyWrapSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) { ++ xmlSecNssKeyWrapCtxPtr context ; ++ xmlSecSize cipherSize = 0 ; ++ ++ ++ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1); ++ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1); ++ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); ++ xmlSecAssert2(keyReq != NULL, -1); ++ ++ context = xmlSecNssKeyWrapGetCtx( transform ) ; ++ xmlSecAssert2( context != NULL , -1 ) ; ++ ++ keyReq->keyId = context->keyId; ++ keyReq->keyType = xmlSecKeyDataTypeSymmetric; ++ if(transform->operation == xmlSecTransformOperationEncrypt) { ++ keyReq->keyUsage = xmlSecKeyUsageEncrypt; ++ } else { ++ keyReq->keyUsage = xmlSecKeyUsageDecrypt; ++ } ++ ++ keyReq->keyBitsSize = xmlSecNssKeyWrapGetKeySize( transform ) ; ++ ++ return(0); ++} ++ ++static int ++xmlSecNssKeyWrapSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) { ++ xmlSecNssKeyWrapCtxPtr context = NULL ; ++ xmlSecKeyDataPtr keyData = NULL ; ++ PK11SymKey* symkey = NULL ; ++ ++ xmlSecAssert2(xmlSecNssKeyWrapCheckId(transform), -1); ++ xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssKeyWrapSize), -1); ++ xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); ++ xmlSecAssert2(key != NULL, -1); ++ ++ context = xmlSecNssKeyWrapGetCtx( transform ) ; ++ if( context == NULL || context->keyId == NULL || context->symkey != NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssKeyWrapGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ; ++ ++ keyData = xmlSecKeyGetValue( key ) ; ++ if( keyData == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) , ++ "xmlSecKeyGetValue" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ if( ( symkey = xmlSecNssSymKeyDataGetKey( keyData ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) , ++ "xmlSecNssSymKeyDataGetKey" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ context->symkey = symkey ; ++ ++ return(0) ; ++} ++ ++/** ++ * key wrap transform ++ */ ++static int ++xmlSecNssKeyWrapCtxInit( ++ xmlSecNssKeyWrapCtxPtr ctx , ++ xmlSecBufferPtr in , ++ xmlSecBufferPtr out , ++ int encrypt , ++ xmlSecTransformCtxPtr transformCtx ++) { ++ xmlSecSize blockSize ; ++ ++ xmlSecAssert2( ctx != NULL , -1 ) ; ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; ++ xmlSecAssert2( in != NULL , -1 ) ; ++ xmlSecAssert2( out != NULL , -1 ) ; ++ xmlSecAssert2( transformCtx != NULL , -1 ) ; ++ ++ if( ctx->material != NULL ) { ++ xmlSecBufferDestroy( ctx->material ) ; ++ ctx->material = NULL ; ++ } ++ ++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_GetBlockSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ ctx->material = xmlSecBufferCreate( blockSize ) ; ++ if( ctx->material == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferCreate" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ /* read raw key material into context */ ++ if( xmlSecBufferSetData( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferSetData" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferRemoveHead" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ return(0); ++} ++ ++/** ++ * key wrap transform update ++ */ ++static int ++xmlSecNssKeyWrapCtxUpdate( ++ xmlSecNssKeyWrapCtxPtr ctx , ++ xmlSecBufferPtr in , ++ xmlSecBufferPtr out , ++ int encrypt , ++ xmlSecTransformCtxPtr transformCtx ++) { ++ xmlSecAssert2( ctx != NULL , -1 ) ; ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; ++ xmlSecAssert2( ctx->material != NULL , -1 ) ; ++ xmlSecAssert2( in != NULL , -1 ) ; ++ xmlSecAssert2( out != NULL , -1 ) ; ++ xmlSecAssert2( transformCtx != NULL , -1 ) ; ++ ++ /* read raw key material and append into context */ ++ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferAppend" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferRemoveHead" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ return(0); ++} ++ ++static int ++xmlSecNssKWDes3BufferReverse(xmlSecByte *buf, xmlSecSize size) { ++ xmlSecSize s; ++ xmlSecSize i; ++ xmlSecByte c; ++ ++ xmlSecAssert2(buf != NULL, -1); ++ ++ s = size / 2; ++ --size; ++ for(i = 0; i < s; ++i) { ++ c = buf[i]; ++ buf[i] = buf[size - i]; ++ buf[size - i] = c; ++ } ++ return(0); ++} ++ ++static xmlSecByte * ++xmlSecNssComputeSHA1(const xmlSecByte *in, xmlSecSize inSize, ++ xmlSecByte *out, xmlSecSize outSize) ++{ ++ PK11Context *context = NULL; ++ SECStatus s; ++ xmlSecByte *digest = NULL; ++ unsigned int len; ++ ++ xmlSecAssert2(in != NULL, NULL); ++ xmlSecAssert2(out != NULL, NULL); ++ xmlSecAssert2(outSize >= SHA1_LENGTH, NULL); ++ ++ /* Create a context for hashing (digesting) */ ++ context = PK11_CreateDigestContext(SEC_OID_SHA1); ++ if (context == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_CreateDigestContext", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ s = PK11_DigestBegin(context); ++ if (s != SECSuccess) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_DigestBegin", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ s = PK11_DigestOp(context, in, inSize); ++ if (s != SECSuccess) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_DigestOp", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ s = PK11_DigestFinal(context, out, &len, outSize); ++ if (s != SECSuccess) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_DigestFinal", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "error code = %d", PORT_GetError()); ++ goto done; ++ } ++ xmlSecAssert2(len == SHA1_LENGTH, NULL); ++ ++ digest = out; ++ ++done: ++ if (context != NULL) { ++ PK11_DestroyContext(context, PR_TRUE); ++ } ++ return (digest); ++} ++ ++static int ++xmlSecNssKWDes3Encrypt( ++ PK11SymKey* symKey , ++ CK_MECHANISM_TYPE cipherMech , ++ const xmlSecByte* iv , ++ xmlSecSize ivSize , ++ const xmlSecByte* in , ++ xmlSecSize inSize , ++ xmlSecByte* out , ++ xmlSecSize outSize , ++ int enc ++) { ++ PK11Context* EncContext = NULL; ++ SECItem ivItem ; ++ SECItem* secParam = NULL ; ++ int tmp1_outlen; ++ unsigned int tmp2_outlen; ++ int result_len = -1; ++ SECStatus rv; ++ ++ xmlSecAssert2( cipherMech != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( symKey != NULL , -1 ) ; ++ xmlSecAssert2(iv != NULL, -1); ++ xmlSecAssert2(ivSize == XMLSEC_NSS_DES3_IV_LENGTH, -1); ++ xmlSecAssert2(in != NULL, -1); ++ xmlSecAssert2(inSize > 0, -1); ++ xmlSecAssert2(out != NULL, -1); ++ xmlSecAssert2(outSize >= inSize, -1); ++ ++ /* Prepare IV */ ++ ivItem.data = ( unsigned char* )iv ; ++ ivItem.len = ivSize ; ++ ++ secParam = PK11_ParamFromIV(cipherMech, &ivItem); ++ if (secParam == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_ParamFromIV", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "Error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ EncContext = PK11_CreateContextBySymKey(cipherMech, ++ enc ? CKA_ENCRYPT : CKA_DECRYPT, ++ symKey, secParam); ++ if (EncContext == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_CreateContextBySymKey", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "Error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ tmp1_outlen = tmp2_outlen = 0; ++ rv = PK11_CipherOp(EncContext, out, &tmp1_outlen, outSize, ++ (unsigned char *)in, inSize); ++ if (rv != SECSuccess) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_CipherOp", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "Error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ rv = PK11_DigestFinal(EncContext, out+tmp1_outlen, ++ &tmp2_outlen, outSize-tmp1_outlen); ++ if (rv != SECSuccess) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_DigestFinal", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "Error code = %d", PORT_GetError()); ++ goto done; ++ } ++ ++ result_len = tmp1_outlen + tmp2_outlen; ++ ++done: ++ if (secParam) { ++ SECITEM_FreeItem(secParam, PR_TRUE); ++ } ++ if (EncContext) { ++ PK11_DestroyContext(EncContext, PR_TRUE); ++ } ++ ++ return(result_len); ++} ++ ++static int ++xmlSecNssKeyWrapDesOp( ++ xmlSecNssKeyWrapCtxPtr ctx , ++ int encrypt , ++ xmlSecBufferPtr result ++) { ++ xmlSecByte sha1[SHA1_LENGTH]; ++ xmlSecByte iv[XMLSEC_NSS_DES3_IV_LENGTH]; ++ xmlSecByte* in; ++ xmlSecSize inSize; ++ xmlSecByte* out; ++ xmlSecSize outSize; ++ xmlSecSize s; ++ int ret; ++ SECStatus status; ++ ++ xmlSecAssert2( ctx != NULL , -1 ) ; ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; ++ xmlSecAssert2( ctx->material != NULL , -1 ) ; ++ xmlSecAssert2( result != NULL , -1 ) ; ++ ++ in = xmlSecBufferGetData(ctx->material); ++ inSize = xmlSecBufferGetSize(ctx->material) ; ++ out = xmlSecBufferGetData(result); ++ outSize = xmlSecBufferGetMaxSize(result) ; ++ if( encrypt ) { ++ /* step 2: calculate sha1 and CMS */ ++ if(xmlSecNssComputeSHA1(in, inSize, sha1, SHA1_LENGTH) == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssComputeSHA1", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ /* step 3: construct WKCKS */ ++ memcpy(out, in, inSize); ++ memcpy(out + inSize, sha1, XMLSEC_NSS_DES3_BLOCK_LENGTH); ++ ++ /* step 4: generate random iv */ ++ status = PK11_GenerateRandom(iv, XMLSEC_NSS_DES3_IV_LENGTH); ++ if(status != SECSuccess) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PK11_GenerateRandom", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ "error code = %d", PORT_GetError()); ++ return(-1); ++ } ++ ++ /* step 5: first encryption, result is TEMP1 */ ++ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, ++ iv, XMLSEC_NSS_DES3_IV_LENGTH, ++ out, inSize + XMLSEC_NSS_DES3_IV_LENGTH, ++ out, outSize, 1); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssKWDes3Encrypt", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ /* step 6: construct TEMP2=IV || TEMP1 */ ++ memmove(out + XMLSEC_NSS_DES3_IV_LENGTH, out, ++ inSize + XMLSEC_NSS_DES3_IV_LENGTH); ++ memcpy(out, iv, XMLSEC_NSS_DES3_IV_LENGTH); ++ s = ret + XMLSEC_NSS_DES3_IV_LENGTH; ++ ++ /* step 7: reverse octets order, result is TEMP3 */ ++ ret = xmlSecNssKWDes3BufferReverse(out, s); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssKWDes3BufferReverse", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ /* step 8: second encryption with static IV */ ++ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, ++ xmlSecNssKWDes3Iv, XMLSEC_NSS_DES3_IV_LENGTH, ++ out, s, ++ out, outSize, 1); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssKWDes3Encrypt", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ s = ret; ++ ++ if( xmlSecBufferSetSize( result , s ) < 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecBufferSetSize", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ } else { ++ /* step 2: first decryption with static IV, result is TEMP3 */ ++ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, ++ xmlSecNssKWDes3Iv, XMLSEC_NSS_DES3_IV_LENGTH, ++ in, inSize, ++ out, outSize, 0); ++ if((ret < 0) || (ret < XMLSEC_NSS_DES3_IV_LENGTH)) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssKWDes3Encrypt", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ s = ret; ++ ++ /* step 3: reverse octets order in TEMP3, result is TEMP2 */ ++ ret = xmlSecNssKWDes3BufferReverse(out, s); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssKWDes3BufferReverse", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ /* steps 4 and 5: get IV and decrypt second time, result is WKCKS */ ++ ret = xmlSecNssKWDes3Encrypt( ctx->symkey, ctx->cipher, ++ out, XMLSEC_NSS_DES3_IV_LENGTH, ++ out+XMLSEC_NSS_DES3_IV_LENGTH, s-XMLSEC_NSS_DES3_IV_LENGTH, ++ out, outSize, 0); ++ if((ret < 0) || (ret < XMLSEC_NSS_DES3_BLOCK_LENGTH)) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssKWDes3Encrypt", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ s = ret - XMLSEC_NSS_DES3_IV_LENGTH; ++ ++ /* steps 6 and 7: calculate SHA1 and validate it */ ++ if(xmlSecNssComputeSHA1(out, s, sha1, SHA1_LENGTH) == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssComputeSHA1", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ if(memcmp(sha1, out + s, XMLSEC_NSS_DES3_BLOCK_LENGTH) != 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ NULL, ++ XMLSEC_ERRORS_R_INVALID_DATA, ++ "SHA1 does not match"); ++ return(-1); ++ } ++ ++ if( xmlSecBufferSetSize( result , s ) < 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecBufferSetSize", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ } ++ ++ return(0); ++} ++ ++static int ++xmlSecNssKeyWrapAesOp( ++ xmlSecNssKeyWrapCtxPtr ctx , ++ int encrypt , ++ xmlSecBufferPtr result ++) { ++ PK11Context* cipherCtx = NULL; ++ SECItem ivItem ; ++ SECItem* secParam = NULL ; ++ xmlSecSize inSize ; ++ xmlSecSize inBlocks ; ++ int blockSize ; ++ int midSize ; ++ int finSize ; ++ xmlSecByte* out ; ++ xmlSecSize outSize; ++ ++ xmlSecAssert2( ctx != NULL , -1 ) ; ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; ++ xmlSecAssert2( ctx->material != NULL , -1 ) ; ++ xmlSecAssert2( result != NULL , -1 ) ; ++ ++ /* Do not set any IV */ ++ memset(&ivItem, 0, sizeof(ivItem)); ++ ++ /* Get block size */ ++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_GetBlockSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ inSize = xmlSecBufferGetSize( ctx->material ) ; ++ if( xmlSecBufferSetMaxSize( result , inSize + blockSize ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferSetMaxSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ /* Get Param for context initialization */ ++ if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_ParamFromIV" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ cipherCtx = PK11_CreateContextBySymKey( ctx->cipher , encrypt ? CKA_ENCRYPT : CKA_DECRYPT , ctx->symkey , secParam ) ; ++ if( cipherCtx == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_CreateContextBySymKey" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ SECITEM_FreeItem( secParam , PR_TRUE ) ; ++ return(-1); ++ } ++ ++ out = xmlSecBufferGetData(result) ; ++ outSize = xmlSecBufferGetMaxSize(result) ; ++ if( PK11_CipherOp( cipherCtx , out, &midSize , outSize , xmlSecBufferGetData( ctx->material ) , inSize ) != SECSuccess ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_CipherOp" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ if( PK11_DigestFinal( cipherCtx , out + midSize , &finSize , outSize - midSize ) != SECSuccess ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_DigestFinal" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ if( xmlSecBufferSetSize( result , midSize + finSize ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferSetSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ return 0 ; ++} ++ ++/** ++ * Block cipher transform final ++ */ ++static int ++xmlSecNssKeyWrapCtxFinal( ++ xmlSecNssKeyWrapCtxPtr ctx , ++ xmlSecBufferPtr in , ++ xmlSecBufferPtr out , ++ int encrypt , ++ xmlSecTransformCtxPtr transformCtx ++) { ++ PK11SymKey* targetKey ; ++ xmlSecSize blockSize ; ++ xmlSecBufferPtr result ; ++ ++ xmlSecAssert2( ctx != NULL , -1 ) ; ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; ++ xmlSecAssert2( ctx->material != NULL , -1 ) ; ++ xmlSecAssert2( in != NULL , -1 ) ; ++ xmlSecAssert2( out != NULL , -1 ) ; ++ xmlSecAssert2( transformCtx != NULL , -1 ) ; ++ ++ /* read raw key material and append into context */ ++ if( xmlSecBufferAppend( ctx->material, xmlSecBufferGetData(in), xmlSecBufferGetSize(in) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferAppend" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ if( xmlSecBufferRemoveHead( in , xmlSecBufferGetSize(in) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferRemoveHead" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ /* Now we get all of the key materail */ ++ /* from now on we will wrap or unwrap the key */ ++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_GetBlockSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ result = xmlSecBufferCreate( blockSize ) ; ++ if( result == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferCreate" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ switch( ctx->cipher ) { ++ case CKM_DES3_CBC : ++ if( xmlSecNssKeyWrapDesOp(ctx, encrypt, result) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssKeyWrapDesOp" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecBufferDestroy(result); ++ return(-1); ++ } ++ break ; ++ /* case CKM_NETSCAPE_AES_KEY_WRAP :*/ ++ case CKM_AES_CBC : ++ if( xmlSecNssKeyWrapAesOp(ctx, encrypt, result) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssKeyWrapAesOp" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecBufferDestroy(result); ++ return(-1); ++ } ++ break ; ++ } ++ ++ /* Write output */ ++ if( xmlSecBufferAppend( out, xmlSecBufferGetData(result), xmlSecBufferGetSize(result) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferAppend" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecBufferDestroy(result); ++ return(-1); ++ } ++ xmlSecBufferDestroy(result); ++ ++ return(0); ++} ++ ++static int ++xmlSecNssKeyWrapExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) { ++ xmlSecNssKeyWrapCtxPtr context = NULL ; ++ xmlSecBufferPtr inBuf, outBuf ; ++ int operation ; ++ int rtv ; ++ ++ xmlSecAssert2( xmlSecNssKeyWrapCheckId( transform ), -1 ) ; ++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssKeyWrapSize ), -1 ) ; ++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; ++ xmlSecAssert2( transformCtx != NULL , -1 ) ; ++ ++ context = xmlSecNssKeyWrapGetCtx( transform ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssKeyWrapGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ inBuf = &( transform->inBuf ) ; ++ outBuf = &( transform->outBuf ) ; ++ ++ if( transform->status == xmlSecTransformStatusNone ) { ++ transform->status = xmlSecTransformStatusWorking ; ++ } ++ ++ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ; ++ if( transform->status == xmlSecTransformStatusWorking ) { ++ if( context->material == NULL ) { ++ rtv = xmlSecNssKeyWrapCtxInit( context, inBuf , outBuf , operation , transformCtx ) ; ++ if( rtv < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssKeyWrapCtxInit" , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ } ++ ++ if( context->material == NULL && last != 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ NULL , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ "No enough data to intialize transform" ) ; ++ return(-1); ++ } ++ ++ if( context->material != NULL ) { ++ rtv = xmlSecNssKeyWrapCtxUpdate( context, inBuf , outBuf , operation , transformCtx ) ; ++ if( rtv < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssKeyWrapCtxUpdate" , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ } ++ ++ if( last ) { ++ rtv = xmlSecNssKeyWrapCtxFinal( context, inBuf , outBuf , operation , transformCtx ) ; ++ if( rtv < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssKeyWrapCtxFinal" , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ transform->status = xmlSecTransformStatusFinished ; ++ } ++ } else if( transform->status == xmlSecTransformStatusFinished ) { ++ if( xmlSecBufferGetSize( inBuf ) != 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ NULL , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ "status=%d", transform->status ) ; ++ return(-1); ++ } ++ } else { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ NULL , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ "status=%d", transform->status ) ; ++ return(-1); ++ } ++ ++ return(0); ++} ++ ++#ifndef XMLSEC_NO_AES ++ ++ ++#ifdef __MINGW32__ // for runtime-pseudo-reloc ++static struct _xmlSecTransformKlass xmlSecNssKWAes128Klass = { ++#else ++static xmlSecTransformKlass xmlSecNssKWAes128Klass = { ++#endif ++ /* klass/object sizes */ ++ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ ++ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ ++ ++ xmlSecNameKWAes128, /* const xmlChar* name; */ ++ xmlSecHrefKWAes128, /* const xmlChar* href; */ ++ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ ++ ++ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ ++ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ ++ NULL, /* xmlSecTransformNodeReadMethod readNode; */ ++ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ ++ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ ++ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ ++ NULL, /* xmlSecTransformValidateMethod validate; */ ++ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ ++ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ ++ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ ++ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ ++ NULL, /* xmlSecTransformPopXmlMethod popXml; */ ++ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ ++ ++ NULL, /* void* reserved0; */ ++ NULL, /* void* reserved1; */ ++}; ++ ++#ifdef __MINGW32__ // for runtime-pseudo-reloc ++static struct _xmlSecTransformKlass xmlSecNssKWAes192Klass = { ++#else ++static xmlSecTransformKlass xmlSecNssKWAes192Klass = { ++#endif ++ /* klass/object sizes */ ++ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ ++ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ ++ ++ xmlSecNameKWAes192, /* const xmlChar* name; */ ++ xmlSecHrefKWAes192, /* const xmlChar* href; */ ++ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ ++ ++ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ ++ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ ++ NULL, /* xmlSecTransformNodeReadMethod readNode; */ ++ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ ++ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ ++ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ ++ NULL, /* xmlSecTransformValidateMethod validate; */ ++ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ ++ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ ++ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ ++ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ ++ NULL, /* xmlSecTransformPopXmlMethod popXml; */ ++ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ ++ ++ NULL, /* void* reserved0; */ ++ NULL, /* void* reserved1; */ ++}; ++ ++#ifdef __MINGW32__ // for runtime-pseudo-reloc ++static struct _xmlSecTransformKlass xmlSecNssKWAes256Klass = { ++#else ++static xmlSecTransformKlass xmlSecNssKWAes256Klass = { ++#endif ++ /* klass/object sizes */ ++ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ ++ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ ++ ++ xmlSecNameKWAes256, /* const xmlChar* name; */ ++ xmlSecHrefKWAes256, /* const xmlChar* href; */ ++ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ ++ ++ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ ++ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ ++ NULL, /* xmlSecTransformNodeReadMethod readNode; */ ++ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ ++ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ ++ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ ++ NULL, /* xmlSecTransformValidateMethod validate; */ ++ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ ++ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ ++ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ ++ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ ++ NULL, /* xmlSecTransformPopXmlMethod popXml; */ ++ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ ++ ++ NULL, /* void* reserved0; */ ++ NULL, /* void* reserved1; */ ++}; ++ ++/** ++ * xmlSecNssTransformKWAes128GetKlass: ++ * ++ * The AES-128 key wrapper transform klass. ++ * ++ * Returns AES-128 key wrapper transform klass. ++ */ ++xmlSecTransformId ++xmlSecNssTransformKWAes128GetKlass(void) { ++ return(&xmlSecNssKWAes128Klass); ++} ++ ++/** ++ * xmlSecNssTransformKWAes192GetKlass: ++ * ++ * The AES-192 key wrapper transform klass. ++ * ++ * Returns AES-192 key wrapper transform klass. ++ */ ++xmlSecTransformId ++xmlSecNssTransformKWAes192GetKlass(void) { ++ return(&xmlSecNssKWAes192Klass); ++} ++ ++/** ++ * ++ * The AES-256 key wrapper transform klass. ++ * ++ * Returns AES-256 key wrapper transform klass. ++ */ ++xmlSecTransformId ++xmlSecNssTransformKWAes256GetKlass(void) { ++ return(&xmlSecNssKWAes256Klass); ++} ++ ++#endif /* XMLSEC_NO_AES */ ++ ++ ++#ifndef XMLSEC_NO_DES ++ ++#ifdef __MINGW32__ // for runtime-pseudo-reloc ++static struct _xmlSecTransformKlass xmlSecNssKWDes3Klass = { ++#else ++static xmlSecTransformKlass xmlSecNssKWDes3Klass = { ++#endif ++ /* klass/object sizes */ ++ sizeof(xmlSecTransformKlass), /* xmlSecSize klassSize */ ++ xmlSecNssKeyWrapSize, /* xmlSecSize objSize */ ++ ++ xmlSecNameKWDes3, /* const xmlChar* name; */ ++ xmlSecHrefKWDes3, /* const xmlChar* href; */ ++ xmlSecTransformUsageEncryptionMethod, /* xmlSecAlgorithmUsage usage; */ ++ ++ xmlSecNssKeyWrapInitialize, /* xmlSecTransformInitializeMethod initialize; */ ++ xmlSecNssKeyWrapFinalize, /* xmlSecTransformFinalizeMethod finalize; */ ++ NULL, /* xmlSecTransformNodeReadMethod readNode; */ ++ NULL, /* xmlSecTransformNodeWriteMethod writeNode; */ ++ xmlSecNssKeyWrapSetKeyReq, /* xmlSecTransformSetKeyMethod setKeyReq; */ ++ xmlSecNssKeyWrapSetKey, /* xmlSecTransformSetKeyMethod setKey; */ ++ NULL, /* xmlSecTransformValidateMethod validate; */ ++ xmlSecTransformDefaultGetDataType, /* xmlSecTransformGetDataTypeMethod getDataType; */ ++ xmlSecTransformDefaultPushBin, /* xmlSecTransformPushBinMethod pushBin; */ ++ xmlSecTransformDefaultPopBin, /* xmlSecTransformPopBinMethod popBin; */ ++ NULL, /* xmlSecTransformPushXmlMethod pushXml; */ ++ NULL, /* xmlSecTransformPopXmlMethod popXml; */ ++ xmlSecNssKeyWrapExecute, /* xmlSecTransformExecuteMethod execute; */ ++ ++ NULL, /* void* reserved0; */ ++ NULL, /* void* reserved1; */ ++}; ++ ++/** ++ * xmlSecNssTransformKWDes3GetKlass: ++ * ++ * The Triple DES key wrapper transform klass. ++ * ++ * Returns Triple DES key wrapper transform klass. ++ */ ++xmlSecTransformId ++xmlSecNssTransformKWDes3GetKlass(void) { ++ return(&xmlSecNssKWDes3Klass); ++} ++ ++#endif /* XMLSEC_NO_DES */ ++ +--- misc/xmlsec1-1.2.14/src/nss/pkikeys.c 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/pkikeys.c 2009-09-21 14:02:48.657352624 +0200 +@@ -24,6 +24,7 @@ + #include <xmlsec/nss/crypto.h> + #include <xmlsec/nss/bignum.h> + #include <xmlsec/nss/pkikeys.h> ++#include <xmlsec/nss/tokens.h> + + /************************************************************************** + * +@@ -115,6 +116,8 @@ + xmlSecNssPKIKeyDataCtxPtr ctxSrc) + { + xmlSecNSSPKIKeyDataCtxFree(ctxDst); ++ ctxDst->privkey = NULL ; ++ ctxDst->pubkey = NULL ; + if (ctxSrc->privkey != NULL) { + ctxDst->privkey = SECKEY_CopyPrivateKey(ctxSrc->privkey); + if(ctxDst->privkey == NULL) { +@@ -588,13 +591,13 @@ + goto done; + } + +- slot = PK11_GetBestSlot(CKM_DSA, NULL); ++ slot = xmlSecNssSlotGet(CKM_DSA); + if(slot == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "PK11_GetBestSlot", ++ "xmlSecNssSlotGet", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + ret = -1; + goto done; + } +@@ -792,14 +795,14 @@ + if (slot != NULL) { + PK11_FreeSlot(slot); + } +- if (ret != 0) { ++ + if (pubkey != NULL) { + SECKEY_DestroyPublicKey(pubkey); + } + if (data != NULL) { + xmlSecKeyDataDestroy(data); + } +- } ++ + return(ret); + } + +@@ -818,7 +821,7 @@ + + ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key)); + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1); ++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/ + + if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) { + /* we can have only private key or public key */ +@@ -940,7 +943,8 @@ + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + "PK11_PQG_ParamGen", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- "size=%d", sizeBits); ++ "size=%d, error code=%d", sizeBits, PORT_GetError()); ++ ret = -1; + goto done; + } + +@@ -950,11 +954,12 @@ + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + "PK11_PQG_VerifyParams", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- "size=%d", sizeBits); ++ "size=%d, error code=%d", sizeBits, PORT_GetError()); ++ ret = -1; + goto done; + } + +- slot = PK11_GetBestSlot(CKM_DSA_KEY_PAIR_GEN, NULL); ++ slot = xmlSecNssSlotGet(CKM_DSA_KEY_PAIR_GEN); + PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */); + privkey = PK11_GenerateKeyPair(slot, CKM_DSA_KEY_PAIR_GEN, pqgParams, + &pubkey, PR_FALSE, PR_TRUE, NULL); +@@ -964,8 +969,9 @@ + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + "PK11_GenerateKeyPair", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + ++ ret = -1; + goto done; + } + +@@ -979,6 +985,8 @@ + goto done; + } + ++ privkey = NULL ; ++ pubkey = NULL ; + ret = 0; + + done: +@@ -991,16 +999,13 @@ + if (pqgVerify != NULL) { + PK11_PQG_DestroyVerify(pqgVerify); + } +- if (ret == 0) { +- return (0); +- } + if (pubkey != NULL) { + SECKEY_DestroyPublicKey(pubkey); + } + if (privkey != NULL) { + SECKEY_DestroyPrivateKey(privkey); + } +- return(-1); ++ return(ret); + } + + static xmlSecKeyDataType +@@ -1010,10 +1015,10 @@ + xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), xmlSecKeyDataTypeUnknown); + ctx = xmlSecNssPKIKeyDataGetCtx(data); + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1); ++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/ + if (ctx->privkey != NULL) { + return(xmlSecKeyDataTypePrivate | xmlSecKeyDataTypePublic); +- } else { ++ } else if( ctx->pubkey != NULL ) { + return(xmlSecKeyDataTypePublic); + } + +@@ -1027,7 +1032,7 @@ + xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDsaId), 0); + ctx = xmlSecNssPKIKeyDataGetCtx(data); + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1); ++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == dsaKey, -1);*/ + + return(8 * SECKEY_PublicKeyStrength(ctx->pubkey)); + } +@@ -1216,13 +1221,13 @@ + goto done; + } + +- slot = PK11_GetBestSlot(CKM_RSA_PKCS, NULL); ++ slot = xmlSecNssSlotGet(CKM_RSA_PKCS); + if(slot == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "PK11_GetBestSlot", ++ "xmlSecNssSlotGet", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + ret = -1; + goto done; + } +@@ -1384,7 +1389,7 @@ + + ctx = xmlSecNssPKIKeyDataGetCtx(xmlSecKeyGetValue(key)); + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1); ++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/ + + + if(((xmlSecKeyDataTypePublic | xmlSecKeyDataTypePrivate) & keyInfoCtx->keyReq.keyType) == 0) { +@@ -1455,7 +1460,7 @@ + params.keySizeInBits = sizeBits; + params.pe = 65537; + +- slot = PK11_GetBestSlot(CKM_RSA_PKCS_KEY_PAIR_GEN, NULL); ++ slot = xmlSecNssSlotGet(CKM_RSA_PKCS_KEY_PAIR_GEN); + PK11_Authenticate(slot, PR_TRUE, NULL /* default pwd callback */); + privkey = PK11_GenerateKeyPair(slot, CKM_RSA_PKCS_KEY_PAIR_GEN, ¶ms, + &pubkey, PR_FALSE, PR_TRUE, NULL); +@@ -1525,7 +1530,7 @@ + + ctx = xmlSecNssPKIKeyDataGetCtx(data); + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1); ++/* xmlSecAssert2(SECKEY_GetPublicKeyType(ctx->pubkey) == rsaKey, -1);*/ + + return(8 * SECKEY_PublicKeyStrength(ctx->pubkey)); + } +--- misc/xmlsec1-1.2.14/src/nss/symkeys.c 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/symkeys.c 2009-09-21 14:02:48.620574832 +0200 +@@ -15,20 +15,41 @@ + #include <stdio.h> + #include <string.h> + ++#include <pk11func.h> ++#include <nss.h> ++ + #include <xmlsec/xmlsec.h> + #include <xmlsec/xmltree.h> ++#include <xmlsec/base64.h> + #include <xmlsec/keys.h> + #include <xmlsec/keyinfo.h> + #include <xmlsec/transforms.h> + #include <xmlsec/errors.h> + + #include <xmlsec/nss/crypto.h> ++#include <xmlsec/nss/ciphers.h> ++#include <xmlsec/nss/tokens.h> + + /***************************************************************************** + * +- * Symmetic (binary) keys - just a wrapper for xmlSecKeyDataBinary ++ * Symmetic (binary) keys - a wrapper over slot information and PK11SymKey + * + ****************************************************************************/ ++typedef struct _xmlSecNssSymKeyDataCtx xmlSecNssSymKeyDataCtx ; ++typedef struct _xmlSecNssSymKeyDataCtx* xmlSecNssSymKeyDataCtxPtr ; ++ ++struct _xmlSecNssSymKeyDataCtx { ++ CK_MECHANISM_TYPE cipher ; /* the symmetic key mechanism */ ++ PK11SlotInfo* slot ; /* the key resident slot */ ++ PK11SymKey* symkey ; /* the symmetic key */ ++} ; ++ ++#define xmlSecNssSymKeyDataSize \ ++ ( sizeof( xmlSecKeyData ) + sizeof( xmlSecNssSymKeyDataCtx ) ) ++ ++#define xmlSecNssSymKeyDataGetCtx( data ) \ ++ ( ( xmlSecNssSymKeyDataCtxPtr )( ( ( xmlSecByte* )( data ) ) + sizeof( xmlSecKeyData ) ) ) ++ + static int xmlSecNssSymKeyDataInitialize (xmlSecKeyDataPtr data); + static int xmlSecNssSymKeyDataDuplicate (xmlSecKeyDataPtr dst, + xmlSecKeyDataPtr src); +@@ -67,107 +88,743 @@ + (xmlSecKeyDataIsValid((data)) && \ + xmlSecNssSymKeyDataKlassCheck((data)->id)) + ++/** ++ * xmlSecNssSymKeyDataAdoptKey: ++ * @data: the pointer to symmetric key data. ++ * @symkey: the symmetric key ++ * ++ * Set the value of symmetric key data. ++ * ++ * Returns 0 on success or a negative value if an error occurs. ++ */ ++int ++xmlSecNssSymKeyDataAdoptKey( ++ xmlSecKeyDataPtr data , ++ PK11SymKey* symkey ++) { ++ xmlSecNssSymKeyDataCtxPtr context = NULL ; ++ ++ xmlSecAssert2( xmlSecNssSymKeyDataCheckId( data ), -1 ) ; ++ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), -1 ) ; ++ xmlSecAssert2( symkey != NULL, -1 ) ; ++ ++ context = xmlSecNssSymKeyDataGetCtx( data ) ; ++ xmlSecAssert2(context != NULL, -1); ++ ++ context->cipher = PK11_GetMechanism( symkey ) ; ++ ++ if( context->slot != NULL ) { ++ PK11_FreeSlot( context->slot ) ; ++ context->slot = NULL ; ++ } ++ context->slot = PK11_GetSlotFromKey( symkey ) ; ++ ++ if( context->symkey != NULL ) { ++ PK11_FreeSymKey( context->symkey ) ; ++ context->symkey = NULL ; ++ } ++ context->symkey = PK11_ReferenceSymKey( symkey ) ; ++ ++ return 0 ; ++} ++ ++xmlSecKeyDataPtr xmlSecNssSymKeyDataKeyAdopt( ++ PK11SymKey* symKey ++) { ++ xmlSecKeyDataPtr data = NULL ; ++ CK_MECHANISM_TYPE mechanism = CKM_INVALID_MECHANISM ; ++ ++ xmlSecAssert2( symKey != NULL , NULL ) ; ++ ++ mechanism = PK11_GetMechanism( symKey ) ; ++ switch( mechanism ) { ++ case CKM_DES3_KEY_GEN : ++ case CKM_DES3_CBC : ++ case CKM_DES3_MAC : ++ data = xmlSecKeyDataCreate( xmlSecNssKeyDataDesId ) ; ++ if( data == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeyDataCreate" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ "xmlSecNssKeyDataDesId" ) ; ++ return NULL ; ++ } ++ break ; ++ case CKM_AES_KEY_GEN : ++ case CKM_AES_CBC : ++ case CKM_AES_MAC : ++ data = xmlSecKeyDataCreate( xmlSecNssKeyDataAesId ) ; ++ if( data == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecKeyDataCreate" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ "xmlSecNssKeyDataDesId" ) ; ++ return NULL ; ++ } ++ break ; ++ default : ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ "Unsupported mechanism" ) ; ++ return NULL ; ++ } ++ ++ if( xmlSecNssSymKeyDataAdoptKey( data , symKey ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecNssSymKeyDataAdoptKey" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecKeyDataDestroy( data ) ; ++ return NULL ; ++ } ++ ++ return data ; ++} ++ ++ ++PK11SymKey* ++xmlSecNssSymKeyDataGetKey( ++ xmlSecKeyDataPtr data ++) { ++ xmlSecNssSymKeyDataCtxPtr ctx; ++ PK11SymKey* symkey ; ++ ++ xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), NULL); ++ xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize), NULL); ++ ++ ctx = xmlSecNssSymKeyDataGetCtx(data); ++ xmlSecAssert2(ctx != NULL, NULL); ++ ++ if( ctx->symkey != NULL ) { ++ symkey = PK11_ReferenceSymKey( ctx->symkey ) ; ++ } else { ++ symkey = NULL ; ++ } ++ ++ return(symkey); ++} ++ + static int + xmlSecNssSymKeyDataInitialize(xmlSecKeyDataPtr data) { ++ xmlSecNssSymKeyDataCtxPtr ctx; ++ + xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1); +- +- return(xmlSecKeyDataBinaryValueInitialize(data)); ++ xmlSecAssert2(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize), -1); ++ ++ ctx = xmlSecNssSymKeyDataGetCtx(data); ++ xmlSecAssert2(ctx != NULL, -1); ++ ++ memset( ctx, 0, sizeof(xmlSecNssSymKeyDataCtx)); ++ ++ /* Set the block cipher mechanism */ ++#ifndef XMLSEC_NO_DES ++ if(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDesId)) { ++ ctx->cipher = CKM_DES3_KEY_GEN; ++ } else ++#endif /* XMLSEC_NO_DES */ ++ ++#ifndef XMLSEC_NO_AES ++ if(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataDesId)) { ++ ctx->cipher = CKM_AES_KEY_GEN; ++ } else ++#endif /* XMLSEC_NO_AES */ ++ ++ if(1) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ "Unsupported block cipher" ) ; ++ return(-1) ; ++ } ++ ++ return(0); + } + + static int + xmlSecNssSymKeyDataDuplicate(xmlSecKeyDataPtr dst, xmlSecKeyDataPtr src) { ++ xmlSecNssSymKeyDataCtxPtr ctxDst; ++ xmlSecNssSymKeyDataCtxPtr ctxSrc; ++ + xmlSecAssert2(xmlSecNssSymKeyDataCheckId(dst), -1); ++ xmlSecAssert2(xmlSecKeyDataCheckSize(dst, xmlSecNssSymKeyDataSize), -1); + xmlSecAssert2(xmlSecNssSymKeyDataCheckId(src), -1); ++ xmlSecAssert2(xmlSecKeyDataCheckSize(src, xmlSecNssSymKeyDataSize), -1); + xmlSecAssert2(dst->id == src->id, -1); +- +- return(xmlSecKeyDataBinaryValueDuplicate(dst, src)); ++ ++ ctxDst = xmlSecNssSymKeyDataGetCtx(dst); ++ xmlSecAssert2(ctxDst != NULL, -1); ++ ++ ctxSrc = xmlSecNssSymKeyDataGetCtx(src); ++ xmlSecAssert2(ctxSrc != NULL, -1); ++ ++ ctxDst->cipher = ctxSrc->cipher ; ++ ++ if( ctxSrc->slot != NULL ) { ++ if( ctxDst->slot != NULL && ctxDst->slot != ctxSrc->slot ) { ++ PK11_FreeSlot( ctxDst->slot ) ; ++ ctxDst->slot = NULL ; ++ } ++ ++ if( ctxDst->slot == NULL && ctxSrc->slot != NULL ) ++ ctxDst->slot = PK11_ReferenceSlot( ctxSrc->slot ) ; ++ } else { ++ if( ctxDst->slot != NULL ) { ++ PK11_FreeSlot( ctxDst->slot ) ; ++ ctxDst->slot = NULL ; ++ } ++ } ++ ++ if( ctxSrc->symkey != NULL ) { ++ if( ctxDst->symkey != NULL && ctxDst->symkey != ctxSrc->symkey ) { ++ PK11_FreeSymKey( ctxDst->symkey ) ; ++ ctxDst->symkey = NULL ; ++ } ++ ++ if( ctxDst->symkey == NULL && ctxSrc->symkey != NULL ) ++ ctxDst->symkey = PK11_ReferenceSymKey( ctxSrc->symkey ) ; ++ } else { ++ if( ctxDst->symkey != NULL ) { ++ PK11_FreeSymKey( ctxDst->symkey ) ; ++ ctxDst->symkey = NULL ; ++ } ++ } ++ ++ return(0); + } + + static void + xmlSecNssSymKeyDataFinalize(xmlSecKeyDataPtr data) { ++ xmlSecNssSymKeyDataCtxPtr ctx; ++ + xmlSecAssert(xmlSecNssSymKeyDataCheckId(data)); +- +- xmlSecKeyDataBinaryValueFinalize(data); ++ xmlSecAssert(xmlSecKeyDataCheckSize(data, xmlSecNssSymKeyDataSize)); ++ ++ ctx = xmlSecNssSymKeyDataGetCtx(data); ++ xmlSecAssert(ctx != NULL); ++ ++ if( ctx->slot != NULL ) { ++ PK11_FreeSlot( ctx->slot ) ; ++ ctx->slot = NULL ; ++ } ++ ++ if( ctx->symkey != NULL ) { ++ PK11_FreeSymKey( ctx->symkey ) ; ++ ctx->symkey = NULL ; ++ } ++ ++ ctx->cipher = CKM_INVALID_MECHANISM ; + } + + static int + xmlSecNssSymKeyDataXmlRead(xmlSecKeyDataId id, xmlSecKeyPtr key, + xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { +- xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); ++ PK11SymKey* symKey ; ++ PK11SlotInfo* slot ; ++ xmlSecBufferPtr keyBuf; ++ xmlSecSize len; ++ xmlSecKeyDataPtr data; ++ xmlSecNssSymKeyDataCtxPtr ctx; ++ SECItem keyItem ; ++ int ret; ++ ++ xmlSecAssert2(id != xmlSecKeyDataIdUnknown, -1); ++ xmlSecAssert2(key != NULL, -1); ++ xmlSecAssert2(node != NULL, -1); ++ xmlSecAssert2(keyInfoCtx != NULL, -1); ++ ++ /* Create a new KeyData from a id */ ++ data = xmlSecKeyDataCreate(id); ++ if(data == NULL ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeyDataCreate", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ ctx = xmlSecNssSymKeyDataGetCtx(data); ++ xmlSecAssert2(ctx != NULL, -1); ++ ++ /* Create a buffer for raw symmetric key value */ ++ if( ( keyBuf = xmlSecBufferCreate( 128 ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecBufferCreate" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ /* Read the raw key value */ ++ if( xmlSecBufferBase64NodeContentRead( keyBuf , node ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ xmlSecErrorsSafeString(xmlSecNodeGetName(node)), ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecBufferDestroy( keyBuf ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ /* Get slot */ ++ slot = xmlSecNssSlotGet(ctx->cipher); ++ if( slot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecNssSlotGet" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ xmlSecBufferDestroy( keyBuf ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ /* Wrap the raw key value SECItem */ ++ keyItem.type = siBuffer ; ++ keyItem.data = xmlSecBufferGetData( keyBuf ) ; ++ keyItem.len = xmlSecBufferGetSize( keyBuf ) ; ++ ++ /* Import the raw key into slot temporalily and get the key handler*/ ++ symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginGenerated, CKA_VALUE, &keyItem, NULL ) ; ++ if( symKey == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "PK11_ImportSymKey" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ PK11_FreeSlot( slot ) ; ++ xmlSecBufferDestroy( keyBuf ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ PK11_FreeSlot( slot ) ; ++ ++ /* raw key material has been copied into symKey, it isn't used any more */ ++ xmlSecBufferDestroy( keyBuf ) ; ++ ++ /* Adopt the symmetric key into key data */ ++ ret = xmlSecNssSymKeyDataAdoptKey(data, symKey); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeyDataBinaryValueSetBuffer", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1); ++ } ++ /* symKey has been duplicated into data, it isn't used any more */ ++ PK11_FreeSymKey( symKey ) ; ++ ++ /* Check value */ ++ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), data) != 1) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeyReqMatchKeyValue", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecKeyDataDestroy( data ) ; ++ return(0); ++ } + +- return(xmlSecKeyDataBinaryValueXmlRead(id, key, node, keyInfoCtx)); ++ ret = xmlSecKeySetValue(key, data); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeySetValue", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1); ++ } ++ ++ return(0); + } + + static int + xmlSecNssSymKeyDataXmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, + xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { ++ PK11SymKey* symKey ; ++ + xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); +- +- return(xmlSecKeyDataBinaryValueXmlWrite(id, key, node, keyInfoCtx)); ++ xmlSecAssert2(key != NULL, -1); ++ xmlSecAssert2(node != NULL, -1); ++ xmlSecAssert2(keyInfoCtx != NULL, -1); ++ ++ /* Get symmetric key from "key" */ ++ symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key)); ++ if( symKey != NULL ) { ++ SECItem* keyItem ; ++ xmlSecBufferPtr keyBuf ; ++ ++ /* Extract raw key data from symmetric key */ ++ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "PK11_ExtractKeyValue", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ ++ /* Get raw key data from "symKey" */ ++ keyItem = PK11_GetKeyData( symKey ) ; ++ if(keyItem == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "PK11_GetKeyData", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ ++ /* Create key data buffer with raw kwy material */ ++ keyBuf = xmlSecBufferCreate(keyItem->len) ; ++ if(keyBuf == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecBufferCreate", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ ++ xmlSecBufferSetData( keyBuf , keyItem->data , keyItem->len ) ; ++ ++ /* Write raw key material into current xml node */ ++ if( xmlSecBufferBase64NodeContentWrite( keyBuf, node, XMLSEC_BASE64_LINESIZE ) < 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecBufferBase64NodeContentWrite", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecBufferDestroy(keyBuf); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ xmlSecBufferDestroy(keyBuf); ++ PK11_FreeSymKey( symKey ) ; ++ } ++ ++ return 0 ; + } + + static int + xmlSecNssSymKeyDataBinRead(xmlSecKeyDataId id, xmlSecKeyPtr key, + const xmlSecByte* buf, xmlSecSize bufSize, + xmlSecKeyInfoCtxPtr keyInfoCtx) { +- xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); ++ PK11SymKey* symKey ; ++ PK11SlotInfo* slot ; ++ xmlSecKeyDataPtr data; ++ xmlSecNssSymKeyDataCtxPtr ctx; ++ SECItem keyItem ; ++ int ret; ++ ++ xmlSecAssert2(id != xmlSecKeyDataIdUnknown, -1); ++ xmlSecAssert2(key != NULL, -1); ++ xmlSecAssert2(buf != NULL, -1); ++ xmlSecAssert2(bufSize != 0, -1); ++ xmlSecAssert2(keyInfoCtx != NULL, -1); ++ ++ /* Create a new KeyData from a id */ ++ data = xmlSecKeyDataCreate(id); ++ if(data == NULL ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeyDataCreate", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); ++ } ++ ++ ctx = xmlSecNssSymKeyDataGetCtx(data); ++ xmlSecAssert2(ctx != NULL, -1); ++ ++ /* Get slot */ ++ slot = xmlSecNssSlotGet(ctx->cipher); ++ if( slot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecNssSlotGet" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ /* Wrap the raw key value SECItem */ ++ keyItem.type = siBuffer ; ++ keyItem.data = buf ; ++ keyItem.len = bufSize ; ++ ++ /* Import the raw key into slot temporalily and get the key handler*/ ++ symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginGenerated, CKA_VALUE, &keyItem, NULL ) ; ++ if( symKey == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "PK11_ImportSymKey" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ PK11_FreeSlot( slot ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1) ; ++ } ++ ++ /* Adopt the symmetric key into key data */ ++ ret = xmlSecNssSymKeyDataAdoptKey(data, symKey); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeyDataBinaryValueSetBuffer", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ PK11_FreeSymKey( symKey ) ; ++ PK11_FreeSlot( slot ) ; ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1); ++ } ++ /* symKey has been duplicated into data, it isn't used any more */ ++ PK11_FreeSymKey( symKey ) ; ++ PK11_FreeSlot( slot ) ; ++ ++ /* Check value */ ++ if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), data) != 1) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeyReqMatchKeyValue", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecKeyDataDestroy( data ) ; ++ return(0); ++ } + +- return(xmlSecKeyDataBinaryValueBinRead(id, key, buf, bufSize, keyInfoCtx)); ++ ret = xmlSecKeySetValue(key, data); ++ if(ret < 0) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecKeySetValue", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecKeyDataDestroy( data ) ; ++ return(-1); ++ } ++ ++ return(0); + } + + static int + xmlSecNssSymKeyDataBinWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, + xmlSecByte** buf, xmlSecSize* bufSize, + xmlSecKeyInfoCtxPtr keyInfoCtx) { ++ PK11SymKey* symKey ; ++ + xmlSecAssert2(xmlSecNssSymKeyDataKlassCheck(id), -1); ++ xmlSecAssert2(key != NULL, -1); ++ xmlSecAssert2(buf != NULL, -1); ++ xmlSecAssert2(bufSize != 0, -1); ++ xmlSecAssert2(keyInfoCtx != NULL, -1); ++ ++ /* Get symmetric key from "key" */ ++ symKey = xmlSecNssSymKeyDataGetKey(xmlSecKeyGetValue(key)); ++ if( symKey != NULL ) { ++ SECItem* keyItem ; ++ ++ /* Extract raw key data from symmetric key */ ++ if( PK11_ExtractKeyValue( symKey ) != SECSuccess ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "PK11_ExtractKeyValue", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ ++ /* Get raw key data from "symKey" */ ++ keyItem = PK11_GetKeyData( symKey ) ; ++ if(keyItem == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "PK11_GetKeyData", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ ++ *bufSize = keyItem->len; ++ *buf = ( xmlSecByte* )xmlMalloc( *bufSize ); ++ if( *buf == NULL ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ NULL, ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ PK11_FreeSymKey( symKey ) ; ++ return(-1); ++ } ++ ++ memcpy((*buf), keyItem->data, (*bufSize)); ++ PK11_FreeSymKey( symKey ) ; ++ } + +- return(xmlSecKeyDataBinaryValueBinWrite(id, key, buf, bufSize, keyInfoCtx)); ++ return 0 ; + } + + static int + xmlSecNssSymKeyDataGenerate(xmlSecKeyDataPtr data, xmlSecSize sizeBits, xmlSecKeyDataType type ATTRIBUTE_UNUSED) { +- xmlSecBufferPtr buffer; ++ PK11SymKey* symkey ; ++ PK11SlotInfo* slot ; ++ xmlSecNssSymKeyDataCtxPtr ctx; ++ int ret; + + xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), -1); + xmlSecAssert2(sizeBits > 0, -1); + +- buffer = xmlSecKeyDataBinaryValueGetBuffer(data); +- xmlSecAssert2(buffer != NULL, -1); +- +- return(xmlSecNssGenerateRandom(buffer, (sizeBits + 7) / 8)); ++ ctx = xmlSecNssSymKeyDataGetCtx(data); ++ xmlSecAssert2(ctx != NULL, -1); ++ ++ if( sizeBits % 8 != 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), ++ NULL, ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "Symmetric key size must be octuple"); ++ return(-1); ++ } ++ ++ /* Get slot */ ++ slot = xmlSecNssSlotGet(ctx->cipher); ++ if( slot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), ++ "xmlSecNssSlotGet" , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1) ; ++ } ++ ++ if( PK11_Authenticate( slot, PR_FALSE , NULL ) != SECSuccess ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "PK11_Authenticate" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ PK11_FreeSlot( slot ) ; ++ return -1 ; ++ } ++ ++ symkey = PK11_KeyGen( slot , ctx->cipher , NULL , sizeBits/8 , NULL ) ; ++ if( symkey == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "PK11_KeyGen" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ PK11_FreeSlot( slot ) ; ++ return -1 ; ++ } ++ ++ if( ctx->slot != NULL ) { ++ PK11_FreeSlot( ctx->slot ) ; ++ ctx->slot = NULL ; ++ } ++ ctx->slot = slot ; ++ ++ if( ctx->symkey != NULL ) { ++ PK11_FreeSymKey( ctx->symkey ) ; ++ ctx->symkey = NULL ; ++ } ++ ctx->symkey = symkey ; ++ ++ return 0; + } + + static xmlSecKeyDataType + xmlSecNssSymKeyDataGetType(xmlSecKeyDataPtr data) { +- xmlSecBufferPtr buffer; ++ xmlSecNssSymKeyDataCtxPtr context = NULL ; ++ xmlSecKeyDataType type = xmlSecKeyDataTypeUnknown ; + + xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), xmlSecKeyDataTypeUnknown); ++ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), xmlSecKeyDataTypeUnknown ) ; + +- buffer = xmlSecKeyDataBinaryValueGetBuffer(data); +- xmlSecAssert2(buffer != NULL, xmlSecKeyDataTypeUnknown); ++ context = xmlSecNssSymKeyDataGetCtx( data ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "xmlSecNssSymKeyDataGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return xmlSecKeyDataTypeUnknown ; ++ } + +- return((xmlSecBufferGetSize(buffer) > 0) ? xmlSecKeyDataTypeSymmetric : xmlSecKeyDataTypeUnknown); ++ if( context->symkey != NULL ) { ++ type |= xmlSecKeyDataTypeSymmetric ; ++ } else { ++ type |= xmlSecKeyDataTypeUnknown ; ++ } ++ ++ return type ; + } + + static xmlSecSize + xmlSecNssSymKeyDataGetSize(xmlSecKeyDataPtr data) { ++ xmlSecNssSymKeyDataCtxPtr context ; ++ unsigned int length = 0 ; ++ + xmlSecAssert2(xmlSecNssSymKeyDataCheckId(data), 0); ++ xmlSecAssert2( xmlSecKeyDataCheckSize( data, xmlSecNssSymKeyDataSize ), 0 ) ; ++ context = xmlSecNssSymKeyDataGetCtx( data ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "xmlSecNssSymKeyDataGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return 0 ; ++ } ++ ++ if( context->symkey != NULL ) { ++ length = PK11_GetKeyLength( context->symkey ) ; ++ length *= 8 ; ++ } + +- return(xmlSecKeyDataBinaryValueGetSize(data)); ++ return length ; + } + + static void + xmlSecNssSymKeyDataDebugDump(xmlSecKeyDataPtr data, FILE* output) { + xmlSecAssert(xmlSecNssSymKeyDataCheckId(data)); + +- xmlSecKeyDataBinaryValueDebugDump(data, output); ++ /* print only size, everything else is sensitive */ ++ fprintf( output , "=== %s: size=%d\n" , data->id->dataNodeName , ++ xmlSecKeyDataGetSize(data)) ; + } + + static void + xmlSecNssSymKeyDataDebugXmlDump(xmlSecKeyDataPtr data, FILE* output) { + xmlSecAssert(xmlSecNssSymKeyDataCheckId(data)); +- +- xmlSecKeyDataBinaryValueDebugXmlDump(data, output); ++ ++ /* print only size, everything else is sensitive */ ++ fprintf( output , "<%s size=\"%d\" />\n" , data->id->dataNodeName , ++ xmlSecKeyDataGetSize(data)) ; + } + + static int +@@ -201,7 +858,7 @@ + *************************************************************************/ + static xmlSecKeyDataKlass xmlSecNssKeyDataAesKlass = { + sizeof(xmlSecKeyDataKlass), +- xmlSecKeyDataBinarySize, ++ xmlSecNssSymKeyDataSize, + + /* data */ + xmlSecNameAESKeyValue, +@@ -282,7 +939,7 @@ + *************************************************************************/ + static xmlSecKeyDataKlass xmlSecNssKeyDataDesKlass = { + sizeof(xmlSecKeyDataKlass), +- xmlSecKeyDataBinarySize, ++ xmlSecNssSymKeyDataSize, + + /* data */ + xmlSecNameDESKeyValue, +@@ -364,7 +1021,7 @@ + *************************************************************************/ + static xmlSecKeyDataKlass xmlSecNssKeyDataHmacKlass = { + sizeof(xmlSecKeyDataKlass), +- xmlSecKeyDataBinarySize, ++ xmlSecNssSymKeyDataSize, + + /* data */ + xmlSecNameHMACKeyValue, +--- misc/xmlsec1-1.2.14/src/nss/tokens.c 2009-09-21 14:07:19.249145861 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/tokens.c 2009-09-21 14:02:48.556772442 +0200 +@@ -1 +1,548 @@ +-dummy ++/** ++ * XMLSec library ++ * ++ * This is free software; see Copyright file in the source ++ * distribution for preciese wording. ++ * ++ * Copyright.................................. ++ * ++ * Contributor(s): _____________________________ ++ * ++ */ ++ ++/** ++ * In order to ensure that particular crypto operation is performed on ++ * particular crypto device, a subclass of xmlSecList is used to store slot and ++ * mechanism information. ++ * ++ * In the list, a slot is bound with a mechanism. If the mechanism is available, ++ * this mechanism only can perform on the slot; otherwise, it can perform on ++ * every eligibl slot in the list. ++ * ++ * When try to find a slot for a particular mechanism, the slot bound with ++ * avaliable mechanism will be looked up firstly. ++ */ ++#include "globals.h" ++#include <string.h> ++ ++#include <xmlsec/xmlsec.h> ++#include <xmlsec/errors.h> ++#include <xmlsec/list.h> ++ ++#include <xmlsec/nss/tokens.h> ++ ++int ++xmlSecNssKeySlotSetMechList( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE_PTR mechanismList ++) { ++ int counter ; ++ ++ xmlSecAssert2( keySlot != NULL , -1 ) ; ++ ++ if( keySlot->mechanismList != CK_NULL_PTR ) { ++ xmlFree( keySlot->mechanismList ) ; ++ ++ for( counter = 0 ; *( mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ; ++ keySlot->mechanismList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ; ++ if( keySlot->mechanismList == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ); ++ } ++ for( ; counter >= 0 ; counter -- ) ++ *( keySlot->mechanismList + counter ) = *( mechanismList + counter ) ; ++ } ++ ++ return( 0 ); ++} ++ ++int ++xmlSecNssKeySlotEnableMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE mechanism ++) { ++ int counter ; ++ CK_MECHANISM_TYPE_PTR newList ; ++ ++ xmlSecAssert2( keySlot != NULL , -1 ) ; ++ ++ if( mechanism != CKM_INVALID_MECHANISM ) { ++ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ; ++ newList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ; ++ if( newList == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ); ++ } ++ *( newList + counter + 1 ) = CKM_INVALID_MECHANISM ; ++ *( newList + counter ) = mechanism ; ++ for( counter -= 1 ; counter >= 0 ; counter -- ) ++ *( newList + counter ) = *( keySlot->mechanismList + counter ) ; ++ ++ xmlFree( keySlot->mechanismList ) ; ++ keySlot->mechanismList = newList ; ++ } ++ ++ return(0); ++} ++ ++int ++xmlSecNssKeySlotDisableMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE mechanism ++) { ++ int counter ; ++ ++ xmlSecAssert2( keySlot != NULL , -1 ) ; ++ ++ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) { ++ if( *( keySlot->mechanismList + counter ) == mechanism ) { ++ for( ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) { ++ *( keySlot->mechanismList + counter ) = *( keySlot->mechanismList + counter + 1 ) ; ++ } ++ ++ break ; ++ } ++ } ++ ++ return(0); ++} ++ ++CK_MECHANISM_TYPE_PTR ++xmlSecNssKeySlotGetMechList( ++ xmlSecNssKeySlotPtr keySlot ++) { ++ if( keySlot != NULL ) ++ return keySlot->mechanismList ; ++ else ++ return NULL ; ++} ++ ++int ++xmlSecNssKeySlotSetSlot( ++ xmlSecNssKeySlotPtr keySlot , ++ PK11SlotInfo* slot ++) { ++ xmlSecAssert2( keySlot != NULL , -1 ) ; ++ ++ if( slot != NULL && keySlot->slot != slot ) { ++ if( keySlot->slot != NULL ) ++ PK11_FreeSlot( keySlot->slot ) ; ++ ++ if( keySlot->mechanismList != NULL ) { ++ xmlFree( keySlot->mechanismList ) ; ++ keySlot->mechanismList = NULL ; ++ } ++ ++ keySlot->slot = PK11_ReferenceSlot( slot ) ; ++ } ++ ++ return(0); ++} ++ ++int ++xmlSecNssKeySlotInitialize( ++ xmlSecNssKeySlotPtr keySlot , ++ PK11SlotInfo* slot ++) { ++ xmlSecAssert2( keySlot != NULL , -1 ) ; ++ xmlSecAssert2( keySlot->slot == NULL , -1 ) ; ++ xmlSecAssert2( keySlot->mechanismList == NULL , -1 ) ; ++ ++ if( slot != NULL ) { ++ keySlot->slot = PK11_ReferenceSlot( slot ) ; ++ } ++ ++ return(0); ++} ++ ++void ++xmlSecNssKeySlotFinalize( ++ xmlSecNssKeySlotPtr keySlot ++) { ++ xmlSecAssert( keySlot != NULL ) ; ++ ++ if( keySlot->mechanismList != NULL ) { ++ xmlFree( keySlot->mechanismList ) ; ++ keySlot->mechanismList = NULL ; ++ } ++ ++ if( keySlot->slot != NULL ) { ++ PK11_FreeSlot( keySlot->slot ) ; ++ keySlot->slot = NULL ; ++ } ++ ++} ++ ++PK11SlotInfo* ++xmlSecNssKeySlotGetSlot( ++ xmlSecNssKeySlotPtr keySlot ++) { ++ if( keySlot != NULL ) ++ return keySlot->slot ; ++ else ++ return NULL ; ++} ++ ++xmlSecNssKeySlotPtr ++xmlSecNssKeySlotCreate() { ++ xmlSecNssKeySlotPtr keySlot ; ++ ++ /* Allocates a new xmlSecNssKeySlot and fill the fields */ ++ keySlot = ( xmlSecNssKeySlotPtr )xmlMalloc( sizeof( xmlSecNssKeySlot ) ) ; ++ if( keySlot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( NULL ); ++ } ++ memset( keySlot, 0, sizeof( xmlSecNssKeySlot ) ) ; ++ ++ return( keySlot ) ; ++} ++ ++int ++xmlSecNssKeySlotCopy( ++ xmlSecNssKeySlotPtr newKeySlot , ++ xmlSecNssKeySlotPtr keySlot ++) { ++ CK_MECHANISM_TYPE_PTR mech ; ++ int counter ; ++ ++ xmlSecAssert2( newKeySlot != NULL , -1 ) ; ++ xmlSecAssert2( keySlot != NULL , -1 ) ; ++ ++ if( keySlot->slot != NULL && newKeySlot->slot != keySlot->slot ) { ++ if( newKeySlot->slot != NULL ) ++ PK11_FreeSlot( newKeySlot->slot ) ; ++ ++ newKeySlot->slot = PK11_ReferenceSlot( keySlot->slot ) ; ++ } ++ ++ if( keySlot->mechanismList != CK_NULL_PTR ) { ++ xmlFree( newKeySlot->mechanismList ) ; ++ ++ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) ; ++ newKeySlot->mechanismList = ( CK_MECHANISM_TYPE_PTR )xmlMalloc( ( counter + 1 ) * sizeof( CK_MECHANISM_TYPE ) ) ; ++ if( newKeySlot->mechanismList == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ); ++ } ++ for( ; counter >= 0 ; counter -- ) ++ *( newKeySlot->mechanismList + counter ) = *( keySlot->mechanismList + counter ) ; ++ } ++ ++ return( 0 ); ++} ++ ++xmlSecNssKeySlotPtr ++xmlSecNssKeySlotDuplicate( ++ xmlSecNssKeySlotPtr keySlot ++) { ++ xmlSecNssKeySlotPtr newKeySlot ; ++ int ret ; ++ ++ xmlSecAssert2( keySlot != NULL , NULL ) ; ++ ++ newKeySlot = xmlSecNssKeySlotCreate() ; ++ if( newKeySlot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( NULL ); ++ } ++ ++ if( xmlSecNssKeySlotCopy( newKeySlot, keySlot ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( NULL ); ++ } ++ ++ return( newKeySlot ); ++} ++ ++void ++xmlSecNssKeySlotDestroy( ++ xmlSecNssKeySlotPtr keySlot ++) { ++ xmlSecAssert( keySlot != NULL ) ; ++ ++ if( keySlot->mechanismList != NULL ) ++ xmlFree( keySlot->mechanismList ) ; ++ ++ if( keySlot->slot != NULL ) ++ PK11_FreeSlot( keySlot->slot ) ; ++ ++ xmlFree( keySlot ) ; ++} ++ ++int ++xmlSecNssKeySlotBindMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE type ++) { ++ int counter ; ++ ++ xmlSecAssert2( keySlot != NULL , 0 ) ; ++ xmlSecAssert2( keySlot->slot != NULL , 0 ) ; ++ xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ; ++ ++ for( counter = 0 ; *( keySlot->mechanismList + counter ) != CKM_INVALID_MECHANISM ; counter ++ ) { ++ if( *( keySlot->mechanismList + counter ) == type ) ++ return(1) ; ++ } ++ ++ return( 0 ) ; ++} ++ ++int ++xmlSecNssKeySlotSupportMech( ++ xmlSecNssKeySlotPtr keySlot , ++ CK_MECHANISM_TYPE type ++) { ++ xmlSecAssert2( keySlot != NULL , 0 ) ; ++ xmlSecAssert2( keySlot->slot != NULL , 0 ) ; ++ xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ; ++ ++ if( PK11_DoesMechanism( keySlot->slot , type ) == PR_TRUE ) { ++ return(1); ++ } else ++ return(0); ++} ++ ++void ++xmlSecNssKeySlotDebugDump( ++ xmlSecNssKeySlotPtr keySlot , ++ FILE* output ++) { ++ xmlSecAssert( keySlot != NULL ) ; ++ xmlSecAssert( output != NULL ) ; ++ ++ fprintf( output, "== KEY SLOT\n" ); ++} ++ ++void ++xmlSecNssKeySlotDebugXmlDump( ++ xmlSecNssKeySlotPtr keySlot , ++ FILE* output ++) { ++} ++ ++/** ++ * Key Slot List ++ */ ++#ifdef __MINGW32__ // for runtime-pseudo-reloc ++static struct _xmlSecPtrListKlass xmlSecNssKeySlotPtrListKlass = { ++#else ++static xmlSecPtrListKlass xmlSecNssKeySlotPtrListKlass = { ++#endif ++ BAD_CAST "mechanism-list", ++ (xmlSecPtrDuplicateItemMethod)xmlSecNssKeySlotDuplicate, ++ (xmlSecPtrDestroyItemMethod)xmlSecNssKeySlotDestroy, ++ (xmlSecPtrDebugDumpItemMethod)xmlSecNssKeySlotDebugDump, ++ (xmlSecPtrDebugDumpItemMethod)xmlSecNssKeySlotDebugXmlDump, ++}; ++ ++xmlSecPtrListId ++xmlSecNssKeySlotListGetKlass(void) { ++ return(&xmlSecNssKeySlotPtrListKlass); ++} ++ ++ ++/*- ++ * Global PKCS#11 crypto token repository -- Key slot list ++ */ ++static xmlSecPtrListPtr _xmlSecNssKeySlotList = NULL ; ++ ++PK11SlotInfo* ++xmlSecNssSlotGet( ++ CK_MECHANISM_TYPE type ++) { ++ PK11SlotInfo* slot = NULL ; ++ xmlSecNssKeySlotPtr keySlot ; ++ xmlSecSize ksSize ; ++ xmlSecSize ksPos ; ++ char flag ; ++ ++ if( _xmlSecNssKeySlotList == NULL ) { ++ slot = PK11_GetBestSlot( type , NULL ) ; ++ } else { ++ ksSize = xmlSecPtrListGetSize( _xmlSecNssKeySlotList ) ; ++ ++ /*- ++ * Firstly, checking whether the mechanism is bound with a special slot. ++ * If no bound slot, we try to find the first eligible slot in the list. ++ */ ++ for( flag = 0, ksPos = 0 ; ksPos < ksSize ; ksPos ++ ) { ++ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( _xmlSecNssKeySlotList, ksPos ) ; ++ if( keySlot != NULL && xmlSecNssKeySlotBindMech( keySlot, type ) ) { ++ slot = xmlSecNssKeySlotGetSlot( keySlot ) ; ++ flag = 2 ; ++ } else if( flag == 0 && xmlSecNssKeySlotSupportMech( keySlot, type ) ) { ++ slot = xmlSecNssKeySlotGetSlot( keySlot ) ; ++ flag = 1 ; ++ } ++ ++ if( flag == 2 ) ++ break ; ++ } ++ if( slot != NULL ) ++ slot = PK11_ReferenceSlot( slot ) ; ++ } ++ ++ if( slot != NULL && PK11_NeedLogin( slot ) ) { ++ if( PK11_Authenticate( slot , PR_TRUE , NULL ) != SECSuccess ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ PK11_FreeSlot( slot ) ; ++ return( NULL ); ++ } ++ } ++ ++ return slot ; ++} ++ ++int ++xmlSecNssSlotInitialize( ++ void ++) { ++ if( _xmlSecNssKeySlotList != NULL ) { ++ xmlSecPtrListDestroy( _xmlSecNssKeySlotList ) ; ++ _xmlSecNssKeySlotList = NULL ; ++ } ++ ++ _xmlSecNssKeySlotList = xmlSecPtrListCreate( xmlSecNssKeySlotListId ) ; ++ if( _xmlSecNssKeySlotList == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return( -1 ); ++ } ++ ++ return(0); ++} ++ ++void ++xmlSecNssSlotShutdown( ++ void ++) { ++ if( _xmlSecNssKeySlotList != NULL ) { ++ xmlSecPtrListDestroy( _xmlSecNssKeySlotList ) ; ++ _xmlSecNssKeySlotList = NULL ; ++ } ++} ++ ++int ++xmlSecNssSlotAdopt( ++ PK11SlotInfo* slot, ++ CK_MECHANISM_TYPE type ++) { ++ xmlSecNssKeySlotPtr keySlot ; ++ xmlSecSize ksSize ; ++ xmlSecSize ksPos ; ++ char flag ; ++ ++ xmlSecAssert2( _xmlSecNssKeySlotList != NULL, -1 ) ; ++ xmlSecAssert2( slot != NULL, -1 ) ; ++ ++ ksSize = xmlSecPtrListGetSize( _xmlSecNssKeySlotList ) ; ++ ++ /*- ++ * Firstly, checking whether the slot is in the repository already. ++ */ ++ flag = 0 ; ++ for( ksPos = 0 ; ksPos < ksSize ; ksPos ++ ) { ++ keySlot = ( xmlSecNssKeySlotPtr )xmlSecPtrListGetItem( _xmlSecNssKeySlotList, ksPos ) ; ++ /* If find the slot in the list */ ++ if( keySlot != NULL && xmlSecNssKeySlotGetSlot( keySlot ) == slot ) { ++ /* If mechnism type is valid, bind the slot with the mechanism */ ++ if( type != CKM_INVALID_MECHANISM ) { ++ if( xmlSecNssKeySlotEnableMech( keySlot, type ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ } ++ ++ flag = 1 ; ++ } ++ } ++ ++ /* If the slot do not in the list, add a new item to the list */ ++ if( flag == 0 ) { ++ /* Create a new KeySlot */ ++ keySlot = xmlSecNssKeySlotCreate() ; ++ if( keySlot == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return(-1); ++ } ++ ++ /* Initialize the keySlot with a slot */ ++ if( xmlSecNssKeySlotInitialize( keySlot, slot ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecNssKeySlotDestroy( keySlot ) ; ++ return(-1); ++ } ++ ++ /* If mechnism type is valid, bind the slot with the mechanism */ ++ if( type != CKM_INVALID_MECHANISM ) { ++ if( xmlSecNssKeySlotEnableMech( keySlot, type ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecNssKeySlotDestroy( keySlot ) ; ++ return(-1); ++ } ++ } ++ ++ /* Add keySlot into the list */ ++ if( xmlSecPtrListAdd( _xmlSecNssKeySlotList, keySlot ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_XMLSEC_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecNssKeySlotDestroy( keySlot ) ; ++ return(-1); ++ } ++ } ++ ++ return(0); ++} ++ +--- misc/xmlsec1-1.2.14/src/nss/x509.c 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/x509.c 2009-09-21 14:02:48.642312431 +0200 +@@ -34,7 +34,6 @@ + #include <xmlsec/keys.h> + #include <xmlsec/keyinfo.h> + #include <xmlsec/keysmngr.h> +-#include <xmlsec/x509.h> + #include <xmlsec/base64.h> + #include <xmlsec/errors.h> + +@@ -61,33 +60,18 @@ + static int xmlSecNssX509CertificateNodeRead (xmlSecKeyDataPtr data, + xmlNodePtr node, + xmlSecKeyInfoCtxPtr keyInfoCtx); +-static int xmlSecNssX509CertificateNodeWrite (CERTCertificate* cert, +- xmlNodePtr node, +- xmlSecKeyInfoCtxPtr keyInfoCtx); + static int xmlSecNssX509SubjectNameNodeRead (xmlSecKeyDataPtr data, + xmlNodePtr node, + xmlSecKeyInfoCtxPtr keyInfoCtx); +-static int xmlSecNssX509SubjectNameNodeWrite (CERTCertificate* cert, +- xmlNodePtr node, +- xmlSecKeyInfoCtxPtr keyInfoCtx); + static int xmlSecNssX509IssuerSerialNodeRead (xmlSecKeyDataPtr data, + xmlNodePtr node, + xmlSecKeyInfoCtxPtr keyInfoCtx); +-static int xmlSecNssX509IssuerSerialNodeWrite (CERTCertificate* cert, +- xmlNodePtr node, +- xmlSecKeyInfoCtxPtr keyInfoCtx); + static int xmlSecNssX509SKINodeRead (xmlSecKeyDataPtr data, + xmlNodePtr node, + xmlSecKeyInfoCtxPtr keyInfoCtx); +-static int xmlSecNssX509SKINodeWrite (CERTCertificate* cert, +- xmlNodePtr node, +- xmlSecKeyInfoCtxPtr keyInfoCtx); + static int xmlSecNssX509CRLNodeRead (xmlSecKeyDataPtr data, + xmlNodePtr node, + xmlSecKeyInfoCtxPtr keyInfoCtx); +-static int xmlSecNssX509CRLNodeWrite (CERTSignedCrl* crl, +- xmlNodePtr node, +- xmlSecKeyInfoCtxPtr keyInfoCtx); + static int xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data, + xmlSecKeyPtr key, + xmlSecKeyInfoCtxPtr keyInfoCtx); +@@ -104,9 +88,6 @@ + xmlSecKeyInfoCtxPtr keyInfoCtx); + static xmlChar* xmlSecNssX509CrlBase64DerWrite (CERTSignedCrl* crl, + int base64LineWrap); +-static xmlChar* xmlSecNssX509NameWrite (CERTName* nm); +-static xmlChar* xmlSecNssASN1IntegerWrite (SECItem *num); +-static xmlChar* xmlSecNssX509SKIWrite (CERTCertificate* cert); + static void xmlSecNssX509CertDebugDump (CERTCertificate* cert, + FILE* output); + static void xmlSecNssX509CertDebugXmlDump (CERTCertificate* cert, +@@ -752,31 +733,22 @@ + xmlSecNssKeyDataX509XmlWrite(xmlSecKeyDataId id, xmlSecKeyPtr key, + xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { + xmlSecKeyDataPtr data; ++ xmlNodePtr cur; ++ xmlChar* buf; + CERTCertificate* cert; + CERTSignedCrl* crl; + xmlSecSize size, pos; +- int content = 0; +- int ret; + + xmlSecAssert2(id == xmlSecNssKeyDataX509Id, -1); + xmlSecAssert2(key != NULL, -1); + xmlSecAssert2(node != NULL, -1); + xmlSecAssert2(keyInfoCtx != NULL, -1); + +- content = xmlSecX509DataGetNodeContent (node, 1, keyInfoCtx); +- if (content < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecX509DataGetNodeContent", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "content=%d", content); +- return(-1); +- } else if(content == 0) { +- /* by default we are writing certificates and crls */ +- content = XMLSEC_X509DATA_DEFAULT; ++ /* todo: flag in ctx remove all existing content */ ++ if(0) { ++ xmlNodeSetContent(node, NULL); + } + +- /* get x509 data */ + data = xmlSecKeyGetData(key, id); + if(data == NULL) { + /* no x509 data in the key */ +@@ -796,79 +768,74 @@ + return(-1); + } + +- if((content & XMLSEC_X509DATA_CERTIFICATE_NODE) != 0) { +- ret = xmlSecNssX509CertificateNodeWrite(cert, node, keyInfoCtx); +- if(ret < 0) { ++ /* set base64 lines size from context */ ++ buf = xmlSecNssX509CertBase64DerWrite(cert, keyInfoCtx->base64LineSize); ++ if(buf == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecNssX509CertificateNodeWrite", ++ "xmlSecNssX509CertBase64DerWrite", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "pos=%d", pos); ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); +- } + } + +- if((content & XMLSEC_X509DATA_SUBJECTNAME_NODE) != 0) { +- ret = xmlSecNssX509SubjectNameNodeWrite(cert, node, keyInfoCtx); +- if(ret < 0) { ++ cur = xmlSecAddChild(node, xmlSecNodeX509Certificate, xmlSecDSigNs); ++ if(cur == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecNssX509SubjectNameNodeWrite", ++ "xmlSecAddChild", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "pos=%d", pos); ++ "node=%s", ++ xmlSecErrorsSafeString(xmlSecNodeX509Certificate)); ++ xmlFree(buf); + return(-1); +- } + } ++ /* todo: add \n around base64 data - from context */ ++ /* todo: add errors check */ ++ xmlNodeSetContent(cur, xmlSecStringCR); ++ xmlNodeSetContent(cur, buf); ++ xmlFree(buf); ++ } + +- if((content & XMLSEC_X509DATA_ISSUERSERIAL_NODE) != 0) { +- ret = xmlSecNssX509IssuerSerialNodeWrite(cert, node, keyInfoCtx); +- if(ret < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecNssX509IssuerSerialNodeWrite", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "pos=%d", pos); +- return(-1); +- } ++ /* write crls */ ++ size = xmlSecNssKeyDataX509GetCrlsSize(data); ++ for(pos = 0; pos < size; ++pos) { ++ crl = xmlSecNssKeyDataX509GetCrl(data, pos); ++ if(crl == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecNssKeyDataX509GetCrl", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "pos=%d", pos); ++ return(-1); + } + +- if((content & XMLSEC_X509DATA_SKI_NODE) != 0) { +- ret = xmlSecNssX509SKINodeWrite(cert, node, keyInfoCtx); +- if(ret < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecNssX509SKINodeWrite", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "pos=%d", pos); +- return(-1); +- } ++ /* set base64 lines size from context */ ++ buf = xmlSecNssX509CrlBase64DerWrite(crl, keyInfoCtx->base64LineSize); ++ if(buf == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecNssX509CrlBase64DerWrite", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return(-1); + } +- } + +- /* write crls if needed */ +- if((content & XMLSEC_X509DATA_CRL_NODE) != 0) { +- size = xmlSecNssKeyDataX509GetCrlsSize(data); +- for(pos = 0; pos < size; ++pos) { +- crl = xmlSecNssKeyDataX509GetCrl(data, pos); +- if(crl == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecNssKeyDataX509GetCrl", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "pos=%d", pos); +- return(-1); +- } +- +- ret = xmlSecNssX509CRLNodeWrite(crl, node, keyInfoCtx); +- if(ret < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), +- "xmlSecNssX509CRLNodeWrite", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "pos=%d", pos); +- return(-1); +- } +- } ++ cur = xmlSecAddChild(node, xmlSecNodeX509CRL, xmlSecDSigNs); ++ if(cur == NULL) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ xmlSecErrorsSafeString(xmlSecKeyDataKlassGetName(id)), ++ "xmlSecAddChild", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "new_node=%s", ++ xmlSecErrorsSafeString(xmlSecNodeX509CRL)); ++ xmlFree(buf); ++ return(-1); ++ } ++ /* todo: add \n around base64 data - from context */ ++ /* todo: add errors check */ ++ xmlNodeSetContent(cur, xmlSecStringCR); ++ xmlNodeSetContent(cur, buf); + } + + return(0); +@@ -1057,46 +1024,6 @@ + return(0); + } + +-static int +-xmlSecNssX509CertificateNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { +- xmlChar* buf; +- xmlNodePtr cur; +- +- xmlSecAssert2(cert != NULL, -1); +- xmlSecAssert2(node != NULL, -1); +- xmlSecAssert2(keyInfoCtx != NULL, -1); +- +- /* set base64 lines size from context */ +- buf = xmlSecNssX509CertBase64DerWrite(cert, keyInfoCtx->base64LineSize); +- if(buf == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509CertBase64DerWrite", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(-1); +- } +- +- cur = xmlSecAddChild(node, xmlSecNodeX509Certificate, xmlSecDSigNs); +- if(cur == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509Certificate)); +- xmlFree(buf); +- return(-1); +- } +- +- /* todo: add \n around base64 data - from context */ +- /* todo: add errors check */ +- xmlNodeSetContent(cur, xmlSecStringCR); +- xmlNodeSetContent(cur, buf); +- xmlFree(buf); +- return(0); +-} +- + static int + xmlSecNssX509SubjectNameNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { + xmlSecKeyDataStorePtr x509Store; +@@ -1120,19 +1047,13 @@ + } + + subject = xmlNodeGetContent(node); +- if((subject == NULL) || (xmlSecIsEmptyString(subject) == 1)) { +- if(subject != NULL) { +- xmlFree(subject); +- } +- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { ++ if(subject == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + xmlSecErrorsSafeString(xmlSecNodeGetName(node)), + XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); +- } +- return(0); + } + + cert = xmlSecNssX509StoreFindCert(x509Store, subject, NULL, NULL, NULL, keyInfoCtx); +@@ -1169,40 +1090,6 @@ + return(0); + } + +-static int +-xmlSecNssX509SubjectNameNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) { +- xmlChar* buf = NULL; +- xmlNodePtr cur = NULL; +- +- xmlSecAssert2(cert != NULL, -1); +- xmlSecAssert2(node != NULL, -1); +- +- buf = xmlSecNssX509NameWrite(&(cert->subject)); +- if(buf == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameWrite(&(cert->subject))", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(-1); +- } +- +- cur = xmlSecAddChild(node, xmlSecNodeX509SubjectName, xmlSecDSigNs); +- if(cur == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509SubjectName)); +- xmlFree(buf); +- return(-1); +- } +- xmlSecNodeEncodeAndSetContent(cur, buf); +- xmlFree(buf); +- return(0); +-} +- + static int + xmlSecNssX509IssuerSerialNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { + xmlSecKeyDataStorePtr x509Store; +@@ -1228,21 +1115,9 @@ + } + + cur = xmlSecGetNextElementNode(node->children); +- if(cur == NULL) { +- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), +- xmlSecErrorsSafeString(xmlSecNodeX509IssuerName), +- XMLSEC_ERRORS_R_NODE_NOT_FOUND, +- "node=%s", +- xmlSecErrorsSafeString(xmlSecNodeGetName(cur))); +- return(-1); +- } +- return(0); +- } + + /* the first is required node X509IssuerName */ +- if(!xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs)) { ++ if((cur == NULL) || !xmlSecCheckNodeName(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs)) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + xmlSecErrorsSafeString(xmlSecNodeX509IssuerName), +@@ -1336,78 +1211,6 @@ + return(0); + } + +-static int +-xmlSecNssX509IssuerSerialNodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) { +- xmlNodePtr cur; +- xmlNodePtr issuerNameNode; +- xmlNodePtr issuerNumberNode; +- xmlChar* buf; +- +- xmlSecAssert2(cert != NULL, -1); +- xmlSecAssert2(node != NULL, -1); +- +- /* create xml nodes */ +- cur = xmlSecAddChild(node, xmlSecNodeX509IssuerSerial, xmlSecDSigNs); +- if(cur == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509IssuerSerial)); +- return(-1); +- } +- +- issuerNameNode = xmlSecAddChild(cur, xmlSecNodeX509IssuerName, xmlSecDSigNs); +- if(issuerNameNode == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509IssuerName)); +- return(-1); +- } +- +- issuerNumberNode = xmlSecAddChild(cur, xmlSecNodeX509SerialNumber, xmlSecDSigNs); +- if(issuerNumberNode == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509SerialNumber)); +- return(-1); +- } +- +- /* write data */ +- buf = xmlSecNssX509NameWrite(&(cert->issuer)); +- if(buf == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameWrite(&(cert->issuer))", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(-1); +- } +- xmlSecNodeEncodeAndSetContent(issuerNameNode, buf); +- xmlFree(buf); +- +- buf = xmlSecNssASN1IntegerWrite(&(cert->serialNumber)); +- if(buf == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssASN1IntegerWrite(&(cert->serialNumber))", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(-1); +- } +- xmlNodeSetContent(issuerNumberNode, buf); +- xmlFree(buf); +- +- return(0); +-} +- + static int + xmlSecNssX509SKINodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { + xmlSecKeyDataStorePtr x509Store; +@@ -1431,11 +1234,7 @@ + } + + ski = xmlNodeGetContent(node); +- if((ski == NULL) || (xmlSecIsEmptyString(ski) == 1)) { +- if(ski != NULL) { +- xmlFree(ski); +- } +- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { ++ if(ski == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + xmlSecErrorsSafeString(xmlSecNodeGetName(node)), +@@ -1443,8 +1242,6 @@ + "node=%s", + xmlSecErrorsSafeString(xmlSecNodeX509SKI)); + return(-1); +- } +- return(0); + } + + cert = xmlSecNssX509StoreFindCert(x509Store, NULL, NULL, NULL, ski, keyInfoCtx); +@@ -1479,41 +1276,6 @@ + return(0); + } + +-static int +-xmlSecNssX509SKINodeWrite(CERTCertificate* cert, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx ATTRIBUTE_UNUSED) { +- xmlChar *buf = NULL; +- xmlNodePtr cur = NULL; +- +- xmlSecAssert2(cert != NULL, -1); +- xmlSecAssert2(node != NULL, -1); +- +- buf = xmlSecNssX509SKIWrite(cert); +- if(buf == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509SKIWrite", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(-1); +- } +- +- cur = xmlSecAddChild(node, xmlSecNodeX509SKI, xmlSecDSigNs); +- if(cur == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "new_node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509SKI)); +- xmlFree(buf); +- return(-1); +- } +- xmlSecNodeEncodeAndSetContent(cur, buf); +- xmlFree(buf); +- +- return(0); +-} +- + static int + xmlSecNssX509CRLNodeRead(xmlSecKeyDataPtr data, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { + xmlChar *content; +@@ -1524,19 +1286,13 @@ + xmlSecAssert2(keyInfoCtx != NULL, -1); + + content = xmlNodeGetContent(node); +- if((content == NULL) || (xmlSecIsEmptyString(content) == 1)) { +- if(content != NULL) { +- xmlFree(content); +- } +- if((keyInfoCtx->flags & XMLSEC_KEYINFO_FLAGS_STOP_ON_EMPTY_NODE) != 0) { ++ if(content == NULL){ + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + xmlSecErrorsSafeString(xmlSecNodeGetName(node)), + XMLSEC_ERRORS_R_INVALID_NODE_CONTENT, + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); +- } +- return(0); + } + + crl = xmlSecNssX509CrlBase64DerRead(content, keyInfoCtx); +@@ -1556,47 +1312,6 @@ + } + + static int +-xmlSecNssX509CRLNodeWrite(CERTSignedCrl* crl, xmlNodePtr node, xmlSecKeyInfoCtxPtr keyInfoCtx) { +- xmlChar* buf = NULL; +- xmlNodePtr cur = NULL; +- +- xmlSecAssert2(crl != NULL, -1); +- xmlSecAssert2(node != NULL, -1); +- xmlSecAssert2(keyInfoCtx != NULL, -1); +- +- /* set base64 lines size from context */ +- buf = xmlSecNssX509CrlBase64DerWrite(crl, keyInfoCtx->base64LineSize); +- if(buf == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509CrlBase64DerWrite", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(-1); +- } +- +- cur = xmlSecAddChild(node, xmlSecNodeX509CRL, xmlSecDSigNs); +- if(cur == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecAddChild", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "new_node=%s", +- xmlSecErrorsSafeString(xmlSecNodeX509CRL)); +- xmlFree(buf); +- return(-1); +- } +- /* todo: add \n around base64 data - from context */ +- /* todo: add errors check */ +- xmlNodeSetContent(cur, xmlSecStringCR); +- xmlNodeSetContent(cur, buf); +- xmlFree(buf); +- +- return(0); +-} +- +- +-static int + xmlSecNssKeyDataX509VerifyAndExtractKey(xmlSecKeyDataPtr data, xmlSecKeyPtr key, + xmlSecKeyInfoCtxPtr keyInfoCtx) { + xmlSecNssX509DataCtxPtr ctx; +@@ -1604,6 +1319,10 @@ + int ret; + SECStatus status; + PRTime notBefore, notAfter; ++ ++ PK11SlotInfo* slot ; ++ SECKEYPublicKey *pubKey = NULL; ++ SECKEYPrivateKey *priKey = NULL; + + xmlSecAssert2(xmlSecKeyDataCheckId(data, xmlSecNssKeyDataX509Id), -1); + xmlSecAssert2(key != NULL, -1); +@@ -1636,10 +1355,14 @@ + xmlSecErrorsSafeString(xmlSecKeyDataGetName(data)), + "CERT_DupCertificate", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + return(-1); + } +- ++ ++ /*- ++ * Get Public key from cert, which does not always work for sign ++ * action. ++ * + keyValue = xmlSecNssX509CertGetKey(ctx->keyCert); + if(keyValue == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, +@@ -1649,6 +1372,54 @@ + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } ++ */ ++ /*- ++ * I'll search key according to KeyReq. ++ */ ++ slot = cert->slot ; ++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePrivate ) == xmlSecKeyDataTypePrivate ) { ++ if( ( priKey = PK11_FindPrivateKeyFromCert( slot , cert , NULL ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "PK11_FindPrivateKeyFromCert" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ } ++ ++ if( ( keyInfoCtx->keyReq.keyType & xmlSecKeyDataTypePublic ) == xmlSecKeyDataTypePublic ) { ++ if( ( pubKey = CERT_ExtractPublicKey( cert ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "CERT_ExtractPublicKey" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ ++ if( priKey != NULL ) ++ SECKEY_DestroyPrivateKey( priKey ) ; ++ return -1 ; ++ } ++ } ++ ++ keyValue = xmlSecNssPKIAdoptKey(priKey, pubKey); ++ if( keyValue == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( data ) ) , ++ "xmlSecNssPKIAdoptKey" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ ++ if( priKey != NULL ) ++ SECKEY_DestroyPrivateKey( priKey ) ; ++ ++ if( pubKey != NULL ) ++ SECKEY_DestroyPublicKey( pubKey ) ; ++ ++ return -1 ; ++ } ++ /* Modify keyValue get Done */ + + /* verify that the key matches our expectations */ + if(xmlSecKeyReqMatchKeyValue(&(keyInfoCtx->keyReq), keyValue) != 1) { +@@ -1950,86 +1721,6 @@ + return(res); + } + +-static xmlChar* +-xmlSecNssX509NameWrite(CERTName* nm) { +- xmlChar *res = NULL; +- char *str; +- +- xmlSecAssert2(nm != NULL, NULL); +- +- str = CERT_NameToAscii(nm); +- if (str == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "CERT_NameToAscii", +- XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(NULL); +- } +- +- res = xmlStrdup(BAD_CAST str); +- if(res == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlStrdup", +- XMLSEC_ERRORS_R_MALLOC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- PORT_Free(str); +- return(NULL); +- } +- PORT_Free(str); +- return(res); +-} +- +-static xmlChar* +-xmlSecNssASN1IntegerWrite(SECItem *num) { +- xmlChar *res = NULL; +- +- xmlSecAssert2(num != NULL, NULL); +- +- /* TODO : to be implemented after +- * NSS bug http://bugzilla.mozilla.org/show_bug.cgi?id=212864 is fixed +- */ +- return(res); +-} +- +-static xmlChar* +-xmlSecNssX509SKIWrite(CERTCertificate* cert) { +- xmlChar *res = NULL; +- SECItem ski; +- SECStatus rv; +- +- xmlSecAssert2(cert != NULL, NULL); +- +- memset(&ski, 0, sizeof(ski)); +- +- rv = CERT_FindSubjectKeyIDExtension(cert, &ski); +- if (rv != SECSuccess) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "CERT_FindSubjectKeyIDExtension", +- XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- SECITEM_FreeItem(&ski, PR_FALSE); +- return(NULL); +- } +- +- res = xmlSecBase64Encode(ski.data, ski.len, 0); +- if(res == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecBase64Encode", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- SECITEM_FreeItem(&ski, PR_FALSE); +- return(NULL); +- } +- SECITEM_FreeItem(&ski, PR_FALSE); +- +- return(res); +-} +- +- + static void + xmlSecNssX509CertDebugDump(CERTCertificate* cert, FILE* output) { + SECItem *sn; +--- misc/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-09-21 14:02:48.669245207 +0200 +@@ -30,6 +30,7 @@ + #include <xmlsec/keyinfo.h> + #include <xmlsec/keysmngr.h> + #include <xmlsec/base64.h> ++#include <xmlsec/bn.h> + #include <xmlsec/errors.h> + + #include <xmlsec/nss/crypto.h> +@@ -61,17 +62,7 @@ + + static int xmlSecNssX509StoreInitialize (xmlSecKeyDataStorePtr store); + static void xmlSecNssX509StoreFinalize (xmlSecKeyDataStorePtr store); +-static int xmlSecNssX509NameStringRead (xmlSecByte **str, +- int *strLen, +- xmlSecByte *res, +- int resLen, +- xmlSecByte delim, +- int ingoreTrailingSpaces); +-static xmlSecByte * xmlSecNssX509NameRead (xmlSecByte *str, +- int len); +- +-static void xmlSecNssNumToItem(SECItem *it, unsigned long num); +- ++static int xmlSecNssIntegerToItem( const xmlChar* integer , SECItem *it ) ; + + static xmlSecKeyDataStoreKlass xmlSecNssX509StoreKlass = { + sizeof(xmlSecKeyDataStoreKlass), +@@ -339,40 +330,28 @@ + xmlSecNssX509FindCert(xmlChar *subjectName, xmlChar *issuerName, + xmlChar *issuerSerial, xmlChar *ski) { + CERTCertificate *cert = NULL; +- xmlChar *p = NULL; + CERTName *name = NULL; + SECItem *nameitem = NULL; + PRArenaPool *arena = NULL; + + if (subjectName != NULL) { +- p = xmlSecNssX509NameRead(subjectName, xmlStrlen(subjectName)); +- if (p == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameRead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "subject=%s", +- xmlSecErrorsSafeString(subjectName)); +- goto done; +- } +- + arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); + if (arena == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + NULL, + "PORT_NewArena", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + goto done; + } + +- name = CERT_AsciiToName((char*)p); ++ name = CERT_AsciiToName((char*)subjectName); + if (name == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + NULL, + "CERT_AsciiToName", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + goto done; + } + +@@ -394,34 +373,23 @@ + if((issuerName != NULL) && (issuerSerial != NULL)) { + CERTIssuerAndSN issuerAndSN; + +- p = xmlSecNssX509NameRead(issuerName, xmlStrlen(issuerName)); +- if (p == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameRead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "issuer=%s", +- xmlSecErrorsSafeString(issuerName)); +- goto done; +- } +- + arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); + if (arena == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + NULL, + "PORT_NewArena", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + goto done; + } + +- name = CERT_AsciiToName((char*)p); ++ name = CERT_AsciiToName((char*)issuerName); + if (name == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + NULL, + "CERT_AsciiToName", + XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); ++ "error code=%d", PORT_GetError()); + goto done; + } + +@@ -441,8 +409,15 @@ + issuerAndSN.derIssuer.data = nameitem->data; + issuerAndSN.derIssuer.len = nameitem->len; + +- /* TBD: serial num can be arbitrarily long */ +- xmlSecNssNumToItem(&issuerAndSN.serialNumber, PORT_Atoi((char *)issuerSerial)); ++ if( xmlSecNssIntegerToItem( issuerSerial, &issuerAndSN.serialNumber ) < 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecNssIntegerToItem", ++ XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ "serial number=%s", ++ xmlSecErrorsSafeString(issuerSerial)); ++ goto done; ++ } + + cert = CERT_FindCertByIssuerAndSN(CERT_GetDefaultCertDB(), + &issuerAndSN); +@@ -473,9 +448,6 @@ + } + + done: +- if (p != NULL) { +- PORT_Free(p); +- } + if (arena != NULL) { + PORT_FreeArena(arena, PR_FALSE); + } +@@ -486,176 +458,6 @@ + return(cert); + } + +-static xmlSecByte * +-xmlSecNssX509NameRead(xmlSecByte *str, int len) { +- xmlSecByte name[256]; +- xmlSecByte value[256]; +- xmlSecByte *retval = NULL; +- xmlSecByte *p = NULL; +- int nameLen, valueLen; +- +- xmlSecAssert2(str != NULL, NULL); +- +- /* return string should be no longer than input string */ +- retval = (xmlSecByte *)PORT_Alloc(len+1); +- if(retval == NULL) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "PORT_Alloc", +- XMLSEC_ERRORS_R_MALLOC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- return(NULL); +- } +- p = retval; +- +- while(len > 0) { +- /* skip spaces after comma or semicolon */ +- while((len > 0) && isspace(*str)) { +- ++str; --len; +- } +- +- nameLen = xmlSecNssX509NameStringRead(&str, &len, name, sizeof(name), '=', 0); +- if(nameLen < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameStringRead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- goto done; +- } +- memcpy(p, name, nameLen); +- p+=nameLen; +- *p++='='; +- if(len > 0) { +- ++str; --len; +- if((*str) == '\"') { +- valueLen = xmlSecNssX509NameStringRead(&str, &len, +- value, sizeof(value), '"', 1); +- if(valueLen < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameStringRead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- goto done; +- } +- /* skip spaces before comma or semicolon */ +- while((len > 0) && isspace(*str)) { +- ++str; --len; +- } +- if((len > 0) && ((*str) != ',')) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, +- "comma is expected"); +- goto done; +- } +- if(len > 0) { +- ++str; --len; +- } +- *p++='\"'; +- memcpy(p, value, valueLen); +- p+=valueLen; +- *p++='\"'; +- } else if((*str) == '#') { +- /* TODO: read octect values */ +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, +- "reading octect values is not implemented yet"); +- goto done; +- } else { +- valueLen = xmlSecNssX509NameStringRead(&str, &len, +- value, sizeof(value), ',', 1); +- if(valueLen < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- "xmlSecNssX509NameStringRead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- XMLSEC_ERRORS_NO_MESSAGE); +- goto done; +- } +- memcpy(p, value, valueLen); +- p+=valueLen; +- if (len > 0) +- *p++=','; +- } +- } else { +- valueLen = 0; +- } +- if(len > 0) { +- ++str; --len; +- } +- } +- +- *p = 0; +- return(retval); +- +-done: +- PORT_Free(retval); +- return (NULL); +-} +- +-static int +-xmlSecNssX509NameStringRead(xmlSecByte **str, int *strLen, +- xmlSecByte *res, int resLen, +- xmlSecByte delim, int ingoreTrailingSpaces) { +- xmlSecByte *p, *q, *nonSpace; +- +- xmlSecAssert2(str != NULL, -1); +- xmlSecAssert2(strLen != NULL, -1); +- xmlSecAssert2(res != NULL, -1); +- +- p = (*str); +- nonSpace = q = res; +- while(((p - (*str)) < (*strLen)) && ((*p) != delim) && ((q - res) < resLen)) { +- if((*p) != '\\') { +- if(ingoreTrailingSpaces && !isspace(*p)) { +- nonSpace = q; +- } +- *(q++) = *(p++); +- } else { +- ++p; +- nonSpace = q; +- if(xmlSecIsHex((*p))) { +- if((p - (*str) + 1) >= (*strLen)) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, +- "two hex digits expected"); +- return(-1); +- } +- *(q++) = xmlSecGetHex(p[0]) * 16 + xmlSecGetHex(p[1]); +- p += 2; +- } else { +- if(((++p) - (*str)) >= (*strLen)) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, +- "escaped symbol missed"); +- return(-1); +- } +- *(q++) = *(p++); +- } +- } +- } +- if(((p - (*str)) < (*strLen)) && ((*p) != delim)) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- NULL, +- NULL, +- XMLSEC_ERRORS_R_INVALID_SIZE, +- "buffer is too small"); +- return(-1); +- } +- (*strLen) -= (p - (*str)); +- (*str) = p; +- return((ingoreTrailingSpaces) ? nonSpace - res + 1 : q - res); +-} +- + /* code lifted from NSS */ + static void + xmlSecNssNumToItem(SECItem *it, unsigned long ui) +@@ -699,6 +501,77 @@ + it->len = len; + PORT_Memcpy(it->data, bb + (sizeof(bb) - len), len); + } ++ ++static int ++xmlSecNssIntegerToItem( ++ const xmlChar* integer , ++ SECItem *item ++) { ++ xmlSecBn bn ; ++ xmlSecSize i, length ; ++ const xmlSecByte* bnInteger ; ++ ++ xmlSecAssert2( integer != NULL, -1 ) ; ++ xmlSecAssert2( item != NULL, -1 ) ; ++ ++ if( xmlSecBnInitialize( &bn, 0 ) < 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecBnInitialize", ++ XMLSEC_ERRORS_R_INVALID_DATA, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ return -1 ; ++ } ++ ++ if( xmlSecBnFromDecString( &bn, integer ) < 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecBnFromDecString", ++ XMLSEC_ERRORS_R_INVALID_DATA, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecBnFinalize( &bn ) ; ++ return -1 ; ++ } ++ ++ length = xmlSecBnGetSize( &bn ) ; ++ if( length <= 0 ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecBnGetSize", ++ XMLSEC_ERRORS_R_INVALID_DATA, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ } ++ ++ bnInteger = xmlSecBnGetData( &bn ) ; ++ if( bnInteger == NULL ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "xmlSecBnGetData", ++ XMLSEC_ERRORS_R_INVALID_DATA, ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecBnFinalize( &bn ) ; ++ return -1 ; ++ } ++ ++ item->data = ( unsigned char * )PORT_Alloc( length ); ++ if( item->data == NULL ) { ++ xmlSecError(XMLSEC_ERRORS_HERE, ++ NULL, ++ "PORT_Alloc", ++ XMLSEC_ERRORS_R_INVALID_DATA, ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecBnFinalize( &bn ) ; ++ return -1 ; ++ } ++ ++ item->len = length; ++ for( i = 0 ; i < length ; i ++ ) ++ item->data[i] = *( bnInteger + i ) ; ++ ++ xmlSecBnFinalize( &bn ) ; ++ ++ return 0 ; ++} + #endif /* XMLSEC_NO_X509 */ + + +--- misc/xmlsec1-1.2.14/win32/Makefile.msvc 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/win32/Makefile.msvc 2009-09-21 14:02:48.607277908 +0200 +@@ -218,6 +218,9 @@ + $(XMLSEC_OPENSSL_INTDIR_A)\x509vfy.obj + + XMLSEC_NSS_OBJS = \ ++ $(XMLSEC_NSS_INTDIR)\akmngr.obj\ ++ $(XMLSEC_NSS_INTDIR)\keywrapers.obj\ ++ $(XMLSEC_NSS_INTDIR)\tokens.obj\ + $(XMLSEC_NSS_INTDIR)\app.obj\ + $(XMLSEC_NSS_INTDIR)\bignum.obj\ + $(XMLSEC_NSS_INTDIR)\ciphers.obj \ +@@ -253,6 +256,7 @@ + $(XMLSEC_NSS_INTDIR_A)\strings.obj + + XMLSEC_MSCRYPTO_OBJS = \ ++ $(XMLSEC_MSCRYPTO_INTDIR)\akmngr.obj\ + $(XMLSEC_MSCRYPTO_INTDIR)\app.obj\ + $(XMLSEC_MSCRYPTO_INTDIR)\crypto.obj \ + $(XMLSEC_MSCRYPTO_INTDIR)\ciphers.obj \ diff --git a/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch b/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch new file mode 100644 index 0000000..8c6349a --- /dev/null +++ b/libxmlsec/xmlsec1-mingw-keymgr-mscrypto.patch @@ -0,0 +1,62 @@ +--- misc/xmlsec1-1.2.14/src/mscrypto/Makefile.am 2009-06-26 05:53:18.000000000 +0900 ++++ misc/build/xmlsec1-1.2.14/src/mscrypto/Makefile.am 2009-09-30 18:53:05.373000000 +0900 +@@ -35,6 +35,7 @@ + csp_oid.h \ + globals.h \ + xmlsec-mingw.h \ ++ akmngr.c \ + $(NULL) + + if SHAREDLIB_HACK +--- misc/xmlsec1-1.2.14/src/mscrypto/Makefile.in 2009-06-26 05:53:32.000000000 +0900 ++++ misc/build/xmlsec1-1.2.14/src/mscrypto/Makefile.in 2009-09-30 19:00:50.107375000 +0900 +@@ -72,7 +72,8 @@ + am__libxmlsec1_mscrypto_la_SOURCES_DIST = app.c certkeys.c ciphers.c \ + crypto.c digests.c keysstore.c kt_rsa.c signatures.c symkeys.c \ + x509.c x509vfy.c csp_calg.h csp_oid.h globals.h xmlsec-mingw.h \ +- ../strings.c ++ ../strings.c \ ++ akmngr.c + am__objects_1 = + @SHAREDLIB_HACK_TRUE@am__objects_2 = \ + @SHAREDLIB_HACK_TRUE@ libxmlsec1_mscrypto_la-strings.lo +@@ -86,7 +87,8 @@ + libxmlsec1_mscrypto_la-signatures.lo \ + libxmlsec1_mscrypto_la-symkeys.lo \ + libxmlsec1_mscrypto_la-x509.lo \ +- libxmlsec1_mscrypto_la-x509vfy.lo $(am__objects_1) \ ++ libxmlsec1_mscrypto_la-x509vfy.lo \ ++ libxmlsec1_mscrypto_la-akmngr.lo $(am__objects_1) \ + $(am__objects_2) + libxmlsec1_mscrypto_la_OBJECTS = $(am_libxmlsec1_mscrypto_la_OBJECTS) + libxmlsec1_mscrypto_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ +@@ -338,6 +340,7 @@ + libxmlsec1_mscrypto_la_SOURCES = app.c certkeys.c ciphers.c crypto.c \ + digests.c keysstore.c kt_rsa.c signatures.c symkeys.c x509.c \ + x509vfy.c csp_calg.h csp_oid.h globals.h xmlsec-mingw.h \ ++ akmngr.c \ + $(NULL) $(am__append_1) + libxmlsec1_mscrypto_la_LIBADD = \ + ../libxmlsec1.la \ +@@ -441,6 +444,7 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-symkeys.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-x509.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-x509vfy.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Plo@am__quote@ + + .c.o: + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@@ -470,6 +474,13 @@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_mscrypto_la-app.lo `test -f 'app.c' || echo '$(srcdir)/'`app.c + ++libxmlsec1_mscrypto_la-akmngr.lo: akmngr.c ++@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_mscrypto_la-akmngr.lo -MD -MP -MF "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Tpo" -c -o libxmlsec1_mscrypto_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c; \ ++@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Tpo" "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Plo"; else rm -f "$(DEPDIR)/libxmlsec1_mscrypto_la-akmngr.Tpo"; exit 1; fi ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='akmngr.c' object='libxmlsec1_mscrypto_la-akmngr.lo' libtool=yes @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ++@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libxmlsec1_mscrypto_la-akmngr.lo `test -f 'akmngr.c' || echo '$(srcdir)/'`akmngr.c ++ + libxmlsec1_mscrypto_la-certkeys.lo: certkeys.c + @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxmlsec1_mscrypto_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libxmlsec1_mscrypto_la-certkeys.lo -MD -MP -MF $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Tpo -c -o libxmlsec1_mscrypto_la-certkeys.lo `test -f 'certkeys.c' || echo '$(srcdir)/'`certkeys.c + @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Tpo $(DEPDIR)/libxmlsec1_mscrypto_la-certkeys.Plo diff --git a/libxmlsec/xmlsec1-mingw32.patch b/libxmlsec/xmlsec1-mingw32.patch new file mode 100644 index 0000000..fd71ddf --- /dev/null +++ b/libxmlsec/xmlsec1-mingw32.patch @@ -0,0 +1,257 @@ +--- misc/xmlsec1-1.2.14/configure 2009-09-29 15:55:33.269924586 +0200 ++++ misc/build/xmlsec1-1.2.14/configure 2009-09-29 15:55:08.838176411 +0200 +@@ -13184,7 +13184,9 @@ + done + + for dir in $ac_nss_lib_dir ; do +- if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then ++ case $host_os in ++ cygwin* | mingw* | pw32*) ++ if test -f $dir/libnspr4.$libext ; then + if test "z$dir" = "z/usr/lib" ; then + NSPR_LIBS="$NSPR_LIBS_LIST" + else +@@ -13197,6 +13199,25 @@ + NSPR_LIBS_FOUND="yes" + break + fi ++ ;; ++ ++ *) ++ ++ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then ++ if test "z$dir" = "z/usr/lib" ; then ++ NSPR_LIBS="$NSPR_LIBS_LIST" ++ else ++ if test "z$with_gnu_ld" = "zyes" ; then ++ NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST" ++ else ++ NSPR_LIBS="-L$dir $NSPR_LIBS_LIST" ++ fi ++ fi ++ NSPR_LIBS_FOUND="yes" ++ break ++ fi ++ ;; ++ esac + done + fi + +@@ -13266,6 +13287,24 @@ + done + + for dir in $ac_nss_lib_dir ; do ++ case $host_os in ++ cygwin* | mingw* | pw32*) ++ if test -f $dir/libnss3.$libext ; then ++ if test "z$dir" = "z/usr/lib" ; then ++ NSS_LIBS="$NSS_LIBS_LIST" ++ else ++ if test "z$with_gnu_ld" = "zyes" ; then ++ NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST" ++ else ++ NSS_LIBS="-L$dir $NSS_LIBS_LIST" ++ fi ++ fi ++ NSS_LIBS_FOUND="yes" ++ break ++ fi ++ ;; ++ ++ *) + if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then + if test "z$dir" = "z/usr/lib" ; then + NSS_LIBS="$NSS_LIBS_LIST" +@@ -13279,6 +13318,8 @@ + NSS_LIBS_FOUND="yes" + break + fi ++ ;; ++ esac + done + fi + +@@ -13684,7 +13725,7 @@ + $as_echo "$MSCRYPTO_ENABLE" >&6; } + else + LIBS_SAVE="$LIBS" +- LIBS="$LIBS -lcrypt32" ++ LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mscrypto libraries" >&5 + $as_echo_n "checking for mscrypto libraries... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +@@ -13711,13 +13752,7 @@ + XMLSEC_NO_MSCRYPTO="0" + + MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1" +- case $host in +- *-*-mingw*) +- MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';; +- *) +- MSCRYPTO_LIBS="-lcrypt32";; +- esac +- ++ MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib" + if test "z$XMLSEC_CRYPTO" = "z" ; then + XMLSEC_CRYPTO="mscrypto" + XMLSEC_CRYPTO_LIB="$MSCRYPTO_CRYPTO_LIB" +--- misc/xmlsec1-1.2.14/configure.in 2009-09-29 15:55:33.282288142 +0200 ++++ misc/build/xmlsec1-1.2.14/configure.in 2009-09-29 15:49:39.614223428 +0200 +@@ -671,7 +671,9 @@ + done + + for dir in $ac_nss_lib_dir ; do +- if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then ++ case $host_os in ++ cygwin* | mingw* | pw32*) ++ if test -f $dir/libnspr4.$libext ; then + dnl do not add -L/usr/lib because compiler does it anyway + if test "z$dir" = "z/usr/lib" ; then + NSPR_LIBS="$NSPR_LIBS_LIST" +@@ -685,6 +687,26 @@ + NSPR_LIBS_FOUND="yes" + break + fi ++ ;; ++ ++ *) ++ ++ if test -f $dir/libnspr4.so -o -f $dir/libnspr4.dylib ; then ++ dnl do not add -L/usr/lib because compiler does it anyway ++ if test "z$dir" = "z/usr/lib" ; then ++ NSPR_LIBS="$NSPR_LIBS_LIST" ++ else ++ if test "z$with_gnu_ld" = "zyes" ; then ++ NSPR_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSPR_LIBS_LIST" ++ else ++ NSPR_LIBS="-L$dir $NSPR_LIBS_LIST" ++ fi ++ fi ++ NSPR_LIBS_FOUND="yes" ++ break ++ fi ++ ;; ++ esac + done + fi + +@@ -742,6 +764,25 @@ + done + + for dir in $ac_nss_lib_dir ; do ++ case $host_os in ++ cygwin* | mingw* | pw32*) ++ if test -f $dir/libnss3.$libext ; then ++ dnl do not add -L/usr/lib because compiler does it anyway ++ if test "z$dir" = "z/usr/lib" ; then ++ NSS_LIBS="$NSS_LIBS_LIST" ++ else ++ if test "z$with_gnu_ld" = "zyes" ; then ++ NSS_LIBS="-Wl,-rpath-link -Wl,$dir -L$dir $NSS_LIBS_LIST" ++ else ++ NSS_LIBS="-L$dir $NSS_LIBS_LIST" ++ fi ++ fi ++ NSS_LIBS_FOUND="yes" ++ break ++ fi ++ ;; ++ ++ *) + if test -f $dir/libnss3.so -o -f $dir/libnss3.dylib ; then + dnl do not add -L/usr/lib because compiler does it anyway + if test "z$dir" = "z/usr/lib" ; then +@@ -756,6 +797,8 @@ + NSS_LIBS_FOUND="yes" + break + fi ++ ;; ++ esac + done + fi + +@@ -926,7 +969,7 @@ + dnl cannot detect __stdcall functions + dnl AC_CHECK_LIB(crypt32, CertOpenStore, .... + LIBS_SAVE="$LIBS" +- LIBS="$LIBS -lcrypt32" ++ LIBS="$LIBS ${PSDK_HOME}/lib/crypt32.lib" + AC_MSG_CHECKING(for mscrypto libraries) + AC_LINK_IFELSE([ + #include <windows.h> +@@ -943,15 +986,7 @@ + XMLSEC_NO_MSCRYPTO="0" + + MSCRYPTO_CFLAGS="$MSCRYPTO_CFLAGS -DXMLSEC_CRYPTO_MSCRYPTO=1" +- case $host in +- *-*-mingw*) +- dnl since mingw crypt32 library is limited +- dnl we use own def-file +- MSCRYPTO_LIBS='-Wl,$(srcdir)/mingw-crypt32.def';; +- *) +- MSCRYPTO_LIBS="-lcrypt32";; +- esac +- ++ MSCRYPTO_LIBS="${PSDK_HOME}/lib/crypt32.lib" + dnl first crypto library is default one + if test "z$XMLSEC_CRYPTO" = "z" ; then + XMLSEC_CRYPTO="mscrypto" +--- misc/xmlsec1-1.2.14/ltmain.sh 2009-06-25 22:53:19.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/ltmain.sh 2009-09-29 15:49:39.628349554 +0200 +@@ -4868,6 +4868,11 @@ + fi + ;; + ++ *.lib) ++ deplibs="$deplibs $arg" ++ continue ++ ;; ++ + *.$libext) + # An archive. + deplibs="$deplibs $arg" +@@ -5213,6 +5218,10 @@ + continue + ;; + *.la) lib="$deplib" ;; ++ *.lib) ++ deplibs="$deplib $deplibs" ++ continue ++ ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" +--- misc/xmlsec1-1.2.14/src/nss/keywrapers.c 2009-09-29 15:55:33.430875248 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/keywrapers.c 2009-09-29 15:49:39.749963247 +0200 +@@ -1126,6 +1126,7 @@ + NULL, /* void* reserved1; */ + }; + ++#ifndef __MINGW32__ + /** + * xmlSecNssTransformKWAes128GetKlass: + * +@@ -1160,6 +1161,7 @@ + xmlSecNssTransformKWAes256GetKlass(void) { + return(&xmlSecNssKWAes256Klass); + } ++#endif /* __MINGW32__ */ + + #endif /* XMLSEC_NO_AES */ + +@@ -1197,6 +1199,7 @@ + NULL, /* void* reserved1; */ + }; + ++#ifndef __MINGW32__ + /** + * xmlSecNssTransformKWDes3GetKlass: + * +@@ -1208,6 +1211,7 @@ + xmlSecNssTransformKWDes3GetKlass(void) { + return(&xmlSecNssKWDes3Klass); + } ++#endif /* __MINGW32__ */ + + #endif /* XMLSEC_NO_DES */ + diff --git a/libxmlsec/xmlsec1-noverify.patch b/libxmlsec/xmlsec1-noverify.patch new file mode 100644 index 0000000..c51540c --- /dev/null +++ b/libxmlsec/xmlsec1-noverify.patch @@ -0,0 +1,59 @@ +--- misc/xmlsec1-1.2.14/src/mscrypto/x509vfy.c 2009-06-25 22:53:18.000000000 +0200 ++++ misc/build/xmlsec1-1.2.14/src/mscrypto/x509vfy.c 2009-09-23 10:01:07.237316078 +0200 +@@ -567,9 +567,16 @@ + CertFreeCertificateContext(nextCert); + } + +- if((selected == 1) && xmlSecMSCryptoX509StoreConstructCertsChain(store, cert, certs, keyInfoCtx)) { +- return(cert); +- } ++ /* JL: OpenOffice.org implements its own certificate verification routine. ++ The goal is to seperate validation of the signature ++ and the certificate. For example, OOo could show that the document signature is valid, ++ but the certificate could not be verified. If we do not prevent the verification of ++ the certificate by libxmlsec and the verification fails, then the XML signature will not be ++ verified. This would happen, for example, if the root certificate is not installed. ++ */ ++/* if((selected == 1) && xmlSecMSCryptoX509StoreConstructCertsChain(store, cert, certs, keyInfoCtx)) { */ ++ if (selected == 1) ++ return cert; + } + + return (NULL); +--- misc/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-09-23 10:06:52.989793254 +0200 ++++ misc/build/xmlsec1-1.2.14/src/nss/x509vfy.c 2009-09-23 10:05:03.183042205 +0200 +@@ -191,13 +191,27 @@ + continue; + } + +- status = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), +- cert, PR_FALSE, +- (SECCertificateUsage)0, +- timeboundary , NULL, NULL, NULL); +- if (status == SECSuccess) { +- break; +- } ++ ++ /* ++ JL: OpenOffice.org implements its own certificate verification routine. ++ The goal is to seperate validation of the signature ++ and the certificate. For example, OOo could show that the document signature is valid, ++ but the certificate could not be verified. If we do not prevent the verification of ++ the certificate by libxmlsec and the verification fails, then the XML signature may not be ++ verified. This would happen, for example, if the root certificate is not installed. ++ ++ status = CERT_VerifyCertificate(CERT_GetDefaultCertDB(), ++ cert, PR_FALSE, ++ (SECCertificateUsage)0, ++ timeboundary , NULL, NULL, NULL); ++ if (status == SECSuccess) { ++ break; ++ } ++ ++ */ ++ status = SECSuccess; ++ break; ++ + } + + if (status == SECSuccess) { diff --git a/libxmlsec/xmlsec1-nssdisablecallbacks.patch b/libxmlsec/xmlsec1-nssdisablecallbacks.patch new file mode 100644 index 0000000..c6ed83a --- /dev/null +++ b/libxmlsec/xmlsec1-nssdisablecallbacks.patch @@ -0,0 +1,36 @@ +--- misc/xmlsec1-1.2.14.orig/src/nss/crypto.c 2009-09-10 07:06:17.000000000 -0400 ++++ misc/build/xmlsec1-1.2.14/src/nss/crypto.c 2009-09-10 07:08:24.000000000 -0400 +@@ -136,6 +136,7 @@ + /** + * High level routines form xmlsec command line utility + */ ++#if 0 + gXmlSecNssFunctions->cryptoAppInit = xmlSecNssAppInit; + gXmlSecNssFunctions->cryptoAppShutdown = xmlSecNssAppShutdown; + gXmlSecNssFunctions->cryptoAppDefaultKeysMngrInit = xmlSecNssAppDefaultKeysMngrInit; +@@ -153,6 +154,25 @@ + gXmlSecNssFunctions->cryptoAppKeyLoad = xmlSecNssAppKeyLoad; + gXmlSecNssFunctions->cryptoAppKeyLoadMemory = xmlSecNssAppKeyLoadMemory; + gXmlSecNssFunctions->cryptoAppDefaultPwdCallback = (void*)xmlSecNssAppGetDefaultPwdCallback(); ++#else ++ gXmlSecNssFunctions->cryptoAppInit = NULL ; ++ gXmlSecNssFunctions->cryptoAppShutdown = NULL ; ++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrInit = NULL ; ++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrAdoptKey = NULL ; ++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrLoad = NULL ; ++ gXmlSecNssFunctions->cryptoAppDefaultKeysMngrSave = NULL ; ++#ifndef XMLSEC_NO_X509 ++ gXmlSecNssFunctions->cryptoAppKeysMngrCertLoad = NULL ; ++ gXmlSecNssFunctions->cryptoAppKeysMngrCertLoadMemory= NULL ; ++ gXmlSecNssFunctions->cryptoAppPkcs12Load = NULL ; ++ gXmlSecNssFunctions->cryptoAppPkcs12LoadMemory = NULL ; ++ gXmlSecNssFunctions->cryptoAppKeyCertLoad = NULL ; ++ gXmlSecNssFunctions->cryptoAppKeyCertLoadMemory = NULL ; ++#endif /* XMLSEC_NO_X509 */ ++ gXmlSecNssFunctions->cryptoAppKeyLoad = NULL ; ++ gXmlSecNssFunctions->cryptoAppKeyLoadMemory = NULL ; ++ gXmlSecNssFunctions->cryptoAppDefaultPwdCallback = (void*)NULL ; ++#endif + + return(gXmlSecNssFunctions); + } diff --git a/libxmlsec/xmlsec1-nssmangleciphers.patch b/libxmlsec/xmlsec1-nssmangleciphers.patch new file mode 100644 index 0000000..96f5049 --- /dev/null +++ b/libxmlsec/xmlsec1-nssmangleciphers.patch @@ -0,0 +1,1134 @@ +--- misc/xmlsec1-1.2.14/src/nss/ciphers.c 2009-09-10 05:16:27.000000000 -0400 ++++ misc/build/xmlsec1-1.2.14/src/nss/ciphers.c 2009-09-10 06:59:39.000000000 -0400 +@@ -11,180 +11,421 @@ + + #include <string.h> + +-#include <nspr.h> + #include <nss.h> +-#include <secoid.h> + #include <pk11func.h> + + #include <xmlsec/xmlsec.h> ++#include <xmlsec/xmltree.h> ++#include <xmlsec/base64.h> + #include <xmlsec/keys.h> + #include <xmlsec/transforms.h> + #include <xmlsec/errors.h> + + #include <xmlsec/nss/crypto.h> +- +-#define XMLSEC_NSS_MAX_KEY_SIZE 32 +-#define XMLSEC_NSS_MAX_IV_SIZE 32 +-#define XMLSEC_NSS_MAX_BLOCK_SIZE 32 ++#include <xmlsec/nss/ciphers.h> + + /************************************************************************** + * +- * Internal Nss Block cipher CTX ++ * Internal Nss Block Cipher Context ++ * This context is designed for repositing a block cipher for transform + * + *****************************************************************************/ +-typedef struct _xmlSecNssBlockCipherCtx xmlSecNssBlockCipherCtx, +- *xmlSecNssBlockCipherCtxPtr; ++typedef struct _xmlSecNssBlockCipherCtx xmlSecNssBlockCipherCtx ; ++typedef struct _xmlSecNssBlockCipherCtx* xmlSecNssBlockCipherCtxPtr ; ++ + struct _xmlSecNssBlockCipherCtx { + CK_MECHANISM_TYPE cipher; ++ PK11SymKey* symkey ; + PK11Context* cipherCtx; + xmlSecKeyDataId keyId; +- int keyInitialized; +- int ctxInitialized; +- xmlSecByte key[XMLSEC_NSS_MAX_KEY_SIZE]; +- xmlSecSize keySize; +- xmlSecByte iv[XMLSEC_NSS_MAX_IV_SIZE]; +- xmlSecSize ivSize; + }; +-static int xmlSecNssBlockCipherCtxInit (xmlSecNssBlockCipherCtxPtr ctx, +- xmlSecBufferPtr in, +- xmlSecBufferPtr out, +- int encrypt, +- const xmlChar* cipherName, +- xmlSecTransformCtxPtr transformCtx); +-static int xmlSecNssBlockCipherCtxUpdate (xmlSecNssBlockCipherCtxPtr ctx, +- xmlSecBufferPtr in, +- xmlSecBufferPtr out, +- int encrypt, +- const xmlChar* cipherName, +- xmlSecTransformCtxPtr transformCtx); +-static int xmlSecNssBlockCipherCtxFinal (xmlSecNssBlockCipherCtxPtr ctx, +- xmlSecBufferPtr in, +- xmlSecBufferPtr out, +- int encrypt, +- const xmlChar* cipherName, +- xmlSecTransformCtxPtr transformCtx); ++ ++#define xmlSecNssBlockCipherSize \ ++ ( sizeof( xmlSecTransform ) + sizeof( xmlSecNssBlockCipherCtx ) ) ++ ++#define xmlSecNssBlockCipherGetCtx( transform ) \ ++ ( ( xmlSecNssBlockCipherCtxPtr )( ( ( xmlSecByte* )( transform ) ) + sizeof( xmlSecTransform ) ) ) ++ ++static int ++xmlSecNssBlockCipherCheckId( ++ xmlSecTransformPtr transform ++) { ++ #ifndef XMLSEC_NO_DES ++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformDes3CbcId ) ) { ++ return 1 ; ++ } ++ #endif /* XMLSEC_NO_DES */ ++ ++ #ifndef XMLSEC_NO_AES ++ if( xmlSecTransformCheckId( transform, xmlSecNssTransformAes128CbcId ) || ++ xmlSecTransformCheckId( transform, xmlSecNssTransformAes192CbcId ) || ++ xmlSecTransformCheckId( transform, xmlSecNssTransformAes256CbcId ) ) { ++ ++ return 1 ; ++ } ++ #endif /* XMLSEC_NO_AES */ ++ ++ return 0 ; ++} ++ ++static int ++xmlSecNssBlockCipherFetchCtx( ++ xmlSecNssBlockCipherCtxPtr context , ++ xmlSecTransformId id ++) { ++ xmlSecAssert2( context != NULL, -1 ) ; ++ ++ #ifndef XMLSEC_NO_DES ++ if( id == xmlSecNssTransformDes3CbcId ) { ++ context->cipher = CKM_DES3_CBC ; ++ context->keyId = xmlSecNssKeyDataDesId ; ++ } else ++ #endif /* XMLSEC_NO_DES */ ++ ++ #ifndef XMLSEC_NO_AES ++ if( id == xmlSecNssTransformAes128CbcId ) { ++ context->cipher = CKM_AES_CBC ; ++ context->keyId = xmlSecNssKeyDataAesId ; ++ } else ++ if( id == xmlSecNssTransformAes192CbcId ) { ++ context->cipher = CKM_AES_CBC ; ++ context->keyId = xmlSecNssKeyDataAesId ; ++ } else ++ if( id == xmlSecNssTransformAes256CbcId ) { ++ context->cipher = CKM_AES_CBC ; ++ context->keyId = xmlSecNssKeyDataAesId ; ++ } else ++ #endif /* XMLSEC_NO_AES */ ++ ++ if( 1 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ NULL , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ return 0 ; ++} ++ ++/** ++ * xmlSecTransformInitializeMethod: ++ * @transform: the pointer to transform object. ++ * ++ * The transform specific initialization method. ++ * ++ * Returns 0 on success or a negative value otherwise. ++ */ ++static int ++xmlSecNssBlockCipherInitialize( ++ xmlSecTransformPtr transform ++) { ++ xmlSecNssBlockCipherCtxPtr context = NULL ; ++ ++ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; ++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; ++ ++ context = xmlSecNssBlockCipherGetCtx( transform ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssBlockCipherGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( xmlSecNssBlockCipherFetchCtx( context , transform->id ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssBlockCipherFetchCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ context->symkey = NULL ; ++ context->cipherCtx = NULL ; ++ ++ return 0 ; ++} ++ ++/** ++ * xmlSecTransformFinalizeMethod: ++ * @transform: the pointer to transform object. ++ * ++ * The transform specific destroy method. ++ */ ++static void ++xmlSecNssBlockCipherFinalize( ++ xmlSecTransformPtr transform ++) { ++ xmlSecNssBlockCipherCtxPtr context = NULL ; ++ ++ xmlSecAssert( xmlSecNssBlockCipherCheckId( transform ) ) ; ++ xmlSecAssert( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ) ) ; ++ ++ context = xmlSecNssBlockCipherGetCtx( transform ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssBlockCipherGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return ; ++ } ++ ++ if( context->cipherCtx != NULL ) { ++ PK11_DestroyContext( context->cipherCtx, PR_TRUE ) ; ++ context->cipherCtx = NULL ; ++ } ++ ++ if( context->symkey != NULL ) { ++ PK11_FreeSymKey( context->symkey ) ; ++ context->symkey = NULL ; ++ } ++ ++ context->cipher = CKM_INVALID_MECHANISM ; ++ context->keyId = NULL ; ++} ++ ++/** ++ * xmlSecTransformSetKeyRequirementsMethod: ++ * @transform: the pointer to transform object. ++ * @keyReq: the pointer to key requirements structure. ++ * ++ * Transform specific method to set transform's key requirements. ++ * ++ * Returns 0 on success or a negative value otherwise. ++ */ ++static int ++xmlSecNssBlockCipherSetKeyReq( ++ xmlSecTransformPtr transform , ++ xmlSecKeyReqPtr keyReq ++) { ++ xmlSecNssBlockCipherCtxPtr context = NULL ; ++ xmlSecSize cipherSize = 0 ; ++ ++ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; ++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; ++ xmlSecAssert2( keyReq != NULL , -1 ) ; ++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; ++ ++ context = xmlSecNssBlockCipherGetCtx( transform ) ; ++ if( context == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssBlockCipherGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ keyReq->keyId = context->keyId ; ++ keyReq->keyType = xmlSecKeyDataTypeSymmetric ; ++ ++ if( transform->operation == xmlSecTransformOperationEncrypt ) { ++ keyReq->keyUsage = xmlSecKeyUsageEncrypt ; ++ } else { ++ keyReq->keyUsage = xmlSecKeyUsageDecrypt ; ++ } ++ ++ /* ++ if( context->symkey != NULL ) ++ cipherSize = PK11_GetKeyLength( context->symkey ) ; ++ ++ keyReq->keyBitsSize = cipherSize * 8 ; ++ */ ++ ++ return 0 ; ++} ++ ++/** ++ * xmlSecTransformSetKeyMethod: ++ * @transform: the pointer to transform object. ++ * @key: the pointer to key. ++ * ++ * The transform specific method to set the key for use. ++ * ++ * Returns 0 on success or a negative value otherwise. ++ */ ++static int ++xmlSecNssBlockCipherSetKey( ++ xmlSecTransformPtr transform , ++ xmlSecKeyPtr key ++) { ++ xmlSecNssBlockCipherCtxPtr context = NULL ; ++ xmlSecKeyDataPtr keyData = NULL ; ++ PK11SymKey* symkey = NULL ; ++ CK_ATTRIBUTE_TYPE operation ; ++ int ivLen ; ++ ++ xmlSecAssert2( xmlSecNssBlockCipherCheckId( transform ), -1 ) ; ++ xmlSecAssert2( xmlSecTransformCheckSize( transform, xmlSecNssBlockCipherSize ), -1 ) ; ++ xmlSecAssert2( key != NULL , -1 ) ; ++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; ++ ++ context = xmlSecNssBlockCipherGetCtx( transform ) ; ++ if( context == NULL || context->keyId == NULL || context->symkey != NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ "xmlSecNssBlockCipherGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ xmlSecAssert2( xmlSecKeyCheckId( key, context->keyId ), -1 ) ; ++ ++ keyData = xmlSecKeyGetValue( key ) ; ++ if( keyData == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyGetName( key ) ) , ++ "xmlSecKeyGetValue" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( ( symkey = xmlSecNssSymKeyDataGetKey( keyData ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecKeyDataGetName( keyData ) ) , ++ "xmlSecNssSymKeyDataGetKey" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ context->symkey = symkey ; ++ ++ return 0 ; ++} ++ + static int + xmlSecNssBlockCipherCtxInit(xmlSecNssBlockCipherCtxPtr ctx, + xmlSecBufferPtr in, xmlSecBufferPtr out, + int encrypt, + const xmlChar* cipherName, + xmlSecTransformCtxPtr transformCtx) { +- SECItem keyItem; + SECItem ivItem; +- PK11SlotInfo* slot; +- PK11SymKey* symKey; ++ SECItem* secParam = NULL ; ++ xmlSecBufferPtr ivBuf = NULL ; + int ivLen; +- SECStatus rv; +- int ret; + + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(ctx->cipher != 0, -1); ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; + xmlSecAssert2(ctx->cipherCtx == NULL, -1); +- xmlSecAssert2(ctx->keyInitialized != 0, -1); +- xmlSecAssert2(ctx->ctxInitialized == 0, -1); ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; + xmlSecAssert2(in != NULL, -1); + xmlSecAssert2(out != NULL, -1); + xmlSecAssert2(transformCtx != NULL, -1); + + ivLen = PK11_GetIVLength(ctx->cipher); +- xmlSecAssert2(ivLen > 0, -1); +- xmlSecAssert2((xmlSecSize)ivLen <= sizeof(ctx->iv), -1); ++ if( ivLen < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "PK11_GetIVLength" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( ( ivBuf = xmlSecBufferCreate( ivLen ) ) == NULL ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferCreate" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } + + if(encrypt) { +- /* generate random iv */ +- rv = PK11_GenerateRandom(ctx->iv, ivLen); +- if(rv != SECSuccess) { ++ if( PK11_GenerateRandom( ivBuf->data , ivLen ) != SECSuccess ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "PK11_GenerateRandom", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- "size=%d", ivLen); ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecBufferDestroy( ivBuf ) ; + return(-1); + } ++ if( xmlSecBufferSetSize( ivBuf , ivLen ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ NULL , ++ "xmlSecBufferSetSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ xmlSecBufferDestroy( ivBuf ) ; ++ return -1 ; ++ } + +- /* write iv to the output */ +- ret = xmlSecBufferAppend(out, ctx->iv, ivLen); +- if(ret < 0) { ++ if( xmlSecBufferAppend( out , ivBuf->data , ivLen ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "xmlSecBufferAppend", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", ivLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecBufferDestroy( ivBuf ) ; + return(-1); + } + + } else { +- /* if we don't have enough data, exit and hope that +- * we'll have iv next time */ +- if(xmlSecBufferGetSize(in) < (xmlSecSize)ivLen) { +- return(0); +- } +- +- /* copy iv to our buffer*/ +- xmlSecAssert2(xmlSecBufferGetData(in) != NULL, -1); +- memcpy(ctx->iv, xmlSecBufferGetData(in), ivLen); +- +- /* and remove from input */ +- ret = xmlSecBufferRemoveHead(in, ivLen); +- if(ret < 0) { ++ if( xmlSecBufferSetData( ivBuf , in->data , ivLen ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), +- "xmlSecBufferRemoveHead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", ivLen); ++ "xmlSecBufferSetData", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecBufferDestroy( ivBuf ) ; + return(-1); + } + } + +- memset(&keyItem, 0, sizeof(keyItem)); +- keyItem.data = ctx->key; +- keyItem.len = ctx->keySize; +- memset(&ivItem, 0, sizeof(ivItem)); +- ivItem.data = ctx->iv; +- ivItem.len = ctx->ivSize; +- +- slot = PK11_GetBestSlot(ctx->cipher, NULL); +- if(slot == NULL) { ++ if( xmlSecBufferRemoveHead( in , ivLen ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), +- "PK11_GetBestSlot", ++ "xmlSecBufferRemoveHead", + XMLSEC_ERRORS_R_CRYPTO_FAILED, + XMLSEC_ERRORS_NO_MESSAGE); ++ xmlSecBufferDestroy( ivBuf ) ; + return(-1); + } + +- symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginDerive, +- CKA_SIGN, &keyItem, NULL); +- if(symKey == NULL) { ++ ivItem.data = xmlSecBufferGetData( ivBuf ) ; ++ ivItem.len = xmlSecBufferGetSize( ivBuf ) ; ++ if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), +- "PK11_ImportSymKey", ++ "PK11_ParamFromIV", + XMLSEC_ERRORS_R_CRYPTO_FAILED, + XMLSEC_ERRORS_NO_MESSAGE); +- PK11_FreeSlot(slot); ++ xmlSecBufferDestroy( ivBuf ) ; + return(-1); + } + + ctx->cipherCtx = PK11_CreateContextBySymKey(ctx->cipher, + (encrypt) ? CKA_ENCRYPT : CKA_DECRYPT, +- symKey, &ivItem); ++ ctx->symkey, secParam); + if(ctx->cipherCtx == NULL) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), +- "PK11_CreateContextBySymKey", ++ "xmlSecBufferRemoveHead", + XMLSEC_ERRORS_R_CRYPTO_FAILED, + XMLSEC_ERRORS_NO_MESSAGE); +- PK11_FreeSymKey(symKey); +- PK11_FreeSlot(slot); ++ SECITEM_FreeItem( secParam , PR_TRUE ) ; ++ xmlSecBufferDestroy( ivBuf ) ; + return(-1); + } + +- ctx->ctxInitialized = 1; +- PK11_FreeSymKey(symKey); +- PK11_FreeSlot(slot); ++ SECITEM_FreeItem( secParam , PR_TRUE ) ; ++ xmlSecBufferDestroy( ivBuf ) ; + return(0); + } + ++/** ++ * Block cipher transform update ++ */ + static int + xmlSecNssBlockCipherCtxUpdate(xmlSecNssBlockCipherCtxPtr ctx, + xmlSecBufferPtr in, xmlSecBufferPtr out, +@@ -192,54 +433,49 @@ + const xmlChar* cipherName, + xmlSecTransformCtxPtr transformCtx) { + xmlSecSize inSize, inBlocks, outSize; +- int blockLen; ++ int blockSize; + int outLen = 0; + xmlSecByte* outBuf; +- SECStatus rv; +- int ret; + + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(ctx->cipher != 0, -1); ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; + xmlSecAssert2(ctx->cipherCtx != NULL, -1); +- xmlSecAssert2(ctx->ctxInitialized != 0, -1); ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; + xmlSecAssert2(in != NULL, -1); + xmlSecAssert2(out != NULL, -1); + xmlSecAssert2(transformCtx != NULL, -1); + +- blockLen = PK11_GetBlockSize(ctx->cipher, NULL); +- xmlSecAssert2(blockLen > 0, -1); ++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( cipherName ) , ++ "PK11_GetBlockSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } + + inSize = xmlSecBufferGetSize(in); + outSize = xmlSecBufferGetSize(out); +- +- if(inSize < (xmlSecSize)blockLen) { +- return(0); ++ ++ inBlocks = ( encrypt != 0 ? inSize : ( inSize - 1 ) ) / blockSize ; ++ inSize = inBlocks * blockSize ; ++ ++ if( inSize < blockSize ) { ++ return 0 ; + } + +- if(encrypt) { +- inBlocks = inSize / ((xmlSecSize)blockLen); +- } else { +- /* we want to have the last block in the input buffer +- * for padding check */ +- inBlocks = (inSize - 1) / ((xmlSecSize)blockLen); +- } +- inSize = inBlocks * ((xmlSecSize)blockLen); +- +- /* we write out the input size plus may be one block */ +- ret = xmlSecBufferSetMaxSize(out, outSize + inSize + blockLen); +- if(ret < 0) { ++ if( xmlSecBufferSetMaxSize( out , outSize + inSize + blockSize ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "xmlSecBufferSetMaxSize", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", outSize + inSize + blockLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + outBuf = xmlSecBufferGetData(out) + outSize; + +- rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, inSize + blockLen, +- xmlSecBufferGetData(in), inSize); +- if(rv != SECSuccess) { ++ if(PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData( in ) , inSize ) != SECSuccess ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "PK11_CipherOp", +@@ -247,27 +483,22 @@ + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } +- xmlSecAssert2((xmlSecSize)outLen == inSize, -1); + +- /* set correct output buffer size */ +- ret = xmlSecBufferSetSize(out, outSize + outLen); +- if(ret < 0) { ++ if( xmlSecBufferSetSize( out , outSize + outLen ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "xmlSecBufferSetSize", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", outSize + outLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + +- /* remove the processed block from input */ +- ret = xmlSecBufferRemoveHead(in, inSize); +- if(ret < 0) { ++ if( xmlSecBufferRemoveHead( in , inSize ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "xmlSecBufferRemoveHead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", inSize); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + return(0); +@@ -281,81 +512,82 @@ + const xmlChar* cipherName, + xmlSecTransformCtxPtr transformCtx) { + xmlSecSize inSize, outSize; +- int blockLen, outLen = 0; ++ int blockSize, outLen = 0; + xmlSecByte* inBuf; + xmlSecByte* outBuf; +- SECStatus rv; +- int ret; + + xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(ctx->cipher != 0, -1); ++ xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ; ++ xmlSecAssert2( ctx->symkey != NULL , -1 ) ; + xmlSecAssert2(ctx->cipherCtx != NULL, -1); +- xmlSecAssert2(ctx->ctxInitialized != 0, -1); ++ xmlSecAssert2( ctx->keyId != NULL , -1 ) ; + xmlSecAssert2(in != NULL, -1); + xmlSecAssert2(out != NULL, -1); + xmlSecAssert2(transformCtx != NULL, -1); + +- blockLen = PK11_GetBlockSize(ctx->cipher, NULL); +- xmlSecAssert2(blockLen > 0, -1); ++ if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( cipherName ) , ++ "PK11_GetBlockSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } + + inSize = xmlSecBufferGetSize(in); + outSize = xmlSecBufferGetSize(out); + ++ /******************************************************************/ + if(encrypt != 0) { +- xmlSecAssert2(inSize < (xmlSecSize)blockLen, -1); ++ xmlSecAssert2( inSize < blockSize, -1 ) ; + + /* create padding */ +- ret = xmlSecBufferSetMaxSize(in, blockLen); +- if(ret < 0) { ++ if( xmlSecBufferSetMaxSize( in , blockSize ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "xmlSecBufferSetMaxSize", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", blockLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + inBuf = xmlSecBufferGetData(in); + +- /* generate random padding */ +- if((xmlSecSize)blockLen > (inSize + 1)) { +- rv = PK11_GenerateRandom(inBuf + inSize, blockLen - inSize - 1); +- if(rv != SECSuccess) { ++ /* generate random */ ++ if( blockSize > ( inSize + 1 ) ) { ++ if( PK11_GenerateRandom( inBuf + inSize, blockSize - inSize - 1 ) != SECSuccess ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "PK11_GenerateRandom", + XMLSEC_ERRORS_R_CRYPTO_FAILED, +- "size=%d", blockLen - inSize - 1); ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + } +- inBuf[blockLen - 1] = blockLen - inSize; +- inSize = blockLen; ++ inBuf[blockSize-1] = blockSize - inSize ; ++ inSize = blockSize ; + } else { +- if(inSize != (xmlSecSize)blockLen) { ++ if( inSize != blockSize ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, +- "data=%d;block=%d", inSize, blockLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + } + +- /* process last block */ +- ret = xmlSecBufferSetMaxSize(out, outSize + 2 * blockLen); +- if(ret < 0) { ++ /* process the last block */ ++ if( xmlSecBufferSetMaxSize( out , outSize + inSize + blockSize ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "xmlSecBufferSetMaxSize", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", outSize + 2 * blockLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + outBuf = xmlSecBufferGetData(out) + outSize; + +- rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, 2 * blockLen, +- xmlSecBufferGetData(in), inSize); +- if(rv != SECSuccess) { ++ if( PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData( in ) , inSize ) != SECSuccess ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + "PK11_CipherOp", +@@ -363,300 +595,169 @@ + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } +- xmlSecAssert2((xmlSecSize)outLen == inSize, -1); + + if(encrypt == 0) { + /* check padding */ +- if(outLen < outBuf[blockLen - 1]) { ++ if( outLen < outBuf[blockSize-1] ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), + NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, +- "padding=%d;buffer=%d", +- outBuf[blockLen - 1], outLen); ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, ++ XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } +- outLen -= outBuf[blockLen - 1]; ++ outLen -= outBuf[blockSize-1] ; + } + +- /* set correct output buffer size */ +- ret = xmlSecBufferSetSize(out, outSize + outLen); +- if(ret < 0) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(cipherName), +- "xmlSecBufferSetSize", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", outSize + outLen); +- return(-1); +- } ++ /******************************************************************/ + +- /* remove the processed block from input */ +- ret = xmlSecBufferRemoveHead(in, inSize); +- if(ret < 0) { ++ /****************************************************************** ++ if( xmlSecBufferSetMaxSize( out , outSize + blockSize ) < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(cipherName), +- "xmlSecBufferRemoveHead", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, +- "size=%d", inSize); +- return(-1); +- } +- +- return(0); +-} +- +- +-/****************************************************************************** +- * +- * EVP Block Cipher transforms +- * +- * xmlSecNssBlockCipherCtx block is located after xmlSecTransform structure +- * +- *****************************************************************************/ +-#define xmlSecNssBlockCipherSize \ +- (sizeof(xmlSecTransform) + sizeof(xmlSecNssBlockCipherCtx)) +-#define xmlSecNssBlockCipherGetCtx(transform) \ +- ((xmlSecNssBlockCipherCtxPtr)(((xmlSecByte*)(transform)) + sizeof(xmlSecTransform))) +- +-static int xmlSecNssBlockCipherInitialize (xmlSecTransformPtr transform); +-static void xmlSecNssBlockCipherFinalize (xmlSecTransformPtr transform); +-static int xmlSecNssBlockCipherSetKeyReq (xmlSecTransformPtr transform, +- xmlSecKeyReqPtr keyReq); +-static int xmlSecNssBlockCipherSetKey (xmlSecTransformPtr transform, +- xmlSecKeyPtr key); +-static int xmlSecNssBlockCipherExecute (xmlSecTransformPtr transform, +- int last, +- xmlSecTransformCtxPtr transformCtx); +-static int xmlSecNssBlockCipherCheckId (xmlSecTransformPtr transform); +- +- +- +-static int +-xmlSecNssBlockCipherCheckId(xmlSecTransformPtr transform) { +-#ifndef XMLSEC_NO_DES +- if(xmlSecTransformCheckId(transform, xmlSecNssTransformDes3CbcId)) { +- return(1); +- } +-#endif /* XMLSEC_NO_DES */ +- +-#ifndef XMLSEC_NO_AES +- if(xmlSecTransformCheckId(transform, xmlSecNssTransformAes128CbcId) || +- xmlSecTransformCheckId(transform, xmlSecNssTransformAes192CbcId) || +- xmlSecTransformCheckId(transform, xmlSecNssTransformAes256CbcId)) { +- +- return(1); +- } +-#endif /* XMLSEC_NO_AES */ +- +- return(0); +-} +- +-static int +-xmlSecNssBlockCipherInitialize(xmlSecTransformPtr transform) { +- xmlSecNssBlockCipherCtxPtr ctx; +- +- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); +- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); +- +- ctx = xmlSecNssBlockCipherGetCtx(transform); +- xmlSecAssert2(ctx != NULL, -1); +- +- memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx)); +- +-#ifndef XMLSEC_NO_DES +- if(transform->id == xmlSecNssTransformDes3CbcId) { +- ctx->cipher = CKM_DES3_CBC; +- ctx->keyId = xmlSecNssKeyDataDesId; +- ctx->keySize = 24; +- } else +-#endif /* XMLSEC_NO_DES */ +- +-#ifndef XMLSEC_NO_AES +- if(transform->id == xmlSecNssTransformAes128CbcId) { +- ctx->cipher = CKM_AES_CBC; +- ctx->keyId = xmlSecNssKeyDataAesId; +- ctx->keySize = 16; +- } else if(transform->id == xmlSecNssTransformAes192CbcId) { +- ctx->cipher = CKM_AES_CBC; +- ctx->keyId = xmlSecNssKeyDataAesId; +- ctx->keySize = 24; +- } else if(transform->id == xmlSecNssTransformAes256CbcId) { +- ctx->cipher = CKM_AES_CBC; +- ctx->keyId = xmlSecNssKeyDataAesId; +- ctx->keySize = 32; +- } else +-#endif /* XMLSEC_NO_AES */ +- +- if(1) { +- xmlSecError(XMLSEC_ERRORS_HERE, +- xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), +- NULL, +- XMLSEC_ERRORS_R_INVALID_TRANSFORM, ++ "xmlSecBufferSetMaxSize", ++ XMLSEC_ERRORS_R_CRYPTO_FAILED, + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); +- } +- +- return(0); +-} +- +-static void +-xmlSecNssBlockCipherFinalize(xmlSecTransformPtr transform) { +- xmlSecNssBlockCipherCtxPtr ctx; +- +- xmlSecAssert(xmlSecNssBlockCipherCheckId(transform)); +- xmlSecAssert(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize)); +- +- ctx = xmlSecNssBlockCipherGetCtx(transform); +- xmlSecAssert(ctx != NULL); +- +- if(ctx->cipherCtx != NULL) { +- PK11_DestroyContext(ctx->cipherCtx, PR_TRUE); + } +- +- memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx)); +-} + +-static int +-xmlSecNssBlockCipherSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq) { +- xmlSecNssBlockCipherCtxPtr ctx; +- +- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); +- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); +- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); +- xmlSecAssert2(keyReq != NULL, -1); +- +- ctx = xmlSecNssBlockCipherGetCtx(transform); +- xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(ctx->keyId != NULL, -1); ++ outBuf = xmlSecBufferGetData( out ) + outSize ; ++ if( PK11_DigestFinal( ctx->cipherCtx , outBuf , &outLen , blockSize ) != SECSuccess ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( cipherName ) , ++ "PK11_DigestFinal" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ******************************************************************/ ++ ++ if( xmlSecBufferSetSize( out , outSize + outLen ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( cipherName ) , ++ "xmlSecBufferSetSize" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++ if( xmlSecBufferRemoveHead( in , inSize ) < 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( cipherName ) , ++ "xmlSecBufferRemoveHead" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; ++ return -1 ; ++ } ++ ++/* PK11_Finalize( ctx->cipherCtx ) ;*/ ++ PK11_DestroyContext(ctx->cipherCtx, PR_TRUE); ++ ctx->cipherCtx = NULL ; + +- keyReq->keyId = ctx->keyId; +- keyReq->keyType = xmlSecKeyDataTypeSymmetric; +- if(transform->operation == xmlSecTransformOperationEncrypt) { +- keyReq->keyUsage = xmlSecKeyUsageEncrypt; +- } else { +- keyReq->keyUsage = xmlSecKeyUsageDecrypt; +- } +- keyReq->keyBitsSize = 8 * ctx->keySize; + return(0); + } + +-static int +-xmlSecNssBlockCipherSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key) { +- xmlSecNssBlockCipherCtxPtr ctx; +- xmlSecBufferPtr buffer; ++/** ++ * xmlSecTransformExecuteMethod: ++ * @transform: the pointer to transform object. ++ * @last: the flag: if set to 1 then it's the last data chunk. ++ * @transformCtx: the pointer to transform context object. ++ * ++ * Transform specific method to process a chunk of data. ++ * ++ * Returns 0 on success or a negative value otherwise. ++ */ ++xmlSecNssBlockCipherExecute( ++ xmlSecTransformPtr transform , ++ int last , ++ xmlSecTransformCtxPtr transformCtx ++) { ++ xmlSecNssBlockCipherCtxPtr context = NULL ; ++ xmlSecBufferPtr inBuf = NULL ; ++ xmlSecBufferPtr outBuf = NULL ; ++ const xmlChar* cipherName ; ++ int operation ; ++ int rtv ; + + xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); +- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); + xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); +- xmlSecAssert2(key != NULL, -1); +- +- ctx = xmlSecNssBlockCipherGetCtx(transform); +- xmlSecAssert2(ctx != NULL, -1); +- xmlSecAssert2(ctx->cipher != 0, -1); +- xmlSecAssert2(ctx->keyInitialized == 0, -1); +- xmlSecAssert2(ctx->keyId != NULL, -1); +- xmlSecAssert2(xmlSecKeyCheckId(key, ctx->keyId), -1); +- +- xmlSecAssert2(ctx->keySize > 0, -1); +- xmlSecAssert2(ctx->keySize <= sizeof(ctx->key), -1); + +- buffer = xmlSecKeyDataBinaryValueGetBuffer(xmlSecKeyGetValue(key)); +- xmlSecAssert2(buffer != NULL, -1); ++ xmlSecAssert2( ( transform->operation == xmlSecTransformOperationEncrypt ) || ( transform->operation == xmlSecTransformOperationDecrypt ), -1 ) ; ++ xmlSecAssert2( transformCtx != NULL , -1 ) ; + +- if(xmlSecBufferGetSize(buffer) < ctx->keySize) { ++ context = xmlSecNssBlockCipherGetCtx( transform ) ; ++ if( context == NULL ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), +- NULL, +- XMLSEC_ERRORS_R_INVALID_KEY_DATA_SIZE, +- "keySize=%d;expected=%d", +- xmlSecBufferGetSize(buffer), ctx->keySize); +- return(-1); ++ "xmlSecNssBlockCipherGetCtx" , ++ XMLSEC_ERRORS_R_CRYPTO_FAILED , ++ XMLSEC_ERRORS_NO_MESSAGE ) ; + } +- +- xmlSecAssert2(xmlSecBufferGetData(buffer) != NULL, -1); +- memcpy(ctx->key, xmlSecBufferGetData(buffer), ctx->keySize); +- +- ctx->keyInitialized = 1; +- return(0); +-} +- +-static int +-xmlSecNssBlockCipherExecute(xmlSecTransformPtr transform, int last, xmlSecTransformCtxPtr transformCtx) { +- xmlSecNssBlockCipherCtxPtr ctx; +- xmlSecBufferPtr in, out; +- int ret; +- +- xmlSecAssert2(xmlSecNssBlockCipherCheckId(transform), -1); +- xmlSecAssert2((transform->operation == xmlSecTransformOperationEncrypt) || (transform->operation == xmlSecTransformOperationDecrypt), -1); +- xmlSecAssert2(xmlSecTransformCheckSize(transform, xmlSecNssBlockCipherSize), -1); +- xmlSecAssert2(transformCtx != NULL, -1); + +- in = &(transform->inBuf); +- out = &(transform->outBuf); +- +- ctx = xmlSecNssBlockCipherGetCtx(transform); +- xmlSecAssert2(ctx != NULL, -1); ++ inBuf = &( transform->inBuf ) ; ++ outBuf = &( transform->outBuf ) ; + + if(transform->status == xmlSecTransformStatusNone) { + transform->status = xmlSecTransformStatusWorking; + } + ++ operation = ( transform->operation == xmlSecTransformOperationEncrypt ) ? 1 : 0 ; ++ cipherName = xmlSecTransformGetName( transform ) ; ++ + if(transform->status == xmlSecTransformStatusWorking) { +- if(ctx->ctxInitialized == 0) { +- ret = xmlSecNssBlockCipherCtxInit(ctx, in, out, +- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0, +- xmlSecTransformGetName(transform), transformCtx); +- if(ret < 0) { ++ if( context->cipherCtx == NULL ) { ++ rtv = xmlSecNssBlockCipherCtxInit( context, inBuf , outBuf , operation , cipherName , transformCtx ) ; ++ if( rtv < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), + "xmlSecNssBlockCipherCtxInit", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_R_INVALID_STATUS, + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + } +- if((ctx->ctxInitialized == 0) && (last != 0)) { ++ if( context->cipherCtx == NULL && last != 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), + NULL, +- XMLSEC_ERRORS_R_INVALID_DATA, ++ XMLSEC_ERRORS_R_INVALID_STATUS, + "not enough data to initialize transform"); + return(-1); + } + +- if(ctx->ctxInitialized != 0) { +- ret = xmlSecNssBlockCipherCtxUpdate(ctx, in, out, +- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0, +- xmlSecTransformGetName(transform), transformCtx); +- if(ret < 0) { ++ if( context->cipherCtx != NULL ) { ++ rtv = xmlSecNssBlockCipherCtxUpdate( context, inBuf , outBuf , operation , cipherName , transformCtx ) ; ++ if( rtv < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), + "xmlSecNssBlockCipherCtxUpdate", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_R_INVALID_STATUS, + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + } + + if(last) { +- ret = xmlSecNssBlockCipherCtxFinal(ctx, in, out, +- (transform->operation == xmlSecTransformOperationEncrypt) ? 1 : 0, +- xmlSecTransformGetName(transform), transformCtx); +- if(ret < 0) { ++ rtv = xmlSecNssBlockCipherCtxFinal( context, inBuf , outBuf , operation , cipherName , transformCtx ) ; ++ if( rtv < 0 ) { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), + "xmlSecNssBlockCipherCtxFinal", +- XMLSEC_ERRORS_R_XMLSEC_FAILED, ++ XMLSEC_ERRORS_R_INVALID_STATUS, + XMLSEC_ERRORS_NO_MESSAGE); + return(-1); + } + transform->status = xmlSecTransformStatusFinished; + } + } else if(transform->status == xmlSecTransformStatusFinished) { +- /* the only way we can get here is if there is no input */ +- xmlSecAssert2(xmlSecBufferGetSize(in) == 0, -1); +- } else if(transform->status == xmlSecTransformStatusNone) { +- /* the only way we can get here is if there is no enough data in the input */ +- xmlSecAssert2(last == 0, -1); ++ if( xmlSecBufferGetSize( inBuf ) != 0 ) { ++ xmlSecError( XMLSEC_ERRORS_HERE , ++ xmlSecErrorsSafeString( xmlSecTransformGetName( transform ) ) , ++ NULL , ++ XMLSEC_ERRORS_R_INVALID_STATUS , ++ "status=%d", transform->status ) ; ++ return -1 ; ++ } + } else { + xmlSecError(XMLSEC_ERRORS_HERE, + xmlSecErrorsSafeString(xmlSecTransformGetName(transform)), diff --git a/libxmlsec/xmlsec1-olderlibxml2.patch b/libxmlsec/xmlsec1-olderlibxml2.patch new file mode 100644 index 0000000..b5f3d57 --- /dev/null +++ b/libxmlsec/xmlsec1-olderlibxml2.patch @@ -0,0 +1,23 @@ +--- misc/xmlsec1-1.2.14/src/c14n.c 2010-03-02 15:46:05.000000000 +0000 ++++ misc/build/xmlsec1-1.2.14/src/c14n.c 2010-03-02 15:50:35.000000000 +0000 +@@ -406,6 +406,20 @@ + return(0); + } + ++#if !defined(LIBXML_VERSION) || LIBXML_VERSION < 20706 ++/* ++ * xmlC14NMode: ++ * ++ * Predefined values for C14N modes ++ * ++ */ ++typedef enum { ++ XML_C14N_1_0 = 0, /* Origianal C14N 1.0 spec */ ++ XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */ ++ XML_C14N_1_1 = 2 /* C14N 1.1 spec */ ++} xmlC14NMode; ++#endif ++ + static int + xmlSecTransformC14NExecute(xmlSecTransformId id, xmlSecNodeSetPtr nodes, xmlChar** nsList, + xmlOutputBufferPtr buf) { diff --git a/libxmlsec/xmlsec1-update-config-sub-and-guess.patch b/libxmlsec/xmlsec1-update-config-sub-and-guess.patch new file mode 100644 index 0000000..a0caf35 --- /dev/null +++ b/libxmlsec/xmlsec1-update-config-sub-and-guess.patch @@ -0,0 +1,2314 @@ +--- misc/xmlsec1-1.2.12/config.guess 2010-04-15 09:29:35.000000000 +0000 ++++ misc/build/xmlsec1-1.2.12/config.guess 2010-04-15 09:29:46.000000000 +0000 +@@ -1,9 +1,10 @@ + #! /bin/sh + # Attempt to guess a canonical system name. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++# Free Software Foundation, Inc. + +-timestamp='2003-06-17' ++timestamp='2009-12-30' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -17,23 +18,25 @@ + # + # 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. ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++# 02110-1301, USA. + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + +-# Originally written by Per Bothner <per@bothner.com>. +-# Please send patches to <config-patches@gnu.org>. Submit a context +-# diff and a properly formatted ChangeLog entry. ++ ++# Originally written by Per Bothner. Please send patches (context ++# diff format) to <config-patches@gnu.org> and include a ChangeLog ++# entry. + # + # This script attempts to guess a canonical system name similar to + # config.sub. If it succeeds, it prints the system name on stdout, and + # exits with 0. Otherwise, it exits with 1. + # +-# The plan is that this can be called by configure scripts if you +-# don't specify an explicit build system type. ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -53,8 +56,9 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free ++Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -66,11 +70,11 @@ + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) +- echo "$timestamp" ; exit 0 ;; ++ echo "$timestamp" ; exit ;; + --version | -v ) +- echo "$version" ; exit 0 ;; ++ echo "$version" ; exit ;; + --help | --h* | -h ) +- echo "$usage"; exit 0 ;; ++ echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. +@@ -104,7 +108,7 @@ + trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; + trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; + : ${TMPDIR=/tmp} ; +- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || ++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +@@ -123,7 +127,7 @@ + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +-esac ;' ++esac ; set_cc_for_build= ;' + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi@noc.rutgers.edu 1994-08-24) +@@ -136,13 +140,6 @@ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +-## for Red Hat Linux +-if test -f /etc/redhat-release ; then +- VENDOR=redhat ; +-else +- VENDOR= ; +-fi +- + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +@@ -165,6 +162,7 @@ + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; ++ sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched +@@ -173,7 +171,7 @@ + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ +- | grep __ELF__ >/dev/null ++ | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? +@@ -203,50 +201,32 @@ + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" +- exit 0 ;; +- amiga:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- arc:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- hp300:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mac68k:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- macppc:OpenBSD:*:*) +- echo powerpc-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvme68k:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvme88k:OpenBSD:*:*) +- echo m88k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- mvmeppc:OpenBSD:*:*) +- echo powerpc-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- pmax:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sgi:OpenBSD:*:*) +- echo mipseb-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- sun3:OpenBSD:*:*) +- echo m68k-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; +- wgrisc:OpenBSD:*:*) +- echo mipsel-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:OpenBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} +- exit 0 ;; ++ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ++ exit ;; ++ *:ekkoBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} ++ exit ;; ++ *:SolidBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} ++ exit ;; ++ macppc:MirBSD:*:*) ++ echo powerpc-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; ++ *:MirBSD:*:*) ++ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} ++ exit ;; + alpha:OSF1:*:*) +- if test $UNAME_RELEASE = "V4.0"; then ++ case $UNAME_RELEASE in ++ *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` +- fi ++ ;; ++ *5.*) ++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ++ ;; ++ esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU +@@ -284,42 +264,49 @@ + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac ++ # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. +- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` +- exit 0 ;; +- Alpha*:OpenVMS:*:*) +- echo alpha-hp-vms +- exit 0 ;; ++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` ++ exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix +- exit 0 ;; ++ exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 +- exit 0 ;; ++ exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 +- exit 0;; ++ exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos +- exit 0 ;; ++ exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos +- exit 0 ;; ++ exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition +- exit 0 ;; ++ exit ;; ++ *:z/VM:*:*) ++ echo s390-ibm-zvmoe ++ exit ;; ++ *:OS400:*:*) ++ echo powerpc-ibm-os400 ++ exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} +- exit 0;; ++ exit ;; ++ arm:riscos:*:*|arm:RISCOS:*:*) ++ echo arm-unknown-riscos ++ exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp +- exit 0;; ++ exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then +@@ -327,32 +314,51 @@ + else + echo pyramid-pyramid-bsd + fi +- exit 0 ;; ++ exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 +- exit 0 ;; ++ exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 +- exit 0 ;; +- DRS?6000:UNIX_SV:4.2*:7*) ++ exit ;; ++ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in +- sparc) echo sparc-icl-nx7 && exit 0 ;; ++ sparc) echo sparc-icl-nx7; exit ;; + esac ;; ++ s390x:SunOS:*:*) ++ echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; +- i86pc:SunOS:5.*:*) +- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; ++ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) ++ echo i386-pc-auroraux${UNAME_RELEASE} ++ exit ;; ++ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) ++ eval $set_cc_for_build ++ SUN_ARCH="i386" ++ # If there is a compiler, see if it is configured for 64-bit objects. ++ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. ++ # This test works for both compilers. ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ SUN_ARCH="x86_64" ++ fi ++ fi ++ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) +@@ -361,10 +367,10 @@ + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` +- exit 0 ;; ++ exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 +@@ -376,10 +382,10 @@ + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac +- exit 0 ;; ++ exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor +@@ -390,37 +396,40 @@ + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ m68k:machten:*:*) ++ echo m68k-apple-machten${UNAME_RELEASE} ++ exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 +- exit 0 ;; ++ exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +@@ -444,32 +453,33 @@ + exit (-1); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c \ +- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ +- && exit 0 ++ $CC_FOR_BUILD -o $dummy $dummy.c && ++ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && ++ SYSTEM_NAME=`$dummy $dummyarg` && ++ { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax +- exit 0 ;; ++ exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax +- exit 0 ;; ++ exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax +- exit 0 ;; ++ exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix +- exit 0 ;; ++ exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 +- exit 0 ;; ++ exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 +- exit 0 ;; ++ exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 +- exit 0 ;; ++ exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` +@@ -485,29 +495,29 @@ + else + echo i586-dg-dgux${UNAME_RELEASE} + fi +- exit 0 ;; ++ exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 +- exit 0 ;; ++ exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 +- exit 0 ;; ++ exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 +- exit 0 ;; ++ exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd +- exit 0 ;; ++ exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` +- exit 0 ;; ++ exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. +- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id +- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' ++ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id ++ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix +- exit 0 ;; ++ exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` +@@ -515,7 +525,7 @@ + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} +- exit 0 ;; ++ exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build +@@ -530,15 +540,19 @@ + exit(0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 +- echo rs6000-ibm-aix3.2.5 ++ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` ++ then ++ echo "$SYSTEM_NAME" ++ else ++ echo rs6000-ibm-aix3.2.5 ++ fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi +- exit 0 ;; +- *:AIX:*:[45]) ++ exit ;; ++ *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 +@@ -551,28 +565,28 @@ + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} +- exit 0 ;; ++ exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix +- exit 0 ;; ++ exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 +- exit 0 ;; ++ exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to +- exit 0 ;; # report: romp-ibm BSD 4.3 ++ exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx +- exit 0 ;; ++ exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 +- exit 0 ;; ++ exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd +- exit 0 ;; ++ exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 +- exit 0 ;; ++ exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in +@@ -634,9 +648,19 @@ + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then +- # avoid double evaluation of $set_cc_for_build +- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build +- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null ++ eval $set_cc_for_build ++ ++ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating ++ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler ++ # generating 64-bit code. GNU and HP use different nomenclature: ++ # ++ # $ CC_FOR_BUILD=cc ./config.guess ++ # => hppa2.0w-hp-hpux11.23 ++ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess ++ # => hppa64-hp-hpux11.23 ++ ++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | ++ grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else +@@ -644,11 +668,11 @@ + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} +- exit 0 ;; ++ exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} +- exit 0 ;; ++ exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +@@ -676,208 +700,248 @@ + exit (0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 ++ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 +- exit 0 ;; ++ exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd +- exit 0 ;; ++ exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd +- exit 0 ;; ++ exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix +- exit 0 ;; ++ exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf +- exit 0 ;; ++ exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf +- exit 0 ;; ++ exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi +- exit 0 ;; ++ exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites +- exit 0 ;; ++ exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd +- exit 0 ;; ++ exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi +- exit 0 ;; ++ exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd +- exit 0 ;; ++ exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd +- exit 0 ;; ++ exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd +- exit 0 ;; ++ exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ exit ;; + *:UNICOS/mp:*:*) +- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' +- exit 0 ;; ++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" +- exit 0 ;; ++ exit ;; ++ 5000:UNIX_System_V:4.*:*) ++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` ++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` ++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" ++ exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} +- exit 0 ;; +- *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) +- # Determine whether the default compiler uses glibc. +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include <features.h> +- #if __GLIBC__ >= 2 +- LIBC=gnu +- #else +- LIBC= +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` +- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} +- exit 0 ;; ++ exit ;; ++ *:FreeBSD:*:*) ++ case ${UNAME_MACHINE} in ++ pc98) ++ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ amd64) ++ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ *) ++ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; ++ esac ++ exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin +- exit 0 ;; +- i*:MINGW*:*) ++ exit ;; ++ *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 +- exit 0 ;; ++ exit ;; ++ i*:windows32*:*) ++ # uname -m includes "-pc" on this system. ++ echo ${UNAME_MACHINE}-mingw32 ++ exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 +- exit 0 ;; +- x86:Interix*:[34]*) +- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' +- exit 0 ;; ++ exit ;; ++ *:Interix*:*) ++ case ${UNAME_MACHINE} in ++ x86) ++ echo i586-pc-interix${UNAME_RELEASE} ++ exit ;; ++ authenticamd | genuineintel | EM64T) ++ echo x86_64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ IA64) ++ echo ia64-unknown-interix${UNAME_RELEASE} ++ exit ;; ++ esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks +- exit 0 ;; ++ exit ;; ++ 8664:Windows_NT:*) ++ echo x86_64-pc-mks ++ exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix +- exit 0 ;; ++ exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin +- exit 0 ;; ++ exit ;; ++ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) ++ echo x86_64-unknown-cygwin ++ exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin +- exit 0 ;; ++ exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` +- exit 0 ;; ++ exit ;; + *:GNU:*:*) ++ # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` +- exit 0 ;; ++ exit ;; ++ *:GNU/*:*:*) ++ # other systems with GNU libc and userland ++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu ++ exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix +- exit 0 ;; ++ exit ;; ++ alpha:Linux:*:*) ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ EV5) UNAME_MACHINE=alphaev5 ;; ++ EV56) UNAME_MACHINE=alphaev56 ;; ++ PCA56) UNAME_MACHINE=alphapca56 ;; ++ PCA57) UNAME_MACHINE=alphapca56 ;; ++ EV6) UNAME_MACHINE=alphaev6 ;; ++ EV67) UNAME_MACHINE=alphaev67 ;; ++ EV68*) UNAME_MACHINE=alphaev68 ;; ++ esac ++ objdump --private-headers /bin/sh | grep -q ld.so.1 ++ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ++ exit ;; + arm*:Linux:*:*) ++ eval $set_cc_for_build ++ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_EABI__ ++ then ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ else ++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ fi ++ exit ;; ++ avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu +- exit 0 ;; +- ia64:Linux:*:*) +- echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu +- exit 0 ;; +- m68*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; +- mips:Linux:*:*) ++ exit ;; ++ crisv32:Linux:*:*) ++ echo crisv32-axis-linux-gnu ++ exit ;; ++ frv:Linux:*:*) ++ echo frv-unknown-linux-gnu ++ exit ;; ++ i*86:Linux:*:*) ++ LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +- #undef CPU +- #undef mips +- #undef mipsel +- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mipsel +- #else +- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips +- #else +- CPU= +- #endif ++ #ifdef __dietlibc__ ++ LIBC=dietlibc + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 +- ;; +- mips64:Linux:*:*) ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ++ echo "${UNAME_MACHINE}-pc-linux-${LIBC}" ++ exit ;; ++ ia64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ m32r*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ m68*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; ++ mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU +- #undef mips64 +- #undef mips64el ++ #undef ${UNAME_MACHINE} ++ #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=mips64el ++ CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=mips64 ++ CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` +- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; +- ppc:Linux:*:*) +- echo powerpc-${VENDOR:-unknown}-linux-gnu +- exit 0 ;; +- ppc64:Linux:*:*) +- echo powerpc64-${VENDOR:-unknown}-linux-gnu +- exit 0 ;; +- alpha:Linux:*:*) +- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +- EV5) UNAME_MACHINE=alphaev5 ;; +- EV56) UNAME_MACHINE=alphaev56 ;; +- PCA56) UNAME_MACHINE=alphapca56 ;; +- PCA57) UNAME_MACHINE=alphapca56 ;; +- EV6) UNAME_MACHINE=alphaev6 ;; +- EV67) UNAME_MACHINE=alphaev67 ;; +- EV68*) UNAME_MACHINE=alphaev68 ;; +- esac +- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null +- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi +- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} +- exit 0 ;; ++ or32:Linux:*:*) ++ echo or32-unknown-linux-gnu ++ exit ;; ++ padre:Linux:*:*) ++ echo sparc-unknown-linux-gnu ++ exit ;; ++ parisc64:Linux:*:* | hppa64:Linux:*:*) ++ echo hppa64-unknown-linux-gnu ++ exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +@@ -885,84 +949,40 @@ + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac +- exit 0 ;; +- parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ ppc64:Linux:*:*) ++ echo powerpc64-unknown-linux-gnu ++ exit ;; ++ ppc:Linux:*:*) ++ echo powerpc-unknown-linux-gnu ++ exit ;; + s390:Linux:*:* | s390x:Linux:*:*) +- echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu +- exit 0 ;; ++ echo ${UNAME_MACHINE}-ibm-linux ++ exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu +- exit 0 ;; ++ exit ;; ++ vax:Linux:*:*) ++ echo ${UNAME_MACHINE}-dec-linux-gnu ++ exit ;; + x86_64:Linux:*:*) +- echo x86_64-${VENDOR:-unknown}-linux-gnu +- exit 0 ;; +- i*86:Linux:*:*) +- # The BFD linker knows what the default object file format is, so +- # first see if it will tell us. cd to the root directory to prevent +- # problems with other programs or directories called `ld' in the path. +- # Set LC_ALL=C to ensure ld outputs messages in English. +- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ +- | sed -ne '/supported targets:/!d +- s/[ ][ ]*/ /g +- s/.*supported targets: *// +- s/ .*// +- p'` +- case "$ld_supported_targets" in +- elf32-i386) +- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" +- ;; +- a.out-i386-linux) +- echo "${UNAME_MACHINE}-pc-linux-gnuaout" +- exit 0 ;; +- coff-i386) +- echo "${UNAME_MACHINE}-pc-linux-gnucoff" +- exit 0 ;; +- "") +- # Either a pre-BFD a.out linker (linux-gnuoldld) or +- # one that does not give us useful --help. +- echo "${UNAME_MACHINE}-pc-linux-gnuoldld" +- exit 0 ;; +- esac +- # Determine whether the default compiler is a.out or elf +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #include <features.h> +- #ifdef __ELF__ +- # ifdef __GLIBC__ +- # if __GLIBC__ >= 2 +- LIBC=gnu +- # else +- LIBC=gnulibc1 +- # endif +- # else +- LIBC=gnulibc1 +- # endif +- #else +- #ifdef __INTEL_COMPILER +- LIBC=gnu +- #else +- LIBC=gnuaout +- #endif +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` +- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 +- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 +- ;; ++ echo x86_64-unknown-linux-gnu ++ exit ;; ++ xtensa*:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 +- exit 0 ;; ++ exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... +@@ -970,24 +990,27 @@ + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} +- exit 0 ;; ++ exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx +- exit 0 ;; ++ exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop +- exit 0 ;; ++ exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos +- exit 0 ;; +- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) ++ exit ;; ++ i*86:syllable:*:*) ++ echo ${UNAME_MACHINE}-pc-syllable ++ exit ;; ++ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp +- exit 0 ;; ++ exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then +@@ -995,15 +1018,16 @@ + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi +- exit 0 ;; +- i*86:*:5:[78]*) ++ exit ;; ++ i*86:*:5:[678]*) ++ # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} +- exit 0 ;; ++ exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` +@@ -1021,73 +1045,86 @@ + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi +- exit 0 ;; ++ exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about +- # the processor, so we play safe by assuming i386. +- echo i386-pc-msdosdjgpp +- exit 0 ;; ++ # the processor, so we play safe by assuming i586. ++ # Note: whatever this is, it MUST be the same as what config.sub ++ # prints for the "djgpp" host, or else GDB configury will decide that ++ # this is a cross-build. ++ echo i586-pc-msdosdjgpp ++ exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 +- exit 0 ;; ++ exit ;; + paragon:*:*:*) + echo i860-intel-osf1 +- exit 0 ;; ++ exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi +- exit 0 ;; ++ exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv +- exit 0 ;; ++ exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv +- exit 0 ;; ++ exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix +- exit 0 ;; +- M68*:*:R3V[567]*:*) +- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; +- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) ++ exit ;; ++ M68*:*:R3V[5678]*:*) ++ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; ++ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && echo i486-ncr-sysv4.3${OS_REL} && exit 0 ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ +- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && echo i486-ncr-sysv4 && exit 0 ;; ++ && { echo i486-ncr-sysv4; exit; } ;; ++ NCR*:*:4.2:* | MPRAS*:*:4.2:*) ++ OS_REL='.3' ++ test -r /etc/.relid \ ++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` ++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ ++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ ++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 +- exit 0 ;; ++ exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; +- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) ++ exit ;; ++ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 +- exit 0 ;; ++ exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 +- exit 0 ;; ++ exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` +@@ -1095,68 +1132,94 @@ + else + echo ns32k-sni-sysv + fi +- exit 0 ;; ++ exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 +- exit 0 ;; ++ exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 +- exit 0 ;; ++ exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 +- exit 0 ;; ++ exit ;; ++ i*86:VOS:*:*) ++ # From Paul.Green@stratus.com. ++ echo ${UNAME_MACHINE}-stratus-vos ++ exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos +- exit 0 ;; ++ exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 +- exit 0 ;; ++ exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi +- exit 0 ;; ++ exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos +- exit 0 ;; ++ exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos +- exit 0 ;; ++ exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos +- exit 0 ;; ++ exit ;; ++ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. ++ echo i586-pc-haiku ++ exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ SX-7:SUPER-UX:*:*) ++ echo sx7-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8:SUPER-UX:*:*) ++ echo sx8-nec-superux${UNAME_RELEASE} ++ exit ;; ++ SX-8R:SUPER-UX:*:*) ++ echo sx8r-nec-superux${UNAME_RELEASE} ++ exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Darwin:*:*) +- case `uname -p` in +- *86) UNAME_PROCESSOR=i686 ;; +- powerpc) UNAME_PROCESSOR=powerpc ;; ++ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown ++ case $UNAME_PROCESSOR in ++ i386) ++ eval $set_cc_for_build ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ UNAME_PROCESSOR="x86_64" ++ fi ++ fi ;; ++ unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then +@@ -1164,22 +1227,25 @@ + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:QNX:*:4*) + echo i386-pc-qnx +- exit 0 ;; +- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) ++ exit ;; ++ NSE-?:NONSTOP_KERNEL:*:*) ++ echo nse-tandem-nsk${UNAME_RELEASE} ++ exit ;; ++ NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux +- exit 0 ;; ++ exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv +- exit 0 ;; ++ exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 +@@ -1190,28 +1256,50 @@ + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 +- exit 0 ;; ++ exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 +- exit 0 ;; ++ exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex +- exit 0 ;; ++ exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 +- exit 0 ;; ++ exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 +- exit 0 ;; ++ exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 +- exit 0 ;; ++ exit ;; + *:ITS:*:*) + echo pdp10-unknown-its +- exit 0 ;; ++ exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} +- exit 0 ;; ++ exit ;; ++ *:DragonFly:*:*) ++ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ++ exit ;; ++ *:*VMS:*:*) ++ UNAME_MACHINE=`(uname -p) 2>/dev/null` ++ case "${UNAME_MACHINE}" in ++ A*) echo alpha-dec-vms ; exit ;; ++ I*) echo ia64-dec-vms ; exit ;; ++ V*) echo vax-dec-vms ; exit ;; ++ esac ;; ++ *:XENIX:*:SysV) ++ echo i386-pc-xenix ++ exit ;; ++ i*86:skyos:*:*) ++ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' ++ exit ;; ++ i*86:rdos:*:*) ++ echo ${UNAME_MACHINE}-pc-rdos ++ exit ;; ++ i*86:AROS:*:*) ++ echo ${UNAME_MACHINE}-pc-aros ++ exit ;; + esac + + #echo '(No uname command or uname output not recognized.)' 1>&2 +@@ -1243,7 +1331,7 @@ + #endif + + #if defined (__arm) && defined (__acorn) && defined (__unix) +- printf ("arm-acorn-riscix"); exit (0); ++ printf ("arm-acorn-riscix\n"); exit (0); + #endif + + #if defined (hp300) && !defined (hpux) +@@ -1332,11 +1420,12 @@ + } + EOF + +-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 ++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } + + # Apollos put the system type in the environment. + +-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } ++test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + + # Convex versions that predate uname can use getsysinfo(1) + +@@ -1345,22 +1434,22 @@ + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd +- exit 0 ;; ++ exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi +- exit 0 ;; ++ exit ;; + c34*) + echo c34-convex-bsd +- exit 0 ;; ++ exit ;; + c38*) + echo c38-convex-bsd +- exit 0 ;; ++ exit ;; + c4*) + echo c4-convex-bsd +- exit 0 ;; ++ exit ;; + esac + fi + +@@ -1371,7 +1460,9 @@ + the operating system you are using. It is advised that you + download the most up to date version of the config scripts from + +- ftp://ftp.gnu.org/pub/gnu/config/ ++ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD ++and ++ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + + If the version you run ($0) is already up to date, please + send the following data and any information you think might be +--- misc/xmlsec1-1.2.12/config.sub 2010-04-15 09:29:35.000000000 +0000 ++++ misc/build/xmlsec1-1.2.12/config.sub 2010-04-15 09:29:46.000000000 +0000 +@@ -1,9 +1,10 @@ + #! /bin/sh + # Configuration validation subroutine script. + # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 ++# Free Software Foundation, Inc. + +-timestamp='2003-06-18' ++timestamp='2010-01-22' + + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software +@@ -21,22 +22,26 @@ + # + # 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. +- ++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA ++# 02110-1301, USA. ++# + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + ++ + # Please send patches to <config-patches@gnu.org>. Submit a context +-# diff and a properly formatted ChangeLog entry. ++# diff and a properly formatted GNU ChangeLog entry. + # + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. + # Otherwise, we print the canonical config type on stdout and succeed. + ++# You can get the latest version of this script from: ++# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD ++ + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases + # that are meaningful with *any* GNU software. +@@ -70,8 +75,9 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ++2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free ++Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -83,11 +89,11 @@ + while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) +- echo "$timestamp" ; exit 0 ;; ++ echo "$timestamp" ; exit ;; + --version | -v ) +- echo "$version" ; exit 0 ;; ++ echo "$version" ; exit ;; + --help | --h* | -h ) +- echo "$usage"; exit 0 ;; ++ echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. +@@ -99,7 +105,7 @@ + *local*) + # First pass through any local machine types. + echo $1 +- exit 0;; ++ exit ;; + + * ) + break ;; +@@ -118,7 +124,10 @@ + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) ++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ ++ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ ++ kopensolaris*-gnu* | \ ++ storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -144,10 +153,13 @@ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis) ++ -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; ++ -bluegene*) ++ os=-cnk ++ ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 +@@ -169,6 +181,10 @@ + -hiux*) + os=-hiuxwe2 + ;; ++ -sco6) ++ os=-sco5v6 ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +@@ -185,6 +201,10 @@ + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; ++ -sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ++ ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +@@ -228,54 +248,71 @@ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ ++ | am33_2.0 \ ++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ ++ | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ +- | fr30 | frv \ ++ | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ +- | ip2k \ +- | m32r | m68000 | m68k | m88k | mcore \ ++ | ip2k | iq2000 \ ++ | lm32 \ ++ | m32c | m32r | m32rle | m68000 | m68k | m88k \ ++ | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ +- | mips64vr | mips64vrel \ ++ | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ ++ | mips64r5900 | mips64r5900el \ ++ | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ ++ | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ ++ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ ++ | moxie \ ++ | mt \ + | msp430 \ ++ | nios | nios2 \ + | ns16k | ns32k \ +- | openrisc | or32 \ ++ | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ +- | s390 | s390x \ +- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ ++ | rx \ ++ | score \ ++ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ +- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ +- | strongarm \ ++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ ++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ ++ | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ ++ | ubicom32 \ + | v850 | v850e \ + | we32k \ +- | x86 | xscale | xstormy16 | xtensa \ +- | z8k) ++ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ ++ | z8k | z80) + basic_machine=$basic_machine-unknown + ;; +- m6811 | m68hc11 | m6812 | m68hc12) ++ m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; ++ ms1) ++ basic_machine=mt-unknown ++ ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and +@@ -295,55 +332,69 @@ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* \ +- | bs2000-* \ ++ | avr-* | avr32-* \ ++ | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ +- | clipper-* | cydra-* \ ++ | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ +- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ ++ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ +- | ip2k-* \ +- | m32r-* \ ++ | ip2k-* | iq2000-* \ ++ | lm32-* \ ++ | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | mcore-* \ ++ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ +- | mips64vr-* | mips64vrel-* \ ++ | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ ++ | mips64r5900-* | mips64r5900el-* \ ++ | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ ++ | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ ++ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ ++ | mmix-* \ ++ | mt-* \ + | msp430-* \ +- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ ++ | nios-* | nios2-* \ ++ | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ +- | romp-* | rs6000-* \ +- | s390-* | s390x-* \ +- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ ++ | romp-* | rs6000-* | rx-* \ ++ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ +- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ ++ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ ++ | sparclite-* \ ++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ ++ | tile-* | tilegx-* \ + | tron-* \ ++ | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ +- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ +- | xtensa-* \ ++ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ ++ | xstormy16-* | xtensa*-* \ + | ymp-* \ +- | z8k-*) ++ | z8k-* | z80-*) ++ ;; ++ # Recognize the basic CPU types without company name, with glob match. ++ xtensa*) ++ basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. +@@ -361,6 +412,9 @@ + basic_machine=a29k-amd + os=-udi + ;; ++ abacus) ++ basic_machine=abacus-unknown ++ ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout +@@ -378,6 +432,9 @@ + amd64) + basic_machine=x86_64-pc + ;; ++ amd64-*) ++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + amdahl) + basic_machine=580-amdahl + os=-sysv +@@ -401,6 +458,10 @@ + basic_machine=m68k-apollo + os=-bsd + ;; ++ aros) ++ basic_machine=i386-pc ++ os=-aros ++ ;; + aux) + basic_machine=m68k-apple + os=-aux +@@ -409,10 +470,26 @@ + basic_machine=ns32k-sequent + os=-dynix + ;; ++ blackfin) ++ basic_machine=bfin-unknown ++ os=-linux ++ ;; ++ blackfin-*) ++ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; ++ bluegene*) ++ basic_machine=powerpc-ibm ++ os=-cnk ++ ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; ++ cegcc) ++ basic_machine=arm-unknown ++ os=-cegcc ++ ;; + convex-c1) + basic_machine=c1-convex + os=-bsd +@@ -437,12 +514,27 @@ + basic_machine=j90-cray + os=-unicos + ;; ++ craynv) ++ basic_machine=craynv-cray ++ os=-unicosmp ++ ;; ++ cr16) ++ basic_machine=cr16-unknown ++ os=-elf ++ ;; + crds | unos) + basic_machine=m68k-crds + ;; ++ crisv32 | crisv32-* | etraxfs*) ++ basic_machine=crisv32-axis ++ ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; ++ crx) ++ basic_machine=crx-unknown ++ os=-elf ++ ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; +@@ -465,6 +557,14 @@ + basic_machine=m88k-motorola + os=-sysv3 + ;; ++ dicos) ++ basic_machine=i686-pc ++ os=-dicos ++ ;; ++ djgpp) ++ basic_machine=i586-pc ++ os=-msdosdjgpp ++ ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx +@@ -615,6 +715,14 @@ + basic_machine=m68k-isi + os=-sysv + ;; ++ m68knommu) ++ basic_machine=m68k-unknown ++ os=-linux ++ ;; ++ m68knommu-*) ++ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; + m88k-omron*) + basic_machine=m88k-omron + ;; +@@ -626,10 +734,17 @@ + basic_machine=ns32k-utek + os=-sysv + ;; ++ microblaze) ++ basic_machine=microblaze-xilinx ++ ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; ++ mingw32ce) ++ basic_machine=arm-unknown ++ os=-mingw32ce ++ ;; + miniframe) + basic_machine=m68000-convergent + ;; +@@ -643,10 +758,6 @@ + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; +- mmix*) +- basic_machine=mmix-knuth +- os=-mmixware +- ;; + monitor) + basic_machine=m68k-rom68k + os=-coff +@@ -659,6 +770,9 @@ + basic_machine=i386-pc + os=-msdos + ;; ++ ms1-*) ++ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ++ ;; + mvs) + basic_machine=i370-ibm + os=-mvs +@@ -727,10 +841,6 @@ + np1) + basic_machine=np1-gould + ;; +- nv1) +- basic_machine=nv1-cray +- os=-unicosmp +- ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; +@@ -738,9 +848,12 @@ + basic_machine=hppa1.1-oki + os=-proelf + ;; +- or32 | or32-*) ++ openrisc | openrisc-*) + basic_machine=or32-unknown +- os=-coff ++ ;; ++ os400) ++ basic_machine=powerpc-ibm ++ os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson +@@ -758,6 +871,14 @@ + basic_machine=i860-intel + os=-osf + ;; ++ parisc) ++ basic_machine=hppa-unknown ++ os=-linux ++ ;; ++ parisc-*) ++ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` ++ os=-linux ++ ;; + pbd) + basic_machine=sparc-tti + ;; +@@ -767,6 +888,12 @@ + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; ++ pc98) ++ basic_machine=i386-pc ++ ;; ++ pc98-*) ++ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; +@@ -823,6 +950,10 @@ + basic_machine=i586-unknown + os=-pw32 + ;; ++ rdos) ++ basic_machine=i386-pc ++ os=-rdos ++ ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff +@@ -833,6 +964,12 @@ + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; ++ s390 | s390-*) ++ basic_machine=s390-ibm ++ ;; ++ s390x | s390x-*) ++ basic_machine=s390x-ibm ++ ;; + sa29200) + basic_machine=a29k-amd + os=-udi +@@ -843,6 +980,10 @@ + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; ++ sde) ++ basic_machine=mipsisa32-sde ++ os=-elf ++ ;; + sei) + basic_machine=mips-sei + os=-seiux +@@ -854,6 +995,9 @@ + basic_machine=sh-hitachi + os=-hms + ;; ++ sh5el) ++ basic_machine=sh5le-unknown ++ ;; + sh64) + basic_machine=sh64-unknown + ;; +@@ -943,6 +1087,15 @@ + basic_machine=tic6x-unknown + os=-coff + ;; ++ # This must be matched before tile*. ++ tilegx*) ++ basic_machine=tilegx-unknown ++ os=-linux-gnu ++ ;; ++ tile*) ++ basic_machine=tile-unknown ++ os=-linux-gnu ++ ;; + tx39) + basic_machine=mipstx39-unknown + ;; +@@ -956,6 +1109,10 @@ + tower | tower-32) + basic_machine=m68k-ncr + ;; ++ tpf) ++ basic_machine=s390x-ibm ++ os=-tpf ++ ;; + udi29k) + basic_machine=a29k-amd + os=-udi +@@ -999,6 +1156,10 @@ + basic_machine=hppa1.1-winbond + os=-proelf + ;; ++ xbox) ++ basic_machine=i686-pc ++ os=-mingw32 ++ ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; +@@ -1010,6 +1171,10 @@ + basic_machine=z8k-unknown + os=-sim + ;; ++ z80-*-coff) ++ basic_machine=z80-unknown ++ os=-sim ++ ;; + none) + basic_machine=none-none + os=-none +@@ -1029,6 +1194,9 @@ + romp) + basic_machine=romp-ibm + ;; ++ mmix) ++ basic_machine=mmix-knuth ++ ;; + rs6000) + basic_machine=rs6000-ibm + ;; +@@ -1045,13 +1213,10 @@ + we32k) + basic_machine=we32k-att + ;; +- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) ++ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; +- sh64) +- basic_machine=sh64-unknown +- ;; +- sparc | sparcv9 | sparcv9b) ++ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) +@@ -1098,6 +1263,9 @@ + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. ++ -auroraux) ++ os=-auroraux ++ ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; +@@ -1118,25 +1286,30 @@ + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ +- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ +- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ ++ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ ++ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ ++ | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ +- | -aos* \ ++ | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ +- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ +- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ ++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ ++ | -openbsd* | -solidbsd* \ ++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ ++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ +- | -chorusos* | -chorusrdb* \ ++ | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ +- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ ++ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ ++ | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ +- | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) ++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ ++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) +@@ -1154,12 +1327,15 @@ + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ +- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ ++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; ++ -linux-dietlibc) ++ os=-linux-dietlibc ++ ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; +@@ -1172,6 +1348,9 @@ + -opened*) + os=-openedition + ;; ++ -os400*) ++ os=-os400 ++ ;; + -wince*) + os=-wince + ;; +@@ -1193,6 +1372,9 @@ + -atheos*) + os=-atheos + ;; ++ -syllable*) ++ os=-syllable ++ ;; + -386bsd) + os=-bsd + ;; +@@ -1215,6 +1397,9 @@ + -sinix*) + os=-sysv4 + ;; ++ -tpf*) ++ os=-tpf ++ ;; + -triton*) + os=-sysv3 + ;; +@@ -1251,6 +1436,14 @@ + -kaos*) + os=-kaos + ;; ++ -zvmoe) ++ os=-zvmoe ++ ;; ++ -dicos*) ++ os=-dicos ++ ;; ++ -nacl*) ++ ;; + -none) + ;; + *) +@@ -1273,6 +1466,12 @@ + # system, and we'll never get to this point. + + case $basic_machine in ++ score-*) ++ os=-elf ++ ;; ++ spu-*) ++ os=-elf ++ ;; + *-acorn) + os=-riscix1.2 + ;; +@@ -1282,8 +1481,8 @@ + arm*-semi) + os=-aout + ;; +- c4x-* | tic4x-*) +- os=-coff ++ c4x-* | tic4x-*) ++ os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) +@@ -1310,6 +1509,9 @@ + m68*-cisco) + os=-aout + ;; ++ mep-*) ++ os=-elf ++ ;; + mips*-cisco) + os=-elf + ;; +@@ -1328,9 +1530,15 @@ + *-be) + os=-beos + ;; ++ *-haiku) ++ os=-haiku ++ ;; + *-ibm) + os=-aix + ;; ++ *-knuth) ++ os=-mmixware ++ ;; + *-wec) + os=-proelf + ;; +@@ -1433,7 +1641,7 @@ + -sunos*) + vendor=sun + ;; +- -aix*) ++ -cnk*|-aix*) + vendor=ibm + ;; + -beos*) +@@ -1463,9 +1671,15 @@ + -mvs* | -opened*) + vendor=ibm + ;; ++ -os400*) ++ vendor=ibm ++ ;; + -ptx*) + vendor=sequent + ;; ++ -tpf*) ++ vendor=ibm ++ ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; +@@ -1490,7 +1704,7 @@ + esac + + echo $basic_machine$os +-exit 0 ++exit + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) diff --git a/lpsolve/download/lp_solve_5.5.tar.gz b/lpsolve/download/lp_solve_5.5.tar.gz Binary files differdeleted file mode 100644 index 77159af..0000000 --- a/lpsolve/download/lp_solve_5.5.tar.gz +++ /dev/null diff --git a/lpsolve/lp_solve_5.5-windows.patch b/lpsolve/lp_solve_5.5-windows.patch index 48acb6c..aae56fc 100644 --- a/lpsolve/lp_solve_5.5-windows.patch +++ b/lpsolve/lp_solve_5.5-windows.patch @@ -1,5 +1,5 @@ *** misc/lp_solve_5.5/lpsolve55/cgcc.bat Sun Jun 12 04:27:28 2005 ---- misc/build/lp_solve_5.5/lpsolve55/cgcc.bat Sun Feb 10 07:55:19 2008 +--- misc/build/lp_solve_5.5/lpsolve55/cgcc.bat Sun Dec 14 07:55:19 2008 *************** *** 7,14 **** @@ -15,7 +15,7 @@ set c=gcc ! windres lpsolve.rc lpsolve_res.obj -! %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -mno-cygwin -enable-stdcall-fixup -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve_res.obj ..\lp_solve.def -o lpsolve55.dll +! %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -mno-cygwin -enable-stdcall-fixup -mthreads %lpsolve_LDFLAGS% -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve_res.obj ..\lp_solve.def %lpsolve_LIBS% -o lpsolve55.dll %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o liblpsolve55.so diff --git a/lpsolve/lp_solve_5.5.patch b/lpsolve/lp_solve_5.5.patch index fc446a4..c6c7806 100644 --- a/lpsolve/lp_solve_5.5.patch +++ b/lpsolve/lp_solve_5.5.patch @@ -26,7 +26,10 @@ +rm *.o 2>/dev/null --- misc/lp_solve_5.5/lpsolve55/ccc.osx Thu Jun 23 22:53:08 2005 +++ misc/build/lp_solve_5.5/lpsolve55/ccc.osx Wed May 21 17:19:56 2008 -@@ -3,6 +3,10 @@ +@@ -1,8 +1,12 @@ + src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' +-c=cc ++c=$CC def= so= diff --git a/lpsolve/makefile.mk b/lpsolve/makefile.mk index a69d549..3e66303 100644 --- a/lpsolve/makefile.mk +++ b/lpsolve/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -41,6 +37,7 @@ TARGET=lpsolve # --- Files -------------------------------------------------------- TARFILE_NAME=lp_solve_5.5 +TARFILE_MD5=26b3e95ddf3d9c077c480ea45874b3b8 .IF "$(GUI)"=="WNT" PATCH_FILES=lp_solve_5.5-windows.patch @@ -56,7 +53,13 @@ CONFIGURE_FLAGS= BUILD_DIR=lpsolve55 .IF "$(GUI)"=="WNT" .IF "$(COM)"=="GCC" -BUILD_ACTION=cmd /c cgcc.bat +.IF "$(MINGW_SHARED_GCCLIB)"=="YES" +lpsolve_LDFLAGS=-shared-libgcc +.ENDIF +.IF "$(MINGW_SHARED_GXXLIB)"=="YES" +lpsolve_LIBS=-lstdc++_s +.ENDIF +BUILD_ACTION=lpsolve_LDFLAGS=$(lpsolve_LDFLAGS) lpsolve_LIBS=$(lpsolve_LIBS) cmd /c cgcc.bat .ELSE BUILD_ACTION=cmd /c cvc6.bat OUT2LIB=$(BUILD_DIR)$/lpsolve55.lib @@ -67,6 +70,7 @@ BUILD_ACTION=sh ccc.os2 OUT2LIB=$(BUILD_DIR)$/liblpsolve55.lib .ELSE .IF "$(OS)"=="MACOSX" +.EXPORT: EXTRA_CDEFS EXTRA_LINKFLAGS BUILD_ACTION=sh ccc.osx OUT2LIB=$(BUILD_DIR)$/liblpsolve55.dylib .ELSE diff --git a/lpsolve/prj/build.lst b/lpsolve/prj/build.lst index 516f37a..68b61bf 100644 --- a/lpsolve/prj/build.lst +++ b/lpsolve/prj/build.lst @@ -1,3 +1,3 @@ -lps lpsolve : sal NULL +lps lpsolve : solenv NULL lps lpsolve usr1 - all lps_mkout NULL lps lpsolve nmake - all lps_lpsolve NULL diff --git a/lucene/download/lucene-2.3.2.tar.gz b/lucene/download/lucene-2.3.2.tar.gz Binary files differdeleted file mode 100644 index c5bd9a0..0000000 --- a/lucene/download/lucene-2.3.2.tar.gz +++ /dev/null diff --git a/lucene/makefile.mk b/lucene/makefile.mk index 2d87f23..3ce8f05 100644 --- a/lucene/makefile.mk +++ b/lucene/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3.2.2 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -53,6 +49,7 @@ LUCENE_CORE_JAR=lucene-core-$(LUCENE_MAJOR).$(LUCENE_MINOR).jar LUCENE_ANALYZERS_JAR=lucene-analyzers-$(LUCENE_MAJOR).$(LUCENE_MINOR).jar TARFILE_NAME=$(LUCENE_NAME) +TARFILE_MD5=48d8169acc35f97e05d8dcdfd45be7f2 PATCH_FILES=lucene.patch BUILD_DIR=. diff --git a/lucene/version.mk b/lucene/version.mk index dd81ce1..fe9f60b 100644 --- a/lucene/version.mk +++ b/lucene/version.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: version.mk,v $ -# -# $Revision: 1.2 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/msfontextract/makefile.mk b/mdds/makefile.mk index bdd1398..ea89676 100644 --- a/msfontextract/makefile.mk +++ b/mdds/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -31,10 +27,8 @@ PRJ=. -PRJNAME=msfontextract -TARGET=libmspack -NO_DEFAULT_STL=TRUE -LIBSALCPPRT= +PRJNAME=mdds +TARGET=mdds # --- Settings ----------------------------------------------------- @@ -42,24 +36,31 @@ LIBSALCPPRT= # --- Files -------------------------------------------------------- -.IF "$(WITH_FONTOOO)" != "YES" -@all: - @echo "FontOOo disabled... Nothing to build here." -.ENDIF - -TARFILE_NAME=libmspack -PATCH_FILES=msfontextract.patch +TARFILE_NAME=mdds_0.3.0 +TARFILE_MD5=cf8a6967f7de535ae257fa411c98eb88 +PATCH_FILES= -ADDITIONAL_FILES=mspack$/makefile.mk mspack$/msfontextract.c mspack$/ministub.c +CONFIGURE_DIR= +CONFIGURE_ACTION= -CONFIGURE_ACTION=none -CONFIGURE_FLAGS= - -BUILD_DIR=mspack +BUILD_DIR= +BUILD_ACTION= BUILD_FLAGS= -BUILD_ACTION=dmake subdmak=true $(MFLAGS) $(MAKEFILE) $(CALLMACROS) -.INCLUDE : set_ext.mk +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk .INCLUDE : target.mk .INCLUDE : tg_ext.mk +# --- post-build --------------------------------------------------- + +NORMALIZE_FLAG_FILE=so_normalized_$(TARGET) + +$(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) : $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) + -@$(MKDIRHIER) $(INCCOM) + @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(TARFILE_NAME)$/inc$/mdds $(INCCOM) + @$(TOUCH) $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) + +$(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) : $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) + diff --git a/mdds/prj/build.lst b/mdds/prj/build.lst new file mode 100644 index 0000000..da7d095 --- /dev/null +++ b/mdds/prj/build.lst @@ -0,0 +1,3 @@ +mdd mdds : solenv BOOST:boost NULL +mdd mdds usr1 - all mdd_mkout NULL +mdd mdds nmake - all mdd_mdds NULL diff --git a/mdds/prj/d.lst b/mdds/prj/d.lst new file mode 100644 index 0000000..65cafee --- /dev/null +++ b/mdds/prj/d.lst @@ -0,0 +1,5 @@ +mkdir: %_DEST%\inc%_EXT%\mdds + +..\%__SRC%\inc\mdds\* %_DEST%\inc%_EXT%\mdds + + diff --git a/msfontextract/download/libmspack.tar.gz b/msfontextract/download/libmspack.tar.gz Binary files differdeleted file mode 100644 index 7b6e4d6..0000000 --- a/msfontextract/download/libmspack.tar.gz +++ /dev/null diff --git a/msfontextract/msfontextract.patch b/msfontextract/msfontextract.patch deleted file mode 100644 index 7532a06..0000000 --- a/msfontextract/msfontextract.patch +++ /dev/null @@ -1,261 +0,0 @@ ---- misc/libmspack/mspack/makefile.mk Mon Mar 31 11:34:58 2008 -+++ misc/build/libmspack/mspack/makefile.mk Mon Mar 31 11:34:31 2008 -@@ -1 +1,82 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile: msfontextract.patch,v $ -+# -+# $Revision: 1.9 $ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+PRJ=..$/..$/..$/..$/..$/ -+ -+PRJNAME=msfontextract -+TARGET=msfontextract -+TARGETTYPE=CUI -+LIBTARGET=NO -+NO_DEFAULT_STL=TRUE -+LIBSALCPPRT= -+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE -+ -+# --- Settings ----------------------------------------------------- -+ -+ -+.INCLUDE : settings.mk -+ -+# --- Files -------------------------------------------------------- -+ -+CCFILES= \ -+ msfontextract.c -+ -+.IF "$(SYSTEM_MSPACK)" != "YES" -+CCFILES+= \ -+ system.c \ -+ cabd.c \ -+ lzxd.c \ -+ ministub .c -+.ENDIF -+ -+OBJFILES= \ -+ $(OBJ)$/msfontextract.obj -+ -+.IF "$(SYSTEM_MSPACK)" != "YES" -+OBJFILES += \ -+ $(OBJ)$/system.obj \ -+ $(OBJ)$/cabd.obj \ -+ $(OBJ)$/lzxd.obj \ -+ $(OBJ)$/ministub.obj -+.ENDIF -+ -+APP1TARGET= $(TARGET) -+APP1OBJS= $(OBJFILES) -+ -+APP1STDLIBS= -+ -+.IF "$(SYSTEM_MSPACK)" == "YES" -+APP1STDLIBS+= -lmspack -+.ENDIF -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk ---- misc/libmspack/mspack/ministub.c Mon Mar 31 11:34:58 2008 -+++ misc/build/libmspack/mspack/ministub.c Mon Mar 31 11:34:02 2008 -@@ -1 +1,11 @@ --dummy -+#include <mspack.h> -+ -+/* other expansion types not needed */ -+int mszipd_init() {return MSPACK_ERR_DECRUNCH;} -+int mszipd_decompress() {return MSPACK_ERR_DECRUNCH;} -+void mszipd_free() {} -+ -+int qtmd_init() {return MSPACK_ERR_DECRUNCH;} -+int qtmd_decompress() {return MSPACK_ERR_DECRUNCH;} -+void qtmd_free() {} -+ ---- misc/libmspack/mspack/msfontextract.c Mon Mar 31 11:34:58 2008 -+++ misc/build/libmspack/mspack/msfontextract.c Mon Mar 31 11:34:02 2008 -@@ -1 +1,107 @@ --dummy -+/* -+* Portions (almost all!) (C) 2003 Stuart Caie. -+* you can redistribute it and/or modify it under -+* the terms of the GNU Lesser General Public License (LGPL) version 2.1 -+*/ -+ -+#include <ctype.h> -+#include <stdio.h> -+#include <stdlib.h> -+#include <string.h> -+#include <unistd.h> -+#include <mspack.h> -+ -+char *error_msg(int error) { -+ switch (error) { -+ case MSPACK_ERR_OK: return "no error"; -+ case MSPACK_ERR_ARGS: return "bad arguments to library function"; -+ case MSPACK_ERR_OPEN: return "error opening file"; -+ case MSPACK_ERR_READ: return "read error"; -+ case MSPACK_ERR_WRITE: return "write error"; -+ case MSPACK_ERR_SEEK: return "seek error"; -+ case MSPACK_ERR_NOMEMORY: return "out of memory"; -+ case MSPACK_ERR_SIGNATURE: return "bad signature"; -+ case MSPACK_ERR_DATAFORMAT: return "error in data format"; -+ case MSPACK_ERR_CHECKSUM: return "checksum error"; -+ case MSPACK_ERR_CRUNCH: return "compression error"; -+ case MSPACK_ERR_DECRUNCH: return "decompression error"; -+ } -+ return "unknown error"; -+} -+ -+ -+/* creates name of output file */ -+char *create_output_name(const char *fname, char *dir) { -+ char c, *p, *name; -+ if (!(name = malloc(strlen(fname) + (dir ? strlen(dir) : 0) + 2))) { -+ fprintf(stderr, "out of memory!\n"); -+ return NULL; -+ } -+ /* start with blank name */ -+ *name = '\0'; -+ /* add output directory if needed */ -+ if (dir) { -+ strcpy(name, dir); -+ strcat(name, "/"); -+ } -+ p = &name[strlen(name)]; -+ do { -+ c = *fname++; -+ *p++ = tolower((unsigned char) c); -+ } while (c); -+ -+ return name; -+} -+ -+ -+int -+main(int argc, char** argv) -+{ -+ -+ struct mscab_decompressor *cabd; -+ struct mscabd_cabinet *cab; -+ struct mscabd_file *file; -+ char * ename = NULL; -+ int err; -+ -+ /* argv[1] is the cabinet to extract */ -+ /* argv[2] is the path to extract to */ -+ if ((!(argv[1])) || (!(argv[2]))) { -+ fprintf(stderr,"Usage: %s <cabinet> <destpath>\n",argv[0]); -+ return 1; -+ } -+ -+ /* initialize libmspack and create a CAB decompressor */ -+ MSPACK_SYS_SELFTEST(err); -+ if (err) { -+ fprintf(stderr,"Cannot initialize libmspack\n"); -+ return 1; -+ } -+ if (!(cabd = mspack_create_cab_decompressor(NULL))) { -+ fprintf(stderr, "can't make decompressor: %s\n", -+ error_msg(cabd->last_error(cabd))); -+ return 1; -+ } -+ -+ -+ /* look for an embedded cabinet */ -+ if ((cab = cabd->search(cabd, argv[1]))) { -+ /* for all files in the cabinet */ -+ for (file = cab->files; file; file = file->next) { -+ if (!(ename = create_output_name(file->filename, argv[2]))) continue; -+ if ((cabd->extract(cabd, file, ename))) { -+ fprintf(stderr,"%s: extract error on \"%s\": %s\n",argv[1], -+ ename, error_msg(cabd->last_error(cabd))); -+ exit(1); -+ } -+ free(ename); -+ } -+ cabd->close(cabd, cab); -+ } -+ else { -+ fprintf(stderr, "%s: no embedded cabinet found\n", argv[1] ); -+ } -+ mspack_destroy_cab_decompressor(cabd); -+ return 0; -+} -+ ---- misc/libmspack/mspack/mspack.h Fri Dec 12 18:06:15 2003 -+++ misc/build/libmspack/mspack/mspack.h Mon Mar 31 11:34:02 2008 -@@ -120,6 +120,11 @@ - #include <sys/types.h> - #include <unistd.h> - -+/* MS Compiler defines size_t in stddef.h */ -+#if defined(_MSC_VER) || defined(__MINGW32__) -+#include <stddef.h> -+#endif -+ - /** - * System self-test function, to ensure both library and calling program - * can use one another. ---- misc/libmspack/mspack/system.h Thu Sep 11 16:06:52 2003 -+++ misc/build/libmspack/mspack/system.h Mon Mar 31 11:34:02 2008 -@@ -12,12 +12,16 @@ - - #ifdef DEBUG - # include <stdio.h> --# define D(x) do { printf("%s:%d (%s) ",__FILE__, __LINE__, __FUNCTION__); \ -+# define D(x) do { printf("%s:%d ",__FILE__, __LINE__); \ - printf x ; fputc('\n', stdout); fflush(stdout);} while (0); - #else - # define D(x) - #endif - -+/* Brutal hack to make it compile with MS .NET Compiler that doesn't -+ know what inline means. */ -+#define inline -+ - /* endian-neutral reading of little-endian data */ - #define __egi32(a,n) ( (((a)[n+3]) << 24) | (((a)[n+2]) << 16) | \ - (((a)[n+1]) << 8) | ((a)[n+0]) ) -@@ -39,6 +43,7 @@ - /* validates a system structure */ - extern int mspack_valid_system(struct mspack_system *sys); - -+#if 0 - /* inline memcmp() */ - static inline int memcmp(const void *s1, const void *s2, size_t n) { - unsigned char *c1 = (unsigned char *) s1; -@@ -54,5 +59,6 @@ - while (*e) e++; - return e - s; - } -+#endif - - #endif diff --git a/msfontextract/prj/build.lst b/msfontextract/prj/build.lst deleted file mode 100644 index 7b52864..0000000 --- a/msfontextract/prj/build.lst +++ /dev/null @@ -1,2 +0,0 @@ -mf msfontextract : soltools sal NULL -mf msfontextract nmake - all mf_mkout NULL diff --git a/msfontextract/prj/d.lst b/msfontextract/prj/d.lst deleted file mode 100644 index e312f16..0000000 --- a/msfontextract/prj/d.lst +++ /dev/null @@ -1,4 +0,0 @@ -..\%__SRC%\bin\msfontextract %_DEST%\bin%_EXT%\msfontextract - -..\%__SRC%\bin\msfontextract.exe %_DEST%\bin%_EXT%\msfontextract.exe - diff --git a/apple_remote/makefile2.pmk b/mysqlcppconn/cppconn_config.pmk index cc06558..b787c96 100644 --- a/apple_remote/makefile2.pmk +++ b/mysqlcppconn/cppconn_config.pmk @@ -4,11 +4,7 @@ # # Copyright 2008 by Sun Microsystems, Inc. # -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile2.pmk,v $ -# -# $Revision: 1.1 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -17,7 +13,7 @@ # only, as published by the Free Software Foundation. # # OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License version 3 for more details # (a copy is included in the LICENSE file that accompanied this code). @@ -29,7 +25,9 @@ # #************************************************************************* -.IF "$(GUIBASE)"=="aqua" -OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions -CFLAGSCXX+=$(OBJCXXFLAGS) -.ENDIF # "$(GUIBASE)"=="aqua" +PRJNAME = mysqlcppconn +ENABLE_EXCEPTIONS = TRUE +USE_LDUMP2 = TRUE +EXTERNAL_WARNINGS_NOT_ERRORS = TRUE + +CPPCONN_NATIVEAPI = cppconn_nativeapi diff --git a/mysqlcppconn/makefile.mk b/mysqlcppconn/makefile.mk new file mode 100644 index 0000000..9fe9c64 --- /dev/null +++ b/mysqlcppconn/makefile.mk @@ -0,0 +1,91 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.22 $ +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org 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 Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=mysqlcppconn +TARGET=so_mysqlcppconn + +EXT_PROJECT_NAME=mysql-connector-cpp + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +TARFILE_NAME=$(EXT_PROJECT_NAME) +TARFILE_MD5=831126a1ee5af269923cfab6050769fe +ADDITIONAL_FILES=\ + driver$/makefile.mk \ + driver$/nativeapi$/makefile.mk \ + driver$/nativeapi$/binding_config.h \ + cppconn$/config.h + +CONVERTFILES=\ + cppconn$/build_config.h + +PATCH_FILES=\ + $(TARFILE_NAME).patch \ + patches/default_to_protocol_tcp.patch + +BUILD_DIR=driver +BUILD_ACTION = \ + cd nativeapi \ + && $(MAKE) $(MFLAGS) $(CALLMACROS) \ + && cd .. \ + && $(MAKE) $(MFLAGS) $(CALLMACROS) + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk + +# --- post-build --------------------------------------------------- + +# "normalize" the output structure, in that the C/C++ headers are +# copied to the canonic location in OUTPATH +# The allows, later on, to use the standard mechanisms to deliver those +# files, instead of delivering them out of OUTPATH/misc/build/..., which +# could cause problems + +NORMALIZE_FLAG_FILE=so_normalized_$(TARGET) + +$(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) : $(PACKAGE_DIR)$/$(BUILD_FLAG_FILE) + @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(EXT_PROJECT_NAME)$/driver$/mysql_driver.h $(INCCOM) + -@$(MKDIRHIER) $(INCCOM)$/cppconn + @$(GNUCOPY) -r $(PACKAGE_DIR)$/$(EXT_PROJECT_NAME)$/cppconn$/* $(INCCOM)$/cppconn + @$(TOUCH) $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) + +normalize: $(PACKAGE_DIR)$/$(NORMALIZE_FLAG_FILE) + +$(PACKAGE_DIR)$/$(PREDELIVER_FLAG_FILE) : normalize diff --git a/mysqlcppconn/mysql-connector-cpp.patch b/mysqlcppconn/mysql-connector-cpp.patch new file mode 100644 index 0000000..b710504 --- /dev/null +++ b/mysqlcppconn/mysql-connector-cpp.patch @@ -0,0 +1,385 @@ +--- misc/mysql-connector-cpp/cppconn/build_config.h 2009-08-13 17:13:46.000000000 +0200 ++++ misc/build/mysql-connector-cpp/cppconn/build_config.h 2009-09-11 09:41:41.150391316 +0200 +@@ -1,36 +1,34 @@ +-/* +- Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved. +- +- The MySQL Connector/C++ is licensed under the terms of the GPL +- <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most +- MySQL Connectors. There are special exceptions to the terms and +- conditions of the GPL as it is applied to this software, see the +- FLOSS License Exception +- <http://www.mysql.com/about/legal/licensing/foss-exception.html>. +-*/ +- +-#ifndef _SQL_BUILD_CONFIG_H_ +-#define _SQL_BUILD_CONFIG_H_ +- +-#ifndef CPPCONN_PUBLIC_FUNC +- +-#if defined(_WIN32) +- // mysqlcppconn_EXPORTS is added by cmake and defined for dynamic lib build only +- #ifdef mysqlcppconn_EXPORTS +- #define CPPCONN_PUBLIC_FUNC __declspec(dllexport) +- #else +- // this is for static build +- #ifdef CPPCONN_LIB_BUILD +- #define CPPCONN_PUBLIC_FUNC +- #else +- // this is for clients using dynamic lib +- #define CPPCONN_PUBLIC_FUNC __declspec(dllimport) +- #endif +- #endif +-#else +- #define CPPCONN_PUBLIC_FUNC +-#endif +- +-#endif //#ifndef CPPCONN_PUBLIC_FUNC +- +-#endif //#ifndef _SQL_BUILD_CONFIG_H_ ++/* ++ Copyright 2007 - 2008 MySQL AB, 2008 - 2009 Sun Microsystems, Inc. All rights reserved. ++ ++ The MySQL Connector/C++ is licensed under the terms of the GPL ++ <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most ++ MySQL Connectors. There are special exceptions to the terms and ++ conditions of the GPL as it is applied to this software, see the ++ FLOSS License Exception ++ <http://www.mysql.com/about/legal/licensing/foss-exception.html>. ++*/ ++ ++#ifndef _SQL_BUILD_CONFIG_H_ ++#define _SQL_BUILD_CONFIG_H_ ++ ++#ifndef _SAL_TYPES_H_ ++#include <sal/types.h> ++#endif ++ ++ // mysqlcppconn_EXPORTS is added by cmake and defined for dynamic lib build only ++ #ifdef mysqlcppconn_EXPORTS ++ #define CPPCONN_PUBLIC_FUNC SAL_DLLPUBLIC_EXPORT ++ #else ++ // this is for static build ++ #ifdef CPPCONN_LIB_BUILD ++ #define CPPCONN_PUBLIC_FUNC ++ #else ++ // this is for clients using dynamic lib ++ #define CPPCONN_PUBLIC_FUNC SAL_DLLPUBLIC_IMPORT ++ #endif ++ #endif ++ ++ #define CPPCONN_PUBLIC_EXCEPTION SAL_EXCEPTION_DLLPUBLIC_EXPORT ++ ++#endif //#ifndef _SQL_BUILD_CONFIG_H_ +--- misc/mysql-connector-cpp/cppconn/config.h 2009-08-14 10:17:38.234375000 +0200 ++++ misc/build/mysql-connector-cpp/cppconn/config.h 2009-08-14 09:56:37.000000000 +0200 +@@ -1 +1,34 @@ +-dummy ++#include <sal/types.h> ++ ++#define HAVE_FUNCTION_STRTOL 1 ++#define HAVE_FUNCTION_STRTOUL 1 ++#define HAVE_FUNCTION_STRTOL 1 ++#define HAVE_FUNCTION_STRTOULL 1 ++ ++#if defined(MACOSX) || defined(SOLARIS) || defined(LINUX) ++ #define HAVE_STDINT_H ++ #define HAVE_INTTYPES_H ++#endif ++ ++#ifdef HAVE_STDINT_H ++#include <stdint.h> ++#endif ++ ++#ifdef HAVE_INTTYPES_H ++#include <inttypes.h> ++#endif ++ ++#if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) ++ ++// if we do not have the standard C99 integer types, then define them based on the respective SAL types ++#if !defined(_SYS_TYPES_H) ++typedef sal_Int8 int8_t; ++typedef sal_Int16 int16_t; ++typedef sal_Int32 int32_t; ++#endif // !defined(_SYS_TYPES_H) ++typedef sal_uInt8 uint8_t; ++typedef sal_uInt16 uint16_t; ++typedef sal_uInt32 uint32_t; ++typedef sal_Int64 int64_t; ++typedef sal_uInt64 uint64_t; ++#endif // !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) +--- misc/mysql-connector-cpp/cppconn/connection.h 2009-08-13 17:13:46.000000000 +0200 ++++ misc/build/mysql-connector-cpp/cppconn/connection.h 2009-08-14 09:56:37.000000000 +0200 +@@ -13,7 +13,6 @@ + #define _SQL_CONNECTION_H_ + + #include <map> +-#include <boost/variant.hpp> + + #include "build_config.h" + #include "warning.h" +@@ -22,8 +21,54 @@ + namespace sql + { + +- +-typedef boost::variant<int, double, bool, sql::SQLString > ConnectPropertyVal; ++// hack around the non-existent ::boost::variant in OOo 3.1 build env ++struct ConnectPropertyVal ++{ ++ sql::SQLString valString; ++ int valInt; ++ bool valBool; ++ ++ ConnectPropertyVal() ++ { ++ reset(); ++ } ++ ConnectPropertyVal( const sql::SQLString& _val ) ++ { ++ *this = _val; ++ } ++ ConnectPropertyVal( const int _val ) ++ { ++ *this = _val; ++ } ++ ConnectPropertyVal( const bool _val ) ++ { ++ *this = _val; ++ } ++ ConnectPropertyVal& operator=( const sql::SQLString& _val ) ++ { ++ reset(); ++ valString = _val; ++ return *this; ++ } ++ ConnectPropertyVal& operator=( const int _val ) ++ { ++ reset(); ++ valInt = _val; ++ return *this; ++ } ++ ConnectPropertyVal& operator=( const bool _val ) ++ { ++ reset(); ++ valBool = _val; ++ return *this; ++ } ++ void reset() ++ { ++ valString = std::string(); ++ valInt = 0; ++ valBool = false; ++ } ++}; + + typedef std::map< sql::SQLString, ConnectPropertyVal > ConnectOptionsMap; + +--- misc/mysql-connector-cpp/cppconn/exception.h 2009-08-20 17:51:23.000000000 +0200 ++++ misc/build/mysql-connector-cpp/cppconn/exception.h 2009-09-11 09:41:41.076379817 +0200 +@@ -37,7 +37,7 @@ + #pragma warning(push) + #pragma warning(disable: 4275) + #endif +-class CPPCONN_PUBLIC_FUNC SQLException : public std::runtime_error ++class CPPCONN_PUBLIC_EXCEPTION SQLException : public std::runtime_error + { + #ifdef _WIN32 + #pragma warning(pop) +@@ -83,26 +83,26 @@ + MEMORY_ALLOC_OPERATORS(SQLException) + }; + +-struct CPPCONN_PUBLIC_FUNC MethodNotImplementedException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION MethodNotImplementedException : public SQLException + { + MethodNotImplementedException(const MethodNotImplementedException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + MethodNotImplementedException(const std::string& reason) : SQLException(reason, "", 0) {} + }; + +-struct CPPCONN_PUBLIC_FUNC InvalidArgumentException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION InvalidArgumentException : public SQLException + { + InvalidArgumentException(const InvalidArgumentException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + InvalidArgumentException(const std::string& reason) : SQLException(reason, "", 0) {} + }; + +-struct CPPCONN_PUBLIC_FUNC InvalidInstanceException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION InvalidInstanceException : public SQLException + { + InvalidInstanceException(const InvalidInstanceException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + InvalidInstanceException(const std::string& reason) : SQLException(reason, "", 0) {} + }; + + +-struct CPPCONN_PUBLIC_FUNC NonScrollableException : public SQLException ++struct CPPCONN_PUBLIC_EXCEPTION NonScrollableException : public SQLException + { + NonScrollableException(const NonScrollableException& e) : SQLException(e.what(), e.sql_state, e.errNo) { } + NonScrollableException(const std::string& reason) : SQLException(reason, "", 0) {} +--- misc/mysql-connector-cpp/driver/makefile.mk 2009-09-11 09:42:34.087202551 +0200 ++++ misc/build/mysql-connector-cpp/driver/makefile.mk 2009-09-11 09:42:25.902286382 +0200 +@@ -1 +1,64 @@ +-dummy ++PRJ=..$/..$/..$/..$/.. ++ ++.INCLUDE : $(PRJ)$/cppconn_config.pmk ++ ++PRJINC=.. ++TARGET=$(PRJNAME) ++ ++# --- Settings ----------------------------------------------------- ++ ++.INCLUDE : settings.mk ++ ++.INCLUDE : $(PRJ)$/mysql_config.pmk ++ ++# --- Files -------------------------------------------------------- ++ ++.IF "$(GUI)-$(OS)-$(RTL_ARCH)" == "UNX-LINUX-x86" ++ SHL1NOCHECK=TRUE ++.ENDIF ++SHL1TARGET=$(TARGET) ++ ++LIB1TARGET=$(SLB)$/$(PRJNAME).lib ++LIB1OBJFILES+= \ ++ $(SLO)$/mysql_art_resultset.obj \ ++ $(SLO)$/mysql_art_rset_metadata.obj \ ++ $(SLO)$/mysql_connection.obj \ ++ $(SLO)$/mysql_debug.obj \ ++ $(SLO)$/mysql_driver.obj \ ++ $(SLO)$/mysql_metadata.obj \ ++ $(SLO)$/mysql_parameter_metadata.obj \ ++ $(SLO)$/mysql_prepared_statement.obj \ ++ $(SLO)$/mysql_ps_resultset.obj \ ++ $(SLO)$/mysql_ps_resultset_metadata.obj \ ++ $(SLO)$/mysql_resultbind.obj \ ++ $(SLO)$/mysql_resultset.obj \ ++ $(SLO)$/mysql_resultset_metadata.obj \ ++ $(SLO)$/mysql_statement.obj \ ++ $(SLO)$/mysql_util.obj \ ++ $(SLO)$/mysql_warning.obj \ ++ ++SHL1STDLIBS=\ ++ $(MYSQL_LIB) ++ ++SHL1RPATH=OXT ++SHL1IMPLIB= i$(TARGET) ++SHL1LIBS= $(LIB1TARGET) $(SLB)$/$(CPPCONN_NATIVEAPI).lib ++SHL1DEF= $(MISC)$/$(SHL1TARGET).def ++DEF1NAME= $(SHL1TARGET) ++DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \ ++ $(LIB1TARGET) ++DEFLIB1NAME=$(TARGET) ++ ++# --- Targets ------------------------------------------------------ ++ ++.INCLUDE : target.mk ++ ++# --- filter file ------------------------------ ++ ++.IF "$(depend)"=="" ++$(MISC)$/$(SHL1TARGET).flt: makefile.mk ++ @echo CLEAR_THE_FILE > $@ ++ @echo _TI >>$@ ++ @echo _real >>$@ ++ @echo __CT >>$@ ++.ENDIF # "$(depend)"=="" +--- misc/mysql-connector-cpp/driver/mysql_connection.cpp 2009-08-13 17:13:46.000000000 +0200 ++++ misc/build/mysql-connector-cpp/driver/mysql_connection.cpp 2009-08-14 09:56:37.015625000 +0200 +@@ -50,6 +50,34 @@ + #include "mysql_debug.h" + + ++// part II of the hack to make C/C++ compile in an OOo env which doesn't have boost::variant installed ++namespace boost ++{ ++ template < class TYPE > ++ const TYPE* get( const sql::ConnectPropertyVal* val ) ++ { ++ return val; ++ } ++ ++ template < > ++ const sql::SQLString* get< sql::SQLString >( const sql::ConnectPropertyVal* val ) ++ { ++ return &val->valString; ++ } ++ ++ template < > ++ const int* get< int >( const sql::ConnectPropertyVal* val ) ++ { ++ return &val->valInt; ++ } ++ ++ template < > ++ const bool* get< bool >( const sql::ConnectPropertyVal* val ) ++ { ++ return &val->valBool; ++ } ++} ++ + namespace sql + { + namespace mysql +--- misc/mysql-connector-cpp/driver/mysql_debug.h 2009-08-13 17:13:46.000000000 +0200 ++++ misc/build/mysql-connector-cpp/driver/mysql_debug.h 2009-08-14 09:56:37.015625000 +0200 +@@ -25,16 +25,6 @@ + + + +-#if defined(WE_HAVE_VARARGS_MACRO_SUPPORT) && (CPPCONN_TRACE_ENABLED || defined(SAL_DLLPRIVATE)) +- #define CPP_ENTER(msg) const boost::shared_ptr< MySQL_DebugLogger > __l = this->logger;(void)__l;\ +- MySQL_DebugEnterEvent __this_func(__LINE__, __FILE__, msg, this->logger) +- #define CPP_ENTER_WL(l, msg) const boost::shared_ptr< MySQL_DebugLogger > __l = (l);(void)__l;\ +- MySQL_DebugEnterEvent __this_func(__LINE__, __FILE__, msg, (l)) +- #define CPP_INFO(msg) {if (__l) __l->log("INF", msg); } +- #define CPP_INFO_FMT(...) {if (__l) __l->log_va("INF", __VA_ARGS__); } +- #define CPP_ERR(msg) {if (__l) __l->log("ERR", msg); } +- #define CPP_ERR_FMT(...) {if (__l) __l->log_va("ERR", __VA_ARGS__); } +-#else + #define CPP_ENTER(msg) + #define CPP_ENTER_WL(l, msg) + #define CPP_INFO(msg) +@@ -42,7 +32,6 @@ + #define CPP_ENTER_WL(l, msg) + static inline void CPP_INFO_FMT(...) {} + static inline void CPP_ERR_FMT(...) {} +-#endif + + #include <stack> + #include "mysql_util.h" +--- misc/mysql-connector-cpp/driver/nativeapi/binding_config.h 2009-08-14 10:17:23.640625000 +0200 ++++ misc/build/mysql-connector-cpp/driver/nativeapi/binding_config.h 2009-08-14 10:13:50.359375000 +0200 +@@ -1 +1,2 @@ +-dummy ++#define HAVE_DLFCN_H 1 ++//#define MYSQLCLIENT_STATIC_BINDING 1 +--- misc/mysql-connector-cpp/driver/nativeapi/makefile.mk 2009-08-17 21:32:53.694119382 +0200 ++++ misc/build/mysql-connector-cpp/driver/nativeapi/makefile.mk 2009-08-17 21:32:50.534346360 +0200 +@@ -1 +1,23 @@ +-dummy ++PRJ=..$/..$/..$/..$/..$/.. ++PRJINC=..$/.. ++ ++.INCLUDE : $(PRJ)$/cppconn_config.pmk ++ ++TARGET=$(CPPCONN_NATIVEAPI) ++ ++# --- Settings ----------------------------------------------------- ++ ++.INCLUDE : settings.mk ++ ++.INCLUDE : $(PRJ)$/mysql_config.pmk ++ ++LIB1TARGET=$(SLB)$/$(TARGET).lib ++LIB1OBJFILES+= \ ++ $(SLO)$/mysql_client_api.obj \ ++ $(SLO)$/library_loader.obj \ ++ $(SLO)$/mysql_native_connection_wrapper.obj \ ++ $(SLO)$/mysql_native_resultset_wrapper.obj \ ++ $(SLO)$/mysql_native_statement_wrapper.obj \ ++ ++# --- Targets ------------------------------------------------------ ++.INCLUDE : target.mk diff --git a/fondu/makefile.mk b/mysqlcppconn/mysql_config.pmk index a543eaa..eb316e0 100644 --- a/fondu/makefile.mk +++ b/mysqlcppconn/mysql_config.pmk @@ -4,11 +4,7 @@ # # Copyright 2008 by Sun Microsystems, Inc. # -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.5 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -17,7 +13,7 @@ # only, as published by the Free Software Foundation. # # OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License version 3 for more details # (a copy is included in the LICENSE file that accompanied this code). @@ -29,45 +25,25 @@ # #************************************************************************* -PRJ=. - -PRJNAME=fondu -TARGET=fondu - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -TARFILE_NAME=fondu_src-051010 - -.IF "$(OS)"!="MACOSX" || "$(GUIBASE)"=="aqua" -dummy: - @echo "Nothing to build for OS $(OS)" -.ENDIF # "$(OS)"!="MACOSX" || "$(GUIBASE)"=="aqua" - -CONFIGURE_DIR=. - -#relative to CONFIGURE_DIR -CONFIGURE_ACTION=configure - -CONFIGURE_FLAGS= - -BUILD_DIR=$(CONFIGURE_DIR) - -BUILD_ACTION=$(GNUMAKE) fondu - -OUT2BIN=$(BUILD_DIR)$/fondu +.IF "$(SYSTEM_MYSQL)" == "YES" + CFLAGS+=-DSYSTEM_MYSQL +.ELSE + .IF "$(LIBMYSQL_PATH)" == "" + alltar: + @echo "need to have LIBMYSQL_PATH set to the location where libmysql (also known as 'MySQL Connector/C') is installed" + @force_dmake_to_error + .ENDIF +.ENDIF -# --- Targets ------------------------------------------------------ +.IF "$(GUI)"=="WNT" -# contains some necessary variables. +CFLAGS+=-DCPPDBC_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -.INCLUDE : set_ext.mk +.ENDIF # "$(GUI)"=="WNT" -.INCLUDE : target.mk +.IF "$(SYSTEM_MYSQL)" != "YES" + MYSQL_INC+=-I$(LIBMYSQL_PATH)$/include +.ENDIF -# contains the "magic" to create targets out of the set variables. +CFLAGS+=-I$(PRJINC) -I$(PRJINC)$/cppconn $(MYSQL_INC) -DCPPCONN_LIB_BUILD -.INCLUDE : tg_ext.mk diff --git a/mysqlcppconn/patches/default_to_protocol_tcp.patch b/mysqlcppconn/patches/default_to_protocol_tcp.patch new file mode 100644 index 0000000..3df78f4 --- /dev/null +++ b/mysqlcppconn/patches/default_to_protocol_tcp.patch @@ -0,0 +1,12 @@ +--- misc/mysql-connector-cpp/driver/mysql_connection.cpp 2009-12-16 13:24:24.088933245 +0100 ++++ misc/build/mysql-connector-cpp/driver/mysql_connection.cpp 2009-12-16 13:24:15.666841004 +0100 +@@ -437,6 +437,9 @@ + throw sql::InvalidArgumentException(e.what()); + } + ++ int default_protocol_tcp = MYSQL_PROTOCOL_TCP; ++ proxy->options(MYSQL_OPT_PROTOCOL, (const char *) &default_protocol_tcp); ++ + #ifndef _WIN32 + if (!hostName.compare(0, sizeof("unix://") - 1, "unix://")) { + protocol_tcp = false; diff --git a/mysqlcppconn/prj/build.lst b/mysqlcppconn/prj/build.lst new file mode 100644 index 0000000..f7407ba --- /dev/null +++ b/mysqlcppconn/prj/build.lst @@ -0,0 +1,3 @@ +my mysqlcppconn : solenv sal NULL +my mysqlcppconn nmake - all my_mkout NULL + diff --git a/mysqlcppconn/prj/d.lst b/mysqlcppconn/prj/d.lst new file mode 100644 index 0000000..7a32571 --- /dev/null +++ b/mysqlcppconn/prj/d.lst @@ -0,0 +1,15 @@ +# mirror the dir structure a make install would create +mkdir: %_DEST%\inc%_EXT%\mysqlcppconn +mkdir: %_DEST%\inc%_EXT%\mysqlcppconn\cppconn + +..\%__SRC%\inc\*.h %_DEST%\inc%_EXT%\mysqlcppconn\*.h +..\%__SRC%\inc\cppconn\*.h %_DEST%\inc%_EXT%\mysqlcppconn\cppconn\*.h + +..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll + + ..\%__SRC%\lib\lib*.so* %_DEST%\lib%_EXT% +..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl +..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib +..\%__SRC%\lib\*.dylib.* %_DEST%\lib%_EXT%\*.dylib.* +..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a +..\%__SRC%\lib\i*.lib %_DEST%\lib%_EXT% diff --git a/mythes/makefile.mk b/mythes/makefile.mk new file mode 100644 index 0000000..f373a5d --- /dev/null +++ b/mythes/makefile.mk @@ -0,0 +1,114 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org 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 Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=. + +PRJNAME=mythes +TARGET=mythes + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- + +TARFILE_NAME=mythes-1.2.0 +TARFILE_MD5=067201ea8b126597670b5eff72e1f66c + +ADDITIONAL_FILES += makefile.mk + +PATCH_FILES=mythes-1.2.0-vanilla-th-gen-idx.patch \ + mythes-1.2.0-makefile-mk.diff + +.IF "$(GUI)"=="UNX" +CONFIGURE_DIR=$(BUILD_DIR) + +.IF "$(SYSTEM_MYTHES)" != "YES" + +.IF "$(SYSTEM_HUNSPELL)" != "YES" +HUNSPELL_CFLAGS +:= -I$(SOLARINCDIR)$/hunspell +HUNSPELL_LIBS +:= -L$(SOLARLIBDIR) -lhunspell-1.2 +.ENDIF + +#relative to CONFIGURE_DIR +# still needed also in system-mythes case as it creates the makefile +CONFIGURE_ACTION=configure +CONFIGURE_FLAGS= --disable-shared --with-pic + +.IF "$(COM)"=="C52" && "$(CPU)"=="U" +LCL_CONFIGURE_CFLAGS+=-m64 +.ENDIF + +.IF "$(SYSBASE)"!="" +.IF "$(EXTRA_CFLAGS)"!="" +LCL_CONFIGURE_CFLAGS+=$(EXTRA_CFLAGS) +CONFIGURE_FLAGS+=CXXFLAGS="$(EXTRA_CFLAGS)" +.ENDIF # "$(EXTRA_CFLAGS)"!="" +.ELIF "$(OS)"=="MACOSX" # "$(SYSBASE)"!="" +CONFIGURE_FLAGS+=CPPFLAGS="$(EXTRA_CDEFS)" +.ENDIF + +.IF "$(LCL_CONFIGURE_CFLAGS)"!="" +CONFIGURE_FLAGS+=CFLAGS='$(LCL_CONFIGURE_CFLAGS)' +.ENDIF + +BUILD_ACTION=make +OUT2INC += mythes.hxx +.ENDIF +.ENDIF # "$(GUI)"=="UNX" + + +.IF "$(GUI)"=="WNT" +.IF "$(COM)"=="GCC" +CONFIGURE_ACTION=configure +CONFIGURE_FLAGS= --disable-shared --with-pic \ + HUNSPELL_CFLAGS=-I$(SOLARINCDIR)$/hunspell \ + HUNSPELL_LIBS="-L$(SOLARLIBDIR) -lhunspell-1.2" + +BUILD_ACTION=make + +.ELSE +BUILD_ACTION=dmake +.ENDIF # "$(COM)"=="GCC" +OUT2INC += mythes.hxx +.ENDIF # "$(GUI)"=="WNT" + +.IF "$(GUI)"=="OS2" +BUILD_ACTION=dmake +OUT2INC += mythes.hxx +.ENDIF # "$(GUI)"=="OS2" + +# --- Targets ------------------------------------------------------ + +.INCLUDE : set_ext.mk +.INCLUDE : target.mk +.INCLUDE : tg_ext.mk + +.IF "$(SYSTEM_HUNSPELL)" != "YES" +.EXPORT: HUNSPELL_LIBS HUNSPELL_CFLAGS +.ENDIF + diff --git a/mythes/mythes-1.2.0-makefile-mk.diff b/mythes/mythes-1.2.0-makefile-mk.diff new file mode 100644 index 0000000..30cdf46 --- /dev/null +++ b/mythes/mythes-1.2.0-makefile-mk.diff @@ -0,0 +1,94 @@ +--- misc/mythes-1.2.0/makefile.mk 2010-05-14 23:36:09.000000000 +0200 ++++ misc/build/mythes-1.2.0/makefile.mk 2010-05-14 23:35:14.000000000 +0200 +@@ -1 +1,90 @@ +-dummy ++#************************************************************************* ++# ++# $RCSfile: makefile.mk,v $ ++# ++# $Revision: 1.1.1.1 $ ++# ++# last change: $Author: caolan $ $Date: 2010/02/27 15:52:17 $ ++# ++# The Contents of this file are made available subject to the terms of ++# either of the following licenses ++# ++# - GNU Lesser General Public License Version 2.1 ++# - Sun Industry Standards Source License Version 1.1 ++# ++# Sun Microsystems Inc., October, 2000 ++# ++# GNU Lesser General Public License Version 2.1 ++# ============================================= ++# Copyright 2000 by Sun Microsystems, Inc. ++# 901 San Antonio Road, Palo Alto, CA 94303, USA ++# ++# This library is free software; you can redistribute it and/or ++# modify it under the terms of the GNU Lesser General Public ++# License version 2.1, as published by the Free Software Foundation. ++# ++# This library 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 ++# Lesser General Public License for more details. ++# ++# You should have received a copy of the GNU Lesser General Public ++# License along with this library; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++# MA 02111-1307 USA ++# ++# ++# Sun Industry Standards Source License Version 1.1 ++# ================================================= ++# The contents of this file are subject to the Sun Industry Standards ++# Source License Version 1.1 (the "License"); You may not use this file ++# except in compliance with the License. You may obtain a copy of the ++# License at http://www.openoffice.org/license.html. ++# ++# Software provided under this License is provided on an "AS IS" basis, ++# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, ++# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, ++# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. ++# See the License for the specific provisions governing your rights and ++# obligations concerning the Software. ++# ++# The Initial Developer of the Original Code is: Sun Microsystems, Inc. ++# ++# Copyright: 2000 by Sun Microsystems, Inc. ++# ++# All Rights Reserved. ++# ++# Contributor(s): _______________________________________ ++# ++# ++# ++#************************************************************************* ++ ++PRJ = ../../../.. ++ ++PRJNAME = mythes ++TARGET = mythes ++LIBTARGET=YES ++EXTERNAL_WARNINGS_NOT_ERRORS := TRUE ++ ++#----- Settings --------------------------------------------------------- ++ ++.INCLUDE : settings.mk ++ ++# --- Files -------------------------------------------------------- ++ ++all_target: ALLTAR ++ ++ ++ ++SLOFILES= \ ++ $(SLO)$/mythes.obj ++ ++LIB1TARGET= $(SLB)$/lib$(TARGET).lib ++LIB1ARCHIV= $(LB)/lib$(TARGET).a ++LIB1OBJFILES= $(SLOFILES) ++ ++# --- Targets ------------------------------------------------------ ++ ++.INCLUDE : target.mk ++ diff --git a/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch b/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch new file mode 100644 index 0000000..776fac4 --- /dev/null +++ b/mythes/mythes-1.2.0-vanilla-th-gen-idx.patch @@ -0,0 +1,97 @@ +--- misc/mythes-1.2.0.orig/th_gen_idx.pl ++++ misc/build/mythes-1.2.0/th_gen_idx.pl +@@ -1,11 +1,32 @@ +-#!/usr/bin/perl +- +-# perl program to take a thesaurus structured text data file +-# and create the proper sorted index file (.idx) ++: ++eval 'exec perl -wS $0 ${1+"$@"}' ++ if 0; ++#************************************************************************* ++# ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++# ++# Copyright 2000, 2010 Oracle and/or its affiliates. ++# ++# OpenOffice.org - a multi-platform office productivity suite ++# ++# This file is part of OpenOffice.org. ++# ++# OpenOffice.org is free software: you can redistribute it and/or modify ++# it under the terms of the GNU Lesser General Public License version 3 ++# only, as published by the Free Software Foundation. ++# ++# OpenOffice.org 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 Lesser General Public License version 3 for more details ++# (a copy is included in the LICENSE file that accompanied this code). + # +-# typcially invoked as follows: +-# cat th_en_US_new.dat | ./th_gen_idx.pl > th_en_US_new.idx ++# You should have received a copy of the GNU Lesser General Public License ++# version 3 along with OpenOffice.org. If not, see ++# <http://www.openoffice.org/license.html> ++# for a copy of the LGPLv3 License. + # ++#************************************************************************* + + sub by_entry { + my ($aent, $aoff) = split('\|',$a); +@@ -13,6 +34,27 @@ sub by_entry { + $aent cmp $bent; + } + ++#FIXME: someone may want "infile" or even parameter parsing ++sub get_outfile { ++ my $next_is_file = 0; ++ foreach ( @ARGV ) { ++ if ( $next_is_file ) { ++ return $_ ++ } ++ if ( $_ eq "-o" ) { ++ $next_is_file = 1; ++ } ++ } ++ return ""; ++} ++ ++sub usage { ++ print "usage:\n"; ++ print "$0 -o outfile < input\n"; ++ ++ exit 99; ++} ++ + # main routine + my $ne = 0; # number of entries in index + my @tindex=(); # the index itself +@@ -24,6 +66,10 @@ my $nm=0; # number of meaning fo + my $meaning=""; # current meaning and synonyms + my $p; # misc uses + my $encoding; # encoding used by text file ++my $outfile = ""; ++ ++$outfile = get_outfile(); ++usage() if ( $outfile eq "" ); + + # top line of thesaurus provides encoding + $encoding=<STDIN>; +@@ -51,9 +97,13 @@ while ($rec=<STDIN>){ + # now we have all of the information + # so sort it and then output the encoding, count and index data + @tindex = sort by_entry @tindex; +-print STDOUT "$encoding\n"; +-print STDOUT "$ne\n"; ++ ++print "$outfile\n"; ++open OUTFILE, ">$outfile" or die "ERROR: Can't open $outfile for writing!"; ++print OUTFILE "$encoding\n"; ++print OUTFILE "$ne\n"; + foreach $one (@tindex) { +- print STDOUT "$one\n"; ++ print OUTFILE "$one\n"; + } ++close OUTFILE; + diff --git a/mythes/prj/build.lst b/mythes/prj/build.lst new file mode 100644 index 0000000..6c3cb80 --- /dev/null +++ b/mythes/prj/build.lst @@ -0,0 +1,3 @@ +myt mythes : soltools solenv HUNSPELL:hunspell NULL +myt mythes usr1 - all myt_mkout NULL +myt mythes nmake - all myt_mythes NULL diff --git a/mythes/prj/d.lst b/mythes/prj/d.lst new file mode 100644 index 0000000..417855e --- /dev/null +++ b/mythes/prj/d.lst @@ -0,0 +1,7 @@ +..\%__SRC%\slb\libmythes.lib %_DEST%\lib%_EXT%\libmythes.lib + +..\%__SRC%\inc\mythes.hxx %_DEST%\inc%_EXT%\mythes.hxx +..\%__SRC%\misc\build\mythes-1.2.0\.libs\libmythes-1.2.a %_DEST%\lib%_EXT%\libmythes-1.2.a +..\%__SRC%\lib\libmythes-1.2.a %_DEST%\lib%_EXT%\libmythes-1.2.a +..\%__SRC%\misc\build\mythes-1.2.0\th_gen_idx.pl %_DEST%\bin%_EXT%\th_gen_idx.pl + diff --git a/np_sdk/mozsrc/makefile.mk b/np_sdk/mozsrc/makefile.mk index 15e14a8..905146a 100644 --- a/np_sdk/mozsrc/makefile.mk +++ b/np_sdk/mozsrc/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -39,11 +35,12 @@ EXTERNAL_WARNINGS_NOT_ERRORS := TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk +.IF "$(L10N_framework)"=="" JDKINCS= # --- Files -------------------------------------------------------- -.IF "$(GUI)" == "WNT" +.IF "$(GUI)" == "WNT" || "$(GUI)" == "OS2" MOZFILES = $(SLO)$/npwin.obj .ELSE MOZFILES = $(SLO)$/npunix.obj @@ -56,6 +53,7 @@ CDEFS+=-DNO_X11 ALL: $(MOZFILES) # --- Targets ------------------------------------------------------ +.ENDIF # L10N_framework .INCLUDE : target.mk diff --git a/np_sdk/mozsrc/npunix.c b/np_sdk/mozsrc/npunix.c index bc1424a..cb92d85 100644 --- a/np_sdk/mozsrc/npunix.c +++ b/np_sdk/mozsrc/npunix.c @@ -1,25 +1,41 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * * The Original Code is mozilla.org code. * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. * - * Contributor(s): - * Stephen Mak <smak@sun.com> - */ + * Contributor(s): + * Stephen Mak <smak@sun.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either of the GNU General Public License Version 2 or later (the "GPL"), + * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ /* * npunix.c @@ -223,8 +239,6 @@ NPN_ForceRedraw(NPP instance) CallNPN_ForceRedrawProc(gNetscapeFuncs.forceredraw, instance); } - - /*********************************************************************** * * Wrapper functions : Netscape Navigator -> plugin @@ -364,7 +378,7 @@ NP_GetMIMEDescription(void) * that the navigator needs. */ NPError -NP_GetValue(NPP future, NPPVariable variable, void *value) +NP_GetValue(void* future, NPPVariable variable, void *value) { return NPP_GetValue(future, variable, value); } diff --git a/np_sdk/mozsrc/npwin.cpp b/np_sdk/mozsrc/npwin.cpp index 3c893b2..1fb4d3e 100644 --- a/np_sdk/mozsrc/npwin.cpp +++ b/np_sdk/mozsrc/npwin.cpp @@ -45,6 +45,12 @@ //\\// DEFINE #define NP_EXPORT +#ifdef OS2 +#define WINAPI _System +#define HIBYTE(a) (a>>8) +#define LOBYTE(a) (a&0xFF) +#endif + //\\// GLOBAL DATA NPNetscapeFuncs* g_pNavigatorFuncs = 0; diff --git a/openssl/download/openssl-0.9.8k.tar.gz b/openssl/download/openssl-0.9.8k.tar.gz Binary files differdeleted file mode 100644 index 69d8d8f..0000000 --- a/openssl/download/openssl-0.9.8k.tar.gz +++ /dev/null diff --git a/openssl/makefile.mk b/openssl/makefile.mk index 22920c2..6fabd1c 100644 --- a/openssl/makefile.mk +++ b/openssl/makefile.mk @@ -1,14 +1,10 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. # -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.26 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -50,9 +46,10 @@ TARGET=openssl @echo "openssl disabled...." .ENDIF -OPENSSL_NAME=openssl-0.9.8k +OPENSSL_NAME=openssl-0.9.8o TARFILE_NAME=$(OPENSSL_NAME) +TARFILE_MD5=63ddc5116488985e820075e65fbe6aa4 CONFIGURE_DIR=. CONFIGURE_ACTION=config @@ -65,15 +62,27 @@ OUT2LIB = libssl.* OUT2LIB += libcrypto.* OUT2INC += include/openssl/* -.IF "$(OS)" == "LINUX" +UNAME=$(shell uname) + +.IF "$(OS)" == "LINUX" || "$(OS)" == "FREEBSD" PATCH_FILES=openssllnx.patch ADDITIONAL_FILES:= \ - libcrypto_OOo_0_9_8k.map \ - libssl_OOo_0_9_8k.map - .IF "$(CPU)" == "X" - CONFIGURE_ACTION=Configure linux-generic64 + libcrypto_OOo_0_9_8o.map \ + libssl_OOo_0_9_8o.map + .IF "$(CPU)" == "I" + .IF "$(UNAME)" == "GNU/kFreeBSD" + CONFIGURE_ACTION=Configure debian-kfreebsd-i386 + .ELSE + CONFIGURE_ACTION=Configure linux-elf + .ENDIF + .ELIF "$(BUILD64)" == "1" + .IF "$(UNAME)" == "GNU/kFreeBSD" + CONFIGURE_ACTION=Configure debian-kfreebsd-amd64 + .ELSE + CONFIGURE_ACTION=Configure linux-generic64 + .ENDIF .ELSE - CONFIGURE_ACTION=Configure linux-elf + CONFIGURE_ACTION=Configure linux-generic32 .ENDIF # if you build openssl as shared library you have to patch the Makefile.Shared "LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \" #BUILD_ACTION=make 'SHARED_LDFLAGS=-Wl,--version-script=./lib$$(SHLIBDIRS)_OOo_0_9_8e.map' @@ -82,27 +91,23 @@ OUT2INC += include/openssl/* .IF "$(OS)" == "SOLARIS" PATCH_FILES=opensslsol.patch ADDITIONAL_FILES:= \ - libcrypto_OOo_0_9_8k.map \ - libssl_OOo_0_9_8k.map + libcrypto_OOo_0_9_8o.map \ + libssl_OOo_0_9_8o.map #BUILD_ACTION=make 'SHARED_LDFLAGS=-G -dy -z text -M./lib$$$$$$$$(SHLIBDIRS)_OOo_0_9_8e.map' - # We need a 64 BIT switch (currently I disable 64 Bit by default). - # Please replace this with a global switch if available - #USE_64 = 1 + # Use BUILD64 when 1 to select new specific 64bit Configurations if necessary - # Solaris INTEL - .IF "$(CPUNAME)" == "INTEL" + .IF "$(CPUNAME)" == "INTEL" # Solaris INTEL .IF "$(CPU)" == "X" CONFIGURE_ACTION=Configure solaris64-x86_64-cc .ELSE CONFIGURE_ACTION=Configure solaris-x86-cc .ENDIF + .ELIF "$(CPU)" == "U" # Solaris SPARC + CONFIGURE_ACTION=Configure solaris64-sparcv9-cc .ELSE - # Solaris SPARC - .IF "$(CPU)" == "U" - CONFIGURE_ACTION=Configure solaris64-sparcv9-cc - .ENDIF -.ENDIF + CONFIGURE_ACTION=Configure solaris-sparcv9-cc + .ENDIF .ENDIF .IF "$(OS)" == "WNT" diff --git a/openssl/openssl.patch b/openssl/openssl.patch index ed47540..5d245f4 100644 --- a/openssl/openssl.patch +++ b/openssl/openssl.patch @@ -1,5 +1,5 @@ ---- misc/openssl-0.9.8k/crypto/x509v3/v3_pci.c 2007-03-05 01:06:47.000000000 +0100 -+++ misc/build/openssl-0.9.8k/crypto/x509v3/v3_pci.c 2008-03-20 13:30:16.000000000 +0100 +--- misc/openssl-0.9.8o/crypto/x509v3/v3_pci.c 2007-03-05 01:06:47.000000000 +0100 ++++ misc/build/openssl-0.9.8o/crypto/x509v3/v3_pci.c 2010-03-26 12:04:20.961547300 +0100 @@ -2,7 +2,7 @@ /* Contributed to the OpenSSL Project 2004 * by Richard Levitte (richard@levitte.org) @@ -9,8 +9,8 @@ * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * ---- misc/openssl-0.9.8k/crypto/x509v3/v3_pcia.c 2004-12-28 01:21:33.000000000 +0100 -+++ misc/build/openssl-0.9.8k/crypto/x509v3/v3_pcia.c 2008-03-20 13:30:47.000000000 +0100 +--- misc/openssl-0.9.8o/crypto/x509v3/v3_pcia.c 2004-12-28 01:21:33.000000000 +0100 ++++ misc/build/openssl-0.9.8o/crypto/x509v3/v3_pcia.c 2010-03-26 12:04:20.961547300 +0100 @@ -2,7 +2,7 @@ /* Contributed to the OpenSSL Project 2004 * by Richard Levitte (richard@levitte.org) @@ -20,28 +20,30 @@ * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * ---- misc/openssl-0.9.8k/ms/do_ms.bat 2005-05-17 02:07:13.000000000 +0200 -+++ misc/build/openssl-0.9.8k/ms/do_ms.bat 2008-03-20 13:27:06.000000000 +0100 -@@ -1,9 +1,8 @@ -+%1 util\mkfiles.pl >MINFO -+%1 util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak -+%1 util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak -+%1 util\mk1mf.pl no-asm VC-CE >ms\ce.mak -+%1 util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak +--- misc/openssl-0.9.8o/ms/do_ms.bat 2009-07-28 14:51:19.000000000 +0200 ++++ misc/build/openssl-0.9.8o/ms/do_ms.bat 2010-03-26 12:19:19.399047300 +0100 +@@ -1,11 +1,11 @@ -perl util\mkfiles.pl >MINFO -perl util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak -perl util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak ++%1 util\mkfiles.pl >MINFO ++%1 util\mk1mf.pl no-asm VC-WIN32 >ms\nt.mak ++%1 util\mk1mf.pl dll no-asm VC-WIN32 >ms\ntdll.mak + if x%OSVERSION% == x goto skipce -perl util\mk1mf.pl no-asm VC-CE >ms\ce.mak -perl util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak -- ++%1 util\mk1mf.pl no-asm VC-CE >ms\ce.mak ++%1 util\mk1mf.pl dll no-asm VC-CE >ms\cedll.mak + :skipce + -perl util\mkdef.pl 32 libeay > ms\libeay32.def -perl util\mkdef.pl 32 ssleay > ms\ssleay32.def +%1 util\mkdef.pl 32 libeay > ms\libeay32.def +%1 util\mkdef.pl 32 ssleay > ms\ssleay32.def ---- misc/openssl-0.9.8k/util/mk1mf.pl 2007-08-13 00:31:14.000000000 +0200 -+++ misc/build/openssl-0.9.8k/util/mk1mf.pl 2008-03-20 13:27:06.000000000 +0100 -@@ -115,7 +115,7 @@ +--- misc/openssl-0.9.8o/util/mk1mf.pl 2009-09-20 14:46:42.000000000 +0200 ++++ misc/build/openssl-0.9.8o/util/mk1mf.pl 2010-03-26 12:04:20.977172300 +0100 +@@ -128,7 +128,7 @@ $inc_def="outinc"; $tmp_def="tmp"; @@ -50,7 +52,19 @@ $mkdir="-mkdir" unless defined $mkdir; ($ssl,$crypto)=("ssl","crypto"); -@@ -570,7 +570,7 @@ +@@ -290,6 +290,11 @@ + chop; + + ($key,$val)=/^([^=]+)=(.*)/; ++ ++ # On some Windows machines, $val has linefeeds at the end, which confuses ++ # subsequent code in this file. So we strip all whitespace at the end. ++ $val =~ s/\s+$//; ++ + if ($key eq "RELATIVE_DIRECTORY") + { + if ($lib ne "") +@@ -730,7 +735,7 @@ printf OUT <<EOF; #ifdef $platform_cpp_symbol /* auto-generated/updated by util/mk1mf.pl for crypto/cversion.c */ @@ -59,10 +73,10 @@ #define PLATFORM "$platform" EOF printf OUT " #define DATE \"%s\"\n", scalar gmtime(); ---- misc/openssl-0.9.8k/util/pl/VC-32.pl 2007-07-19 19:39:07.000000000 +0200 -+++ misc/build/openssl-0.9.8k/util/pl/VC-32.pl 2008-03-20 13:27:06.000000000 +0100 -@@ -28,7 +28,7 @@ - $zlib_lib="zlib1.lib"; +--- misc/openssl-0.9.8o/util/pl/VC-32.pl 2010-02-04 02:10:24.000000000 +0100 ++++ misc/build/openssl-0.9.8o/util/pl/VC-32.pl 2010-03-26 12:04:20.977172300 +0100 +@@ -32,7 +32,7 @@ + $l_flags =~ s/-L(\S+)/\/libpath:$1/g; # C compiler stuff -$cc='cl'; @@ -70,7 +84,7 @@ if ($FLAVOR =~ /WIN64/) { # Note that we currently don't have /WX on Win64! There is a lot of -@@ -99,21 +99,21 @@ +@@ -103,21 +103,21 @@ } $cc='$(CC)'; @@ -90,17 +104,17 @@ $base_cflags.=' -D_CRT_SECURE_NO_DEPRECATE'; # shut up VC8 $base_cflags.=' -D_CRT_NONSTDC_NO_DEPRECATE'; # shut up VC8 - my $f = $shlib || $fips ?' /MD':' /MT'; -+ my $f = $shlib || $fips ?' -MD':' -MT'; - $lib_cflag='/Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib -+ $lib_cflag='-Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib - $opt_cflags=$f.' /Ox /O2 /Ob2'; - $dbg_cflags=$f.'d /Od -DDEBUG -D_DEBUG'; ++ my $f = $shlib || $fips ?' -MD':' -MT'; ++ $lib_cflag='-Zl' if (!$shlib); # remove /DEFAULTLIBs from static lib + $opt_cflags=$f.' -Ox -O2 -Ob2'; + $dbg_cflags=$f.'d -Od -DDEBUG -D_DEBUG'; $lflags="/nologo /subsystem:console /opt:ref"; } $mlflags=''; -@@ -134,7 +134,7 @@ +@@ -138,7 +138,7 @@ } $obj='.obj'; @@ -109,7 +123,7 @@ # EXE linking stuff $link="link"; -@@ -281,7 +281,7 @@ +@@ -298,7 +298,7 @@ $tmp_def='tmp32dll_$(TARGETCPU)'; } diff --git a/openssl/openssllnx.patch b/openssl/openssllnx.patch index 05c4f98..abd1006 100644 --- a/openssl/openssllnx.patch +++ b/openssl/openssllnx.patch @@ -1,40 +1,21 @@ ---- misc/openssl-0.9.8k/test/Makefile 2009-03-25 11:59:22.000000000 +0100 -+++ misc/build/openssl-0.9.8k/test/Makefile 2009-03-30 12:51:00.210108929 +0200 -@@ -408,7 +408,7 @@ - LIBRARIES="$(LIBCRYPTO)"; \ - fi; \ - $(MAKE) -f $(TOP)/Makefile.shared -e \ -- CC=$${CC} APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ -+ CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ - LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ - link_app.$${shlib_target} - -@@ -421,7 +421,7 @@ - fi; \ - [ "$(FIPSCANLIB)" = "libfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \ - $(MAKE) -f $(TOP)/Makefile.shared -e \ -- CC=$${CC} APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ -+ CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ - LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ - link_app.$${shlib_target} - ---- misc/openssl-0.9.8k/apps/Makefile 2008-11-19 17:03:48.000000000 +0100 -+++ misc/build/openssl-0.9.8k/apps/Makefile 2009-03-30 12:50:56.332719825 +0200 -@@ -158,7 +158,7 @@ - LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \ - [ "x$(FIPSCANLIB)" = "xlibfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \ - $(MAKE) -f $(TOP)/Makefile.shared -e \ -- CC=$${CC} APPNAME=$(EXE) OBJECTS="$(PROGRAM).o $(E_OBJ)" \ -+ CC="$${CC}" APPNAME=$(EXE) OBJECTS="$(PROGRAM).o $(E_OBJ)" \ - LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ - link_app.$${shlib_target} - -(cd ..; \ ---- misc/openssl-0.9.8k/config 2009-02-16 09:43:41.000000000 +0100 -+++ misc/build/openssl-0.9.8k/config 2009-03-30 08:59:09.588448000 +0200 +--- misc/build/openssl-0.9.8o/Configure-old 2010-04-17 13:51:42.000000000 +0200 ++++ misc/build/openssl-0.9.8o/Configure 2010-04-17 13:52:03.000000000 +0200 +@@ -388,6 +388,9 @@ + + "bsdi-elf-gcc", "gcc:-DPERL5 -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall::(unknown)::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + ++"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -Wall -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -march=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++ + "nextstep", "cc:-O -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", + "nextstep3.3", "cc:-O3 -Wall:<libc.h>:(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:::", + +--- misc/openssl-0.9.8o/config 2009-02-16 09:43:41.000000000 +0100 ++++ misc/build/openssl-0.9.8o/config 2009-03-30 08:59:09.588448000 +0200 @@ -399,27 +399,21 @@ # this is where the translation occurs into SSLeay terms # --------------------------------------------------------------------------- - + -GCCVER=`(gcc -dumpversion) 2>/dev/null` -if [ "$GCCVER" != "" ]; then - # then strip off whatever prefix egcs prepends the number with... @@ -73,12 +54,12 @@ + fi fi GCCVER=${GCCVER:-0} - if [ "$SYSTEM" = "HP-UX" ];then ---- misc/openssl-0.9.8k/libcrypto_OOo_0_9_8k.map Tue Jan 27 19:52:14 2009 -+++ misc/build/openssl-0.9.8k/libcrypto_OOo_0_9_8k.map Tue Jan 27 19:51:04 2009 -@@ -1,1 +1,3295 @@ + if [ "$SYSTEM" = "HP-UX" ];then +--- misc/openssl-0.9.8o/libcrypto_OOo_0_9_8o.map 2010-03-26 15:26:55.958495757 +0100 ++++ misc/build/openssl-0.9.8o/libcrypto_OOo_0_9_8o.map 2010-03-26 15:31:38.019501422 +0100 +@@ -1 +1,3295 @@ -dummy -+LIBCRYPTO_OOO_0_9_8e { ++LIBCRYPTO_OOO_0_9_8o { + global: +ACCESS_DESCRIPTION_free; +ACCESS_DESCRIPTION_it; @@ -1397,7 +1378,7 @@ +KRB5_TKTBODY_free; +KRB5_TKTBODY_it; +KRB5_TKTBODY_new; -+LIBCRYPTO_OOO_0_9_8e; ++LIBCRYPTO_OOO_0_9_8o; +LONG_it; +MD2; +MD2_Final; @@ -3373,11 +3354,11 @@ + local: + *; +}; ---- misc/openssl-0.9.8k/libssl_OOo_0_9_8k.map Tue Jan 27 19:52:14 2009 -+++ misc/build/openssl-0.9.8k/libssl_OOo_0_9_8k.map Tue Jan 27 19:51:04 2009 -@@ -1,1 +1,445 @@ +--- misc/openssl-0.9.8o/libssl_OOo_0_9_8o.map 2010-03-26 15:26:55.966057991 +0100 ++++ misc/build/openssl-0.9.8o/libssl_OOo_0_9_8o.map 2010-03-26 15:31:58.552966503 +0100 +@@ -1 +1,445 @@ -dummy -+LIBSSL_OOO_0_9_8e { ++LIBSSL_OOO_0_9_8o { + global: +BIO_f_ssl; +BIO_new_buffer_ssl_connect; @@ -3390,7 +3371,7 @@ +DTLSv1_method; +DTLSv1_server_method; +ERR_load_SSL_strings; -+LIBSSL_OOO_0_9_8e; ++LIBSSL_OOO_0_9_8o; +SSL_CIPHER_description; +SSL_CIPHER_get_bits; +SSL_CIPHER_get_name; diff --git a/openssl/opensslmacosx.patch b/openssl/opensslmacosx.patch index 98c5c90..4c99853 100644 --- a/openssl/opensslmacosx.patch +++ b/openssl/opensslmacosx.patch @@ -1,7 +1,7 @@ ---- misc/build/openssl-0.9.8k/libcrypto_OOo_0_9_8k.map 1970-01-01 01:00:00.000000000 +0100 -+++ misc/build/openssl-0.9.8k/libcrypto_OOo_0_9_8k.map 2007-10-16 15:44:13.000000000 +0200 -@@ -0,0 +1,3303 @@ -+LIBCRYPTO_OOO_0_9_8e{ +--- misc/build/openssl-0.9.8o/libcrypto_OOo_0_9_8o.map 1970-01-01 01:00:00.000000000 +0100 ++++ misc/build/openssl-0.9.8o/libcrypto_OOo_0_9_8o.map 2007-10-16 15:44:13.000000000 +0200 +@@ -0,1 +1,3304 @@ ++LIBCRYPTO_OOO_0_9_8o{ + global: +ACCESS_DESCRIPTION_free; +ACCESS_DESCRIPTION_it; @@ -3304,10 +3304,10 @@ + local: + *; +}; ---- misc/build/openssl-0.9.8k/libssl_OOo_0_9_8e.map 1970-01-01 01:00:00.000000000 +0100 -+++ misc/build/openssl-0.9.8k/libssl_OOo_0_9_8e.map 2007-10-16 15:44:13.000000000 +0200 +--- misc/build/openssl-0.9.8o/libssl_OOo_0_9_8o.map 1970-01-01 01:00:00.000000000 +0100 ++++ misc/build/openssl-0.9.8o/libssl_OOo_0_9_8o.map 2007-10-16 15:44:13.000000000 +0200 @@ -0,0 +1,442 @@ -+LIBSSL_OOO_0_9_8e{ ++LIBSSL_OOO_0_9_8o{ + global: +BIO_f_ssl; +BIO_new_buffer_ssl_connect; diff --git a/openssl/opensslmingw.patch b/openssl/opensslmingw.patch index 8aa266f..10b4853 100755 --- a/openssl/opensslmingw.patch +++ b/openssl/opensslmingw.patch @@ -1,5 +1,5 @@ ---- misc/openssl-0.9.8k/Makefile.shared 2008-09-17 17:56:40.000000000 +0200 -+++ misc/build/openssl-0.9.8k/Makefile.shared 2009-03-30 11:52:53.684538000 +0200 +--- misc/openssl-0.9.8o/Makefile.shared 2008-09-17 17:56:40.000000000 +0200 ++++ misc/build/openssl-0.9.8o/Makefile.shared 2009-03-30 11:52:53.684538000 +0200 @@ -254,13 +254,17 @@ base=-Wl,--enable-auto-image-base; \ if expr $(PLATFORM) : 'mingw' > /dev/null; then \ @@ -21,26 +21,20 @@ [ -f apps/$$SHLIB$$SHLIB_SUFFIX ] && rm apps/$$SHLIB$$SHLIB_SUFFIX; \ [ -f test/$$SHLIB$$SHLIB_SUFFIX ] && rm test/$$SHLIB$$SHLIB_SUFFIX; \ $(LINK_SO_A) || exit 1; \ ---- misc/openssl-0.9.8k/apps/Makefile 2008-11-20 01:03:48.000000000 +0900 -+++ misc/build/openssl-0.9.8k/apps/Makefile 2009-04-10 19:49:37.006875000 +0900 -@@ -153,12 +153,12 @@ - shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ - shlib_target="$(SHLIB_TARGET)"; \ - elif [ -n "$(FIPSCANLIB)" ]; then \ -- FIPSLD_CC=$(CC); CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \ -+ FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \ - fi; \ - LIBRARIES="$(LIBSSL) $(LIBKRB5) $(LIBCRYPTO)" ; \ - [ "x$(FIPSCANLIB)" = "xlibfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \ - $(MAKE) -f $(TOP)/Makefile.shared -e \ -- CC=$${CC} APPNAME=$(EXE) OBJECTS="$(PROGRAM).o $(E_OBJ)" \ -+ CC="$${CC}" APPNAME=$(EXE) OBJECTS="$(PROGRAM).o $(E_OBJ)" \ - LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ - link_app.$${shlib_target} - -(cd ..; \ ---- misc/openssl-0.9.8k/ms/mingw32.bat 2006-05-05 15:19:32.000000000 +0200 -+++ misc/build/openssl-0.9.8k/ms/mingw32.bat 2009-03-30 11:54:10.000000000 +0200 -@@ -79,13 +79,19 @@ +--- misc/openssl-0.9.8o/e_os2.h 2005-12-19 03:57:07.000000000 +0900 ++++ misc/build/openssl-0.9.8o/e_os2.h 2009-04-04 23:07:15.324250000 +0900 +@@ -264,7 +264,7 @@ + # define OPENSSL_IMPLEMENT_GLOBAL(type,name) \ + extern type _hide_##name; \ + type *_shadow_##name(void) { return &_hide_##name; } \ +- static type _hide_##name ++ type _hide_##name + # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) + # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) + #else +--- misc/openssl-0.9.8o/ms/mingw32.bat 2006-05-05 15:19:32.000000000 +0200 ++++ misc/build/openssl-0.9.8o/ms/mingw32.bat 2009-03-30 11:54:10.000000000 +0200 +@@ -79,15 +79,41 @@ rem copy ms\tlhelp32.h outinc echo Building the libraries @@ -56,47 +50,37 @@ if errorlevel 1 goto end -dllwrap --dllname libssl32.dll --output-lib out/libssl32.a --def ms/ssleay32.def out/libssl.a out/libeay32.a +gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 -+if errorlevel 1 goto end + if errorlevel 1 goto end +dlltool --dllname ssleay32.dll --output-lib out/libssl.a --input-def ms/ssleay32.def +if errorlevel 1 goto end -+gcc --shared --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto - if errorlevel 1 goto end ++if "%MINGW_SHARED_GXXLIB%"=="YES" goto shared_gxxlib ++if "%MINGW_SHARED_GCCLIB%"=="YES" goto shared_gcclib ++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 ++if errorlevel 1 goto end ++gcc --shared --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto ++if errorlevel 1 goto end ++goto finished ++ ++:shared_gcclib ++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 ++if errorlevel 1 goto end ++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto ++if errorlevel 1 goto end ++goto finished ++ ++:shared_gxxlib ++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/libeay32.map ms/libeay32.def -o out/libeay32.dll out/libcrypto_static.a -lwsock32 -lgdi32 -lstdc++_s ++if errorlevel 1 goto end ++gcc --shared -shared-libgcc --enable-pseudo-reloc -Wl,-Map,out/ssleay32.map -Lout ms/ssleay32.def -o out/ssleay32.dll out/libssl_static.a -lcrypto -lstdc++_s ++if errorlevel 1 goto end ++goto finished ++:finished echo Done compiling OpenSSL ---- misc/openssl-0.9.8k/test/Makefile 2009-03-25 19:59:22.000000000 +0900 -+++ misc/build/openssl-0.9.8k/test/Makefile 2009-04-10 20:07:21.522500000 +0900 -@@ -402,13 +402,13 @@ - if [ "$(FIPSCANLIB)" = "libfips" ]; then \ - LIBRARIES="-L$(TOP) -lfips"; \ - elif [ -n "$(FIPSCANLIB)" ]; then \ -- FIPSLD_CC=$(CC); CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \ -+ FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \ - LIBRARIES="$${FIPSLIBDIR:-$(TOP)/fips/}fipscanister.o"; \ - else \ - LIBRARIES="$(LIBCRYPTO)"; \ - fi; \ - $(MAKE) -f $(TOP)/Makefile.shared -e \ -- CC=$${CC} APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ -+ CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ - LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ - link_app.$${shlib_target} - -@@ -417,11 +417,11 @@ - fi; \ - LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ - if [ -z "$(SHARED_LIBS)" -a -n "$(FIPSCANLIB)" ] ; then \ -- FIPSLD_CC=$(CC); CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \ -+ FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \ - fi; \ - [ "$(FIPSCANLIB)" = "libfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \ - $(MAKE) -f $(TOP)/Makefile.shared -e \ -- CC=$${CC} APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ -+ CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ - LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ - link_app.$${shlib_target} ---- misc/openssl-0.9.8k/util/pl/Mingw32.pl 2006-05-05 15:19:34.000000000 +0200 -+++ misc/build/openssl-0.9.8k/util/pl/Mingw32.pl 2009-03-30 11:55:04.000000000 +0200 + :end +--- misc/openssl-0.9.8o/util/pl/Mingw32.pl 2006-05-05 15:19:34.000000000 +0200 ++++ misc/build/openssl-0.9.8o/util/pl/Mingw32.pl 2009-03-30 11:55:04.000000000 +0200 @@ -6,11 +6,11 @@ $o='/'; $cp='cp'; diff --git a/openssl/opensslsol.patch b/openssl/opensslsol.patch index 79e9e19..cd2d93a 100644 --- a/openssl/opensslsol.patch +++ b/openssl/opensslsol.patch @@ -1,18 +1,18 @@ ---- misc/openssl-0.9.8k/Configure Mon Feb 16 09:44:22 2009 -+++ misc/build/openssl-0.9.8k/Configure Mon Mar 30 08:17:56 2009 -@@ -206,8 +206,8 @@ - "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - +--- misc/openssl-0.9.8o/Configure Mon Nov 9 15:14:26 2009 ++++ misc/build/openssl-0.9.8o/Configure Fri Mar 26 16:01:32 2010 +@@ -212,8 +212,8 @@ + "solaris64-x86_64-gcc","gcc:-m64 -O3 -Wall -DL_ENDIAN -DMD32_REG_T=int::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared -static-libgcc:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + #### Solaris x86 with Sun C setups -"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", --"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +-"solaris64-x86_64-cc","cc:-fast -xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris-x86-cc","cc:-O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"solaris64-x86_64-cc","cc:-xarch=amd64 -xstrconst -Xa -DL_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK BF_PTR2 DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:solaris-shared:-KPIC:-xarch=amd64 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", - + #### SPARC Solaris with GNU C setups "solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ----- misc/openssl-0.9.8k/Makefile.shared Wed Sep 17 17:56:40 2008 -+++ misc/build/openssl-0.9.8k/Makefile.shared Mon Mar 30 08:19:42 2009 +--- misc/openssl-0.9.8o/Makefile.shared Wed Sep 17 17:56:40 2008 ++++ misc/build/openssl-0.9.8o/Makefile.shared Fri Mar 26 16:04:41 2010 @@ -93,7 +93,7 @@ LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \ LIBPATH=`for x in $$LIBDEPS; do if echo $$x | grep '^ *-L' > /dev/null 2>&1; then echo $$x | sed -e 's/^ *-L//'; fi; done | uniq`; \ @@ -20,7 +20,7 @@ - LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \ + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \ $${LDCMD} $${LDFLAGS} -o $${APPNAME:=$(APPNAME)} $(OBJECTS) $${LIBDEPS} ) - + LINK_SO= \ @@ -103,7 +103,7 @@ SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \ @@ -31,12 +31,12 @@ $${SHAREDCMD} $${SHAREDFLAGS} \ -o $$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX \ $$ALLSYMSFLAGS $$SHOBJECTS $$NOALLSYMSFLAGS $$LIBDEPS \ ----- misc/openssl-0.9.8k/config Mon Feb 16 09:43:41 2009 -+++ misc/build/openssl-0.9.8k/config Mon Mar 30 08:22:05 2009 +--- misc/openssl-0.9.8o/config Tue Mar 9 18:08:24 2010 ++++ misc/build/openssl-0.9.8o/config Fri Mar 26 16:07:55 2010 @@ -399,28 +399,25 @@ # this is where the translation occurs into SSLeay terms # --------------------------------------------------------------------------- - + -GCCVER=`(gcc -dumpversion) 2>/dev/null` -if [ "$GCCVER" != "" ]; then - # then strip off whatever prefix egcs prepends the number with... @@ -47,16 +47,10 @@ - # major and minor version numbers. - # peak single digit before and after first dot, e.g. 2.95.1 gives 29 - GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` --fi -- --# Only set CC if not supplied already --if [ -z "$CC" ]; then --# figure out if gcc is available and if so we use it otherwise --# we fallback to whatever cc does on the system +if [ -z "$CC" ];then + GCCVER=`(gcc -dumpversion) 2>/dev/null` - if [ "$GCCVER" != "" ]; then - CC=gcc ++ if [ "$GCCVER" != "" ]; then ++ CC=gcc + # then strip off whatever prefix egcs prepends the number with... + # Hopefully, this will work for any future prefixes as well. + GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'` @@ -65,21 +59,31 @@ + # major and minor version numbers. + # peak single digit before and after first dot, e.g. 2.95.1 gives 29 + GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'` - else - CC=cc - fi ++ else ++ CC=cc ++ fi +else + CC=`echo $CC | sed 's/^[^ ]*\/\(..\).*/\1/'` fi -+ + +-# Only set CC if not supplied already +-if [ -z "$CC" ]; then +-# figure out if gcc is available and if so we use it otherwise +-# we fallback to whatever cc does on the system +- if [ "$GCCVER" != "" ]; then +- CC=gcc +- else +- CC=cc +- fi +-fi GCCVER=${GCCVER:-0} if [ "$SYSTEM" = "HP-UX" ];then - # By default gcc is a ILP32 compiler (with long long == 64). ---- misc/openssl-0.9.8k/libcrypto_OOo_0_9_8k.map Tue Jan 27 19:52:14 2009 -+++ misc/build/openssl-0.9.8k/libcrypto_OOo_0_9_8k.map Tue Jan 27 19:51:04 2009 -@@ -1,1 +1,3295 @@ + # By default gcc is a ILP32 compiler (with long long == 64). +--- misc/openssl-0.9.8o/libcrypto_OOo_0_9_8o.map Fri Mar 26 16:13:54 2010 ++++ misc/build/openssl-0.9.8o/libcrypto_OOo_0_9_8o.map Fri Mar 26 16:10:09 2010 +@@ -1,1 +1,3296 @@ -dummy -+LIBCRYPTO_OOO_0_9_8e { ++LIBCRYPTO_OOO_0_9_8o { + global: +ACCESS_DESCRIPTION_free; +ACCESS_DESCRIPTION_it; @@ -1398,7 +1402,7 @@ +KRB5_TKTBODY_free; +KRB5_TKTBODY_it; +KRB5_TKTBODY_new; -+LIBCRYPTO_OOO_0_9_8e; ++LIBCRYPTO_OOO_0_9_8o; +LONG_it; +MD2; +MD2_Final; @@ -3374,11 +3378,12 @@ + local: + *; +}; ---- misc/openssl-0.9.8k/libssl_OOo_0_9_8k.map Tue Jan 27 19:52:14 2009 -+++ misc/build/openssl-0.9.8k/libssl_OOo_0_9_8k.map Tue Jan 27 19:51:04 2009 -@@ -1,1 +1,445 @@ ++ +--- misc/openssl-0.9.8o/libssl_OOo_0_9_8o.map Fri Mar 26 16:13:54 2010 ++++ misc/build/openssl-0.9.8o/libssl_OOo_0_9_8o.map Fri Mar 26 16:11:27 2010 +@@ -1,1 +1,446 @@ -dummy -+LIBSSL_OOO_0_9_8e { ++LIBSSL_OOO_0_9_8o { + global: +BIO_f_ssl; +BIO_new_buffer_ssl_connect; @@ -3391,7 +3396,7 @@ +DTLSv1_method; +DTLSv1_server_method; +ERR_load_SSL_strings; -+LIBSSL_OOO_0_9_8e; ++LIBSSL_OOO_0_9_8o; +SSL_CIPHER_description; +SSL_CIPHER_get_bits; +SSL_CIPHER_get_name; @@ -3823,3 +3828,4 @@ + *; +}; + ++ diff --git a/openssl/version.mk b/openssl/version.mk index f923f9c..613f65a 100644 --- a/openssl/version.mk +++ b/openssl/version.mk @@ -1,14 +1,10 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. # -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: version.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.4 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -30,8 +26,8 @@ #************************************************************************* -OPENSSL_VERSION=0.9.8g +OPENSSL_VERSION=0.9.8o .IF "$(OS)" == "SOLARIS" -OPENSSL_NAME=openssl-0.9.8k +OPENSSL_NAME=openssl-0.9.8o .ENDIF
\ No newline at end of file diff --git a/redland/README b/redland/README index 57397cc..87299eb 100644 --- a/redland/README +++ b/redland/README @@ -19,3 +19,20 @@ It consists of 3 parts: Libraries: libraptor, librasqal, librdf +Patches: +There are several patches, most of which contain only hacks to get it to +build with OOo build system. +There used to be also 3 patches here that fix bugs in redland and ought to be +of general interest: +- redland-1.0.8.patch.free_null: + redland destructor functions don't check if argument is NULL +- redland-1.0.8.patch.storage_hashes_context_serialize_get_statement: + hashes storage: the function to create statements during serialization does + not fill in the context propery (i.e. context is NULL) +- redland-1.0.8.patch.storage_hashes_list_duplicates: + hashes, list storage: if contexts are enabled, then it is possible to add + duplicate statements +Attempts to upstream these patches failed for reasons upstream kept to +themselves. Now these patches are replaced with workarounds in unoxml. +Note to future maintainers: work around redland bugs in client code. + diff --git a/redland/download/raptor-1.4.17.tar.gz b/redland/download/raptor-1.4.17.tar.gz Binary files differdeleted file mode 100644 index ac30c73..0000000 --- a/redland/download/raptor-1.4.17.tar.gz +++ /dev/null diff --git a/redland/download/rasqal-0.9.15.tar.gz b/redland/download/rasqal-0.9.15.tar.gz Binary files differdeleted file mode 100644 index 41296c0..0000000 --- a/redland/download/rasqal-0.9.15.tar.gz +++ /dev/null diff --git a/redland/download/redland-1.0.7.tar.gz b/redland/download/redland-1.0.7.tar.gz Binary files differdeleted file mode 100644 index 4b2cb7a..0000000 --- a/redland/download/redland-1.0.7.tar.gz +++ /dev/null diff --git a/redland/prj/build.lst b/redland/prj/build.lst index a5653f0..f6d0562 100644 --- a/redland/prj/build.lst +++ b/redland/prj/build.lst @@ -1,4 +1,4 @@ -rld redland : sal soltools ZLIB:zlib LIBXML2:libxml2 LIBXSLT:libxslt OPENSSL:openssl NULL +rld redland : stlport soltools LIBXML2:libxml2 LIBXSLT:libxslt OPENSSL:openssl NULL rld redland usr1 - all rld_mkout NULL rld redland\raptor nmake - all rld_raptor NULL rld redland\rasqal nmake - all rld_rasqal rld_raptor NULL diff --git a/redland/prj/d.lst b/redland/prj/d.lst index 03bbd21..6363f9b 100644 --- a/redland/prj/d.lst +++ b/redland/prj/d.lst @@ -3,10 +3,10 @@ symlink: %_DEST%\lib%_EXT%\libraptor.so.1 %_DEST%\lib%_EXT%\libraptor.so ..\%__SRC%\lib\libraptor.1.dylib %_DEST%\lib%_EXT%\libraptor.1.dylib symlink: %_DEST%\lib%_EXT%\libraptor.1.dylib %_DEST%\lib%_EXT%\libraptor.dylib -..\%__SRC%\lib\librasqal.so.0 %_DEST%\lib%_EXT%\librasqal.so.0 -symlink: %_DEST%\lib%_EXT%\librasqal.so.0 %_DEST%\lib%_EXT%\librasqal.so -..\%__SRC%\lib\librasqal.0.dylib %_DEST%\lib%_EXT%\librasqal.0.dylib -symlink: %_DEST%\lib%_EXT%\librasqal.0.dylib %_DEST%\lib%_EXT%\librasqal.dylib +..\%__SRC%\lib\librasqal.so.1 %_DEST%\lib%_EXT%\librasqal.so.1 +symlink: %_DEST%\lib%_EXT%\librasqal.so.1 %_DEST%\lib%_EXT%\librasqal.so +..\%__SRC%\lib\librasqal.1.dylib %_DEST%\lib%_EXT%\librasqal.1.dylib +symlink: %_DEST%\lib%_EXT%\librasqal.1.dylib %_DEST%\lib%_EXT%\librasqal.dylib ..\%__SRC%\lib\librdf.so.0 %_DEST%\lib%_EXT%\librdf.so.0 symlink: %_DEST%\lib%_EXT%\librdf.so.0 %_DEST%\lib%_EXT%\librdf.so ..\%__SRC%\lib\librdf.0.dylib %_DEST%\lib%_EXT%\librdf.0.dylib diff --git a/redland/raptor-1.4.17.patch b/redland/raptor-1.4.17.patch deleted file mode 100644 index c22ff2b..0000000 --- a/redland/raptor-1.4.17.patch +++ /dev/null @@ -1,624 +0,0 @@ ---- misc/raptor-1.4.17/LICENSE.txt Sun Mar 30 06:52:22 2008 -+++ misc/build/raptor-1.4.17/LICENSE.txt Mon Jun 16 15:55:38 2008 -@@ -60,3 +60,15 @@ - - Copyright (C) 2000-2008 David Beckett - Copyright (C) 2000-2005 University of Bristol -+ -+ -+LGPL Disclaimer -+ -+For the avoidance of doubt, except that if any license choice other -+than GPL or LGPL is available it will apply instead, Sun elects to -+use only the Lesser General Public License version 2.1 (LGPLv2) at -+this time for any software where a choice of LGPL license versions -+is made available with the language indicating that LGPLv2.1 or any -+later version may be used, or where a choice of which version of the -+LGPL is applied is otherwise unspecified. -+ ---- misc/raptor-1.4.17/src/makefile.mk Mon Jun 16 17:24:23 2008 -+++ misc/build/raptor-1.4.17/src/makefile.mk Mon Jun 16 19:25:14 2008 -@@ -1,1 +1,128 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile: raptor-1.4.17.patch,v $ -+# -+# $Revision: 1.2.6.2 $ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+PRJ=..$/..$/..$/..$/.. -+ -+PRJNAME=redland -+TARGET=raptor -+LIBTARGET=NO -+ -+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE -+ -+ -+# --- Settings ----------------------------------------------------- -+ -+.INCLUDE : settings.mk -+ -+.IF "$(GUI)"=="OS2" -+CDEFS+=-DRAPTOR_INTERNAL -DHAVE_CONFIG_H -DNDEBUG -+.ELSE -+CDEFS+=-DRAPTOR_INTERNAL -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS -+.ENDIF -+ -+# --- Files -------------------------------------------------------- -+ -+SLOFILES = \ -+ $(SLO)$/n3_lexer.obj \ -+ $(SLO)$/n3_parser.obj \ -+ $(SLO)$/ntriples_parse.obj \ -+ $(SLO)$/parsedate.obj \ -+ $(SLO)$/raptor_feature.obj \ -+ $(SLO)$/raptor_general.obj \ -+ $(SLO)$/raptor_guess.obj \ -+ $(SLO)$/raptor_identifier.obj \ -+ $(SLO)$/raptor_iostream.obj \ -+ $(SLO)$/raptor_libxml.obj \ -+ $(SLO)$/raptor_locator.obj \ -+ $(SLO)$/raptor_namespace.obj \ -+ $(SLO)$/raptor_nfc.obj \ -+ $(SLO)$/raptor_nfc_data.obj \ -+ $(SLO)$/raptor_parse.obj \ -+ $(SLO)$/raptor_qname.obj \ -+ $(SLO)$/raptor_rdfxml.obj \ -+ $(SLO)$/raptor_rfc2396.obj \ -+ $(SLO)$/raptor_rss.obj \ -+ $(SLO)$/raptor_rss_common.obj \ -+ $(SLO)$/raptor_sax2.obj \ -+ $(SLO)$/raptor_sequence.obj \ -+ $(SLO)$/raptor_serialize.obj \ -+ $(SLO)$/raptor_serialize_ntriples.obj \ -+ $(SLO)$/raptor_serialize_rdfxml.obj \ -+ $(SLO)$/raptor_serialize_rdfxmla.obj \ -+ $(SLO)$/raptor_serialize_rss.obj \ -+ $(SLO)$/raptor_serialize_simple.obj \ -+ $(SLO)$/raptor_set.obj \ -+ $(SLO)$/raptor_stringbuffer.obj \ -+ $(SLO)$/raptor_uri.obj \ -+ $(SLO)$/raptor_utf8.obj \ -+ $(SLO)$/raptor_win32.obj \ -+ $(SLO)$/raptor_www.obj \ -+ $(SLO)$/raptor_www_libxml.obj \ -+ $(SLO)$/raptor_xml.obj \ -+ $(SLO)$/raptor_xml_writer.obj \ -+ $(SLO)$/raptor_xsd.obj \ -+ $(SLO)$/raptor_strcasecmp.obj \ -+ $(SLO)$/turtle_common.obj \ -+ $(SLO)$/turtle_lexer.obj \ -+ $(SLO)$/turtle_parser.obj \ -+ $(SLO)$/raptor_grddl.obj \ -+ $(SLO)$/raptor_abbrev.obj \ -+ $(SLO)$/raptor_avltree.obj \ -+ $(SLO)$/raptor_statement.obj \ -+ $(SLO)$/raptor_turtle_writer.obj \ -+ -+ -+SHL1DEPN= makefile.mk -+SHL1OBJS= $(SLOFILES) -+SHL1USE_EXPORTS=name -+ -+#SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -+SHL1TARGET= $(TARGET) -+SHL1IMPLIB= lib$(TARGET) -+ -+#SHL1VERSIONMAP=../service/exports.map -+.IF "$(GUI)"=="OS2" -+SHL1VERSIONMAP=$(PRJ)$/raptor$/raptor2.map -+.ENDIF -+SHL1DEF=$(MISC)$/$(SHL1TARGET).def -+DEF1NAME=$(SHL1TARGET) -+ -+SHL1STDLIBS= \ -+ $(LIBXML2LIB) \ -+ $(XSLTLIB) \ -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk -+ -+$(MISC)$/raptor_strcasecmp.c : strcasecmp.c -+ $(COPY) $< $@ -+ ---- misc/raptor-1.4.17/src/raptor-config.in Sat Jan 6 05:02:00 2007 -+++ misc/build/raptor-1.4.17/src/raptor-config.in Mon Jun 16 15:55:38 2008 -@@ -21,14 +21,23 @@ - # - # - --prefix=@prefix@ --exec_prefix=@exec_prefix@ -+prefix=${SOLARVERSION}/${INPATH} -+exec_prefix=${SOLARVERSION}/${INPATH} -+#includedir=${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/external -+#libdir=${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT} -+# HACK: map to build directory -+includedir=../../../../inc -+libdir=../../../../lib -+includes=-I${includedir} - --if test "@includedir@" != /usr/include ; then -- includes="-I@includedir@" --else -- includes= --fi -+#prefix=@prefix@ -+#exec_prefix=@exec_prefix@ -+# -+#if test "@includedir@" != /usr/include ; then -+# includes="-I@includedir@" -+#else -+# includes= -+#fi - - - usage() -@@ -130,7 +139,8 @@ - done - fi - if test "$echo_libs" = "yes"; then -- echo -L@libdir@ -lraptor -+# echo -L@libdir@ -lraptor -+ echo -L${libdir} -lraptor - fi - if test "$echo_libtool_libs" = "yes"; then - echo @libdir@/@RAPTOR_LIBTOOLLIBS@ ---- misc/raptor-1.4.17/src/win32_raptor_config.h Tue Oct 2 06:12:55 2007 -+++ misc/build/raptor-1.4.17/src/win32_raptor_config.h 2008-07-06 10:27:03.553625000 +0900 -@@ -38,6 +38,8 @@ - - #define HAVE_STDLIB_H 1 - -+#define HAVE_ERRNO_H 1 -+ - #if 0 - /* For using expat on win32 */ - #define RAPTOR_XML_EXPAT 1 -@@ -47,8 +49,17 @@ - /* For using libxml2 on win32 */ - #define RAPTOR_XML_LIBXML - #define HAVE_LIBXML_XMLREADER_H -+#define HAVE_LIBXML_HASH_H 1 -+#define HAVE_LIBXML_HTMLPARSER_H 1 -+#define HAVE_LIBXML_NANOHTTP_H 1 -+#define HAVE_LIBXML_PARSER_H 1 -+#define HAVE_LIBXSLT_XSLT_H 1 -+ -+#define RAPTOR_LIBXML_HTML_PARSE_NONET 1 -+#define RAPTOR_LIBXML_XML_PARSE_NONET 1 -+ - /* does libxml struct xmlEntity have a field etype */ --/*#define RAPTOR_LIBXML_ENTITY_ETYPE*/ -+#define RAPTOR_LIBXML_ENTITY_ETYPE - - /* does libxml struct xmlEntity have a field name_length */ - /*#define RAPTOR_LIBXML_ENTITY_NAME_LENGTH*/ -@@ -60,16 +71,17 @@ - #define HAVE_XMLSAX2INTERNALSUBSET 1 - - /* does libxml xmlSAXHandler have externalSubset field */ --/*#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET*/ -+#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET 1 - - /* does libxml xmlSAXHandler have initialized field */ --/*#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED*/ -+#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED 1 - #endif - - #define HAVE_STRICMP 1 - - /* MS names for these functions */ --#define vsnprintf _vsnprintf -+// next line breaks build on wntmsci12 -+//#define vsnprintf _vsnprintf - #define snprintf _snprintf - #define access _access - #define stricmp _stricmp -@@ -114,7 +126,9 @@ - - #define RAPTOR_PARSER_GUESS 1 - #define RAPTOR_PARSER_GRDDL 1 -+#ifndef __MINGW32__ /* conflicts with normal configure result */ - #define RAPTOR_PARSER_N3 1 -+#endif - #define RAPTOR_PARSER_TURTLE 1 - #define RAPTOR_PARSER_NTRIPLES 1 - #define RAPTOR_PARSER_RDFXML 1 -@@ -125,7 +139,8 @@ - #define RAPTOR_SERIALIZER_RDFXML_ABBREV 1 - #define RAPTOR_SERIALIZER_NTRIPLES 1 - --#define RAPTOR_WWW_LIBCURL 1 -+//#define RAPTOR_WWW_LIBCURL 1 -+#define RAPTOR_WWW_LIBXML 1 - - - #include <windows.h> ---- misc/raptor-1.4.17/ltmain.sh 2008-02-02 22:28:24.000000000 +0900 -+++ misc/build/raptor-1.4.17/ltmain.sh 2008-07-08 11:58:42.000000000 +0900 -@@ -3262,9 +3262,9 @@ - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) -- current="$number_major" -- revision="$number_minor" -- age="0" -+ current=`expr $number_major + $number_minor` -+ age="$number_minor" -+ revision="$number_revision" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor` -@@ -3344,8 +3344,8 @@ - ;; - - freebsd-elf) -- major=".$current" -- versuffix=".$current"; -+ major=.`expr $current - $age` -+ versuffix="$major.$age.$revision" - ;; - - irix | nonstopux) ---- misc/raptor-1.4.17/configure 2008-03-17 16:37:20.000000000 +0900 -+++ misc/build/raptor-1.4.17/configure 2008-07-06 09:05:29.974875000 +0900 -@@ -4317,7 +4317,7 @@ - - cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh -- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' -+ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -@@ -4326,7 +4326,7 @@ - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then -- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' -+ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ---- misc/raptor-1.4.17/src/raptor_config.h 2008-12-26 11:49:30.000000000 +0100 -+++ misc/build/raptor-1.4.17/src/raptor_config.h 2008-12-26 01:10:34.000000000 +0100 -@@ -1 +1,310 @@ --dummy -+/* src/raptor_config.h. Generated from raptor_config.h.in by configure. */ -+/* src/raptor_config.h.in. Generated from configure.ac by autoheader. */ -+ -+/* does expat crash when it sees an initial UTF8 BOM? */ -+/* #undef EXPAT_UTF8_BOM_CRASH */ -+ -+/* vsnprint has C99 compatible return value */ -+#define HAVE_C99_VSNPRINTF 1 -+ -+/* Have curl/curl.h */ -+/* #undef HAVE_CURL_CURL_H */ -+ -+/* Define to 1 if you have the <dlfcn.h> header file. */ -+#define HAVE_DLFCN_H 1 -+ -+/* Define to 1 if you have the <dmalloc.h> header file. */ -+/* #undef HAVE_DMALLOC_H */ -+ -+/* Define to 1 if you have the <errno.h> header file. */ -+#define HAVE_ERRNO_H 1 -+ -+/* Define to 1 if you have the <expat.h> header file. */ -+//#define HAVE_EXPAT_H 1 -+ -+/* Define to 1 if you have the <fetch.h> header file. */ -+/* #undef HAVE_FETCH_H */ -+ -+/* Define to 1 if you have the `getopt' function. */ -+#define HAVE_GETOPT 1 -+ -+/* Define to 1 if you have the <getopt.h> header file. */ -+#define HAVE_GETOPT_H 1 -+ -+/* Define to 1 if you have the `getopt_long' function. */ -+#define HAVE_GETOPT_LONG 1 -+ -+/* INN parsedate function present */ -+/* #undef HAVE_INN_PARSEDATE */ -+ -+/* Define to 1 if you have the <inttypes.h> header file. */ -+#define HAVE_INTTYPES_H 1 -+ -+/* Define to 1 if you have the `isascii' function. */ -+#define HAVE_ISASCII 1 -+ -+/* Define to 1 if you have the <libxml/hash.h> header file. */ -+/* #undef HAVE_LIBXML_HASH_H */ -+ -+/* Define to 1 if you have the <libxml/HTMLparser.h> header file. */ -+/* #undef HAVE_LIBXML_HTMLPARSER_H */ -+ -+/* Define to 1 if you have the <libxml/nanohttp.h> header file. */ -+/* #undef HAVE_LIBXML_NANOHTTP_H */ -+ -+/* Define to 1 if you have the <libxml/parser.h> header file. */ -+/* #undef HAVE_LIBXML_PARSER_H */ -+ -+/* Define to 1 if you have the <libxml/SAX2.h> header file. */ -+/* #undef HAVE_LIBXML_SAX2_H */ -+ -+/* Define to 1 if you have the <libxslt/xslt.h> header file. */ -+/* #undef HAVE_LIBXSLT_XSLT_H */ -+ -+/* Define to 1 if you have the <limits.h> header file. */ -+#define HAVE_LIMITS_H 1 -+ -+/* Define to 1 if you have the <math.h> header file. */ -+#define HAVE_MATH_H 1 -+ -+/* Define to 1 if you have the <memory.h> header file. */ -+#define HAVE_MEMORY_H 1 -+ -+/* Raptor raptor_parse_date available */ -+#define HAVE_RAPTOR_PARSE_DATE 1 -+ -+/* have round() in libm */ -+#define HAVE_ROUND 1 -+ -+/* Define to 1 if you have the <stdint.h> header file. */ -+#define HAVE_STDINT_H 1 -+ -+/* Define to 1 if you have the <stdlib.h> header file. */ -+#define HAVE_STDLIB_H 1 -+ -+/* Define to 1 if you have the `strcasecmp' function. */ -+#define HAVE_STRCASECMP 1 -+ -+/* Define to 1 if you have the `stricmp' function. */ -+#define HAVE_STRICMP 1 -+ -+/* Define to 1 if you have the <strings.h> header file. */ -+#define HAVE_STRINGS_H 1 -+ -+/* Define to 1 if you have the <string.h> header file. */ -+#define HAVE_STRING_H 1 -+ -+/* Define to 1 if you have the <sys/param.h> header file. */ -+#define HAVE_SYS_PARAM_H 1 -+ -+/* Define to 1 if you have the <sys/stat.h> header file. */ -+#define HAVE_SYS_STAT_H 1 -+ -+/* Define to 1 if you have the <sys/time.h> header file. */ -+#define HAVE_SYS_TIME_H 1 -+ -+/* Define to 1 if you have the <sys/types.h> header file. */ -+#define HAVE_SYS_TYPES_H 1 -+ -+/* have trunc() in libm */ -+#define HAVE_TRUNC 1 -+ -+/* Define to 1 if you have the <unistd.h> header file. */ -+#define HAVE_UNISTD_H 1 -+ -+/* Define to 1 if you have the `vsnprintf' function. */ -+#define HAVE_VSNPRINTF 1 -+ -+/* Define to 1 if you have the `xmlCtxtUseOptions' function. */ -+/* #undef HAVE_XMLCTXTUSEOPTIONS */ -+ -+/* Define to 1 if you have the <xmlparse.h> header file. */ -+/* #undef HAVE_XMLPARSE_H */ -+ -+/* Define to 1 if you have the `xmlSAX2InternalSubset' function. */ -+/* #undef HAVE_XMLSAX2INTERNALSUBSET */ -+ -+/* need 'extern int optind' declaration? */ -+/* #undef NEED_OPTIND_DECLARATION */ -+ -+/* Name of package */ -+#define PACKAGE "raptor" -+ -+/* Define to the address where bug reports for this package should be sent. */ -+#define PACKAGE_BUGREPORT "http://bugs.librdf.org/" -+ -+/* Define to the full name of this package. */ -+#define PACKAGE_NAME "Raptor RDF Parser" -+ -+/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "Raptor RDF Parser 1.4.17" -+ -+/* Define to the one symbol short name of this package. */ -+#define PACKAGE_TARNAME "raptor" -+ -+/* Define to the version of this package. */ -+#define PACKAGE_VERSION "1.4.17" -+ -+/* does libxml struct xmlEntity have a field etype */ -+/* #undef RAPTOR_LIBXML_ENTITY_ETYPE */ -+ -+/* does libxml struct xmlEntity have a field name_length */ -+/* #undef RAPTOR_LIBXML_ENTITY_NAME_LENGTH */ -+ -+/* does libxml have HTML_PARSE_NONET */ -+/* #undef RAPTOR_LIBXML_HTML_PARSE_NONET */ -+ -+/* does libxml xmlSAXHandler have externalSubset field */ -+/* #undef RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET */ -+ -+/* does libxml xmlSAXHandler have initialized field */ -+/* #undef RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED */ -+ -+/* does libxml have XML_PARSE_NONET */ -+/* #undef RAPTOR_LIBXML_XML_PARSE_NONET */ -+ -+/* Provide a Unicode NFC check */ -+#define RAPTOR_NFC_CHECK 1 -+ -+/* Building GRDDL parser */ -+/* #undef RAPTOR_PARSER_GRDDL */ -+ -+/* Building guess parser */ -+#define RAPTOR_PARSER_GUESS 1 -+ -+/* Building Notation 3 parser */ -+/* #undef RAPTOR_PARSER_N3 */ -+ -+/* Building N-Triples parser */ -+#define RAPTOR_PARSER_NTRIPLES 1 -+ -+/* Building RDF/XML parser */ -+#define RAPTOR_PARSER_RDFXML 1 -+ -+/* Building RSS Tag Soup parser */ -+#define RAPTOR_PARSER_RSS 1 -+ -+/* Building TRiG parser */ -+#define RAPTOR_PARSER_TRIG 1 -+ -+/* Building Turtle parser */ -+#define RAPTOR_PARSER_TURTLE 1 -+ -+/* Building Atom 1.0 serializer */ -+/* #undef RAPTOR_SERIALIZER_ATOM */ -+ -+/* Building GraphViz DOT serializer */ -+//#define RAPTOR_SERIALIZER_DOT 1 -+ -+/* Building JSON serializer */ -+//#define RAPTOR_SERIALIZER_JSON 1 -+ -+/* Building N-Triples serializer */ -+#define RAPTOR_SERIALIZER_NTRIPLES 1 -+ -+/* Building RDF/XML serializer */ -+#define RAPTOR_SERIALIZER_RDFXML 1 -+ -+/* Building RDF/XML-abbreviated serializer */ -+#define RAPTOR_SERIALIZER_RDFXML_ABBREV 1 -+ -+/* Building RSS 1.0 serializer */ -+#define RAPTOR_SERIALIZER_RSS_1_0 1 -+ -+/* Building Turtle serializer */ -+//#define RAPTOR_SERIALIZER_TURTLE 1 -+ -+/* Release version as a decimal */ -+#define RAPTOR_VERSION_DECIMAL 10417 -+ -+/* Major version number */ -+#define RAPTOR_VERSION_MAJOR 1 -+ -+/* Minor version number */ -+#define RAPTOR_VERSION_MINOR 4 -+ -+/* Release version number */ -+#define RAPTOR_VERSION_RELEASE 17 -+ -+/* Have libcurl WWW library */ -+/* #undef RAPTOR_WWW_LIBCURL */ -+ -+/* Have libfetch WWW library */ -+/* #undef RAPTOR_WWW_LIBFETCH */ -+ -+/* Have libxml available as a WWW library */ -+/* #undef RAPTOR_WWW_LIBXML */ -+ -+/* No WWW library */ -+#define RAPTOR_WWW_NONE 1 -+ -+/* Check XML 1.1 Names */ -+/* #undef RAPTOR_XML_1_1 */ -+ -+/* Use expat XML parser */ -+//#define RAPTOR_XML_EXPAT 1 -+ -+/* Use libxml XML parser */ -+/* #undef RAPTOR_XML_LIBXML */ -+ -+/* The size of `unsigned char', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_CHAR 1 -+ -+/* The size of `unsigned int', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_INT 4 -+ -+/* The size of `unsigned long', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_LONG 4 -+ -+/* The size of `unsigned short', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_SHORT 2 -+ -+/* Define to 1 if you have the ANSI C header files. */ -+#define STDC_HEADERS 1 -+ -+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -+#define TIME_WITH_SYS_TIME 1 -+ -+/* Version number of package */ -+#define VERSION "1.4.17" -+ -+/* Define to 1 if your processor stores words with the most significant byte -+ first (like Motorola and SPARC, unlike Intel and VAX). */ -+/* #undef WORDS_BIGENDIAN */ -+ -+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a -+ `char[]'. */ -+/* #undef YYTEXT_POINTER */ -+ -+/* Define to empty if `const' does not conform to ANSI C. */ -+/* #undef const */ -+ -+/* For using libxml2 on win32 */ -+#define RAPTOR_XML_LIBXML -+#define HAVE_LIBXML_XMLREADER_H -+#define HAVE_LIBXML_HASH_H 1 -+#define HAVE_LIBXML_HTMLPARSER_H 1 -+#define HAVE_LIBXML_NANOHTTP_H 1 -+#define HAVE_LIBXML_PARSER_H 1 -+#define HAVE_LIBXSLT_XSLT_H 1 -+ -+#define RAPTOR_LIBXML_HTML_PARSE_NONET 1 -+#define RAPTOR_LIBXML_XML_PARSE_NONET 1 -+ -+/* does libxml struct xmlEntity have a field etype */ -+#define RAPTOR_LIBXML_ENTITY_ETYPE -+ -+/* does libxml struct xmlEntity have a field name_length */ -+/*#define RAPTOR_LIBXML_ENTITY_NAME_LENGTH*/ -+ -+/* Define to 1 if you have the `xmlCtxtUseOptions' function. */ -+#define HAVE_XMLCTXTUSEOPTIONS 1 -+ -+/* Define to 1 if you have the `xmlSAX2InternalSubset' function. */ -+#define HAVE_XMLSAX2INTERNALSUBSET 1 -+ -+/* does libxml xmlSAXHandler have externalSubset field */ -+#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET 1 -+ -+/* does libxml xmlSAXHandler have initialized field */ -+#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED 1 diff --git a/redland/raptor/makefile.mk b/redland/raptor/makefile.mk index 12479a3..62d4f70 100644 --- a/redland/raptor/makefile.mk +++ b/redland/raptor/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.7 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -48,22 +44,43 @@ all: .INCLUDE : ../redlandversion.mk -RAPTORVERSION=$(RAPTOR_MAJOR).4.17 +RAPTORVERSION=$(RAPTOR_MAJOR).4.18 TARFILE_NAME=raptor-$(RAPTORVERSION) -PATCH_FILES=..$/$(TARFILE_NAME).patch +TARFILE_MD5=284e768eeda0e2898b0d5bf7e26a016e ADDITIONAL_FILES=src/makefile.mk src/raptor_config.h +OOO_PATCH_FILES= \ + $(TARFILE_NAME).patch.legal \ + $(TARFILE_NAME).patch.autotools \ + $(TARFILE_NAME).patch.ooo_build \ + $(TARFILE_NAME).patch.dmake \ + $(TARFILE_NAME).patch.win32 \ + + +PATCH_FILES=$(OOO_PATCH_FILES) + + .IF "$(OS)"=="OS2" BUILD_ACTION=dmake BUILD_DIR=$(CONFIGURE_DIR)$/src - .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" +OOO_PATCH_FILES+=$(TARFILE_NAME).patch.mingw +raptor_CC=$(CC) -mthreads +.IF "$(MINGW_SHARED_GCCLIB)"=="YES" +raptor_CC+=-shared-libgcc +.ENDIF +raptor_LIBS= +.IF "$(MINGW_SHARED_GXXLIB)"=="YES" +raptor_LIBS+=-lstdc++_s +.ENDIF + CONFIGURE_DIR= CONFIGURE_ACTION=.$/configure -CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CFLAGS=-D_MT CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols -L$(ILIB:s/;/ -L/)" LIBS=-lmingwthrd OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) ZLIB3RDLIB=$(ZLIB3RDLIB) XSLTLIB="$(XSLTLIB)" +# do not enable grddl parser (#i93768#) +CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --with-xml-parser=libxml --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(raptor_CC)" CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2,--export-all-symbols -L$(ILIB:s/;/ -L/)" LIBS="$(raptor_LIBS)" OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) XSLTLIB="$(XSLTLIB)" BUILD_ACTION=$(GNUMAKE) BUILD_FLAGS+= -j$(EXTMAXPROCESS) BUILD_DIR=$(CONFIGURE_DIR) @@ -98,19 +115,19 @@ LDFLAGS+:=-L$(SYSBASE)$/lib -L$(SYSBASE)$/usr$/lib -lpthread -ldl .ENDIF .ENDIF # "$(SYSBASE)"!="" -CPPFLAGS+:=$(EXTRA_CFLAGS) +CPPFLAGS+:=$(EXTRA_CDEFS) $(EXTRA_CFLAGS) LDFLAGS+:=$(EXTRA_LINKFLAGS) -XSLTLIB!:=$(XSLTLIB) # expand variable for (internal) xslt-config +XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config .EXPORT: CPPFLAGS .EXPORT: LDFLAGS .EXPORT: LIBXML2LIB -.EXPORT: ZLIB3RDLIB .EXPORT: XSLTLIB CONFIGURE_DIR= CONFIGURE_ACTION=.$/configure -CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml +# do not enable grddl parser (#i93768#) +CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml BUILD_ACTION=$(GNUMAKE) BUILD_FLAGS+= -j$(EXTMAXPROCESS) BUILD_DIR=$(CONFIGURE_DIR) @@ -122,7 +139,7 @@ BUILD_DIR=$(CONFIGURE_DIR) OUT2INC+=src$/raptor.h .IF "$(OS)"=="MACOSX" -OUT2LIB+=src$/.libs$/libraptor.1.dylib src$/.libs$/libraptor.dylib +OUT2LIB+=src$/.libs$/libraptor.$(RAPTOR_MAJOR).dylib src$/.libs$/libraptor.dylib OUT2BIN+=src/raptor-config .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" @@ -132,12 +149,10 @@ OUT2BIN+=src/raptor-config .ELSE # if we use dmake, this is done automagically .ENDIF - .ELIF "$(GUI)"=="OS2" # if we use dmake, this is done automagically - .ELSE -OUT2LIB+=src$/.libs$/libraptor.so.1 src$/.libs$/libraptor.so +OUT2LIB+=src$/.libs$/libraptor.so.$(RAPTOR_MAJOR) src$/.libs$/libraptor.so OUT2BIN+=src/raptor-config .ENDIF diff --git a/redland/raptor/raptor-1.4.18.patch.autotools b/redland/raptor/raptor-1.4.18.patch.autotools new file mode 100644 index 0000000..4b43def --- /dev/null +++ b/redland/raptor/raptor-1.4.18.patch.autotools @@ -0,0 +1,46 @@ +--- misc/raptor-1.4.18/configure Sun Jun 15 10:25:55 2008 ++++ misc/build/raptor-1.4.18/configure Wed Feb 18 13:23:12 2009 +@@ -4321,7 +4321,7 @@ + + cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +@@ -4330,7 +4330,7 @@ + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' +--- misc/raptor-1.4.18/ltmain.sh 2008-02-02 22:28:24.000000000 +0900 ++++ misc/build/raptor-1.4.18/ltmain.sh 2008-07-08 11:58:42.000000000 +0900 +@@ -3262,9 +3262,9 @@ + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) +- current="$number_major" +- revision="$number_minor" +- age="0" ++ current=`expr $number_major + $number_minor` ++ age="$number_minor" ++ revision="$number_revision" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` +@@ -3344,8 +3344,8 @@ + ;; + + freebsd-elf) +- major=".$current" +- versuffix=".$current"; ++ major=.`expr $current - $age` ++ versuffix="$major.$age.$revision" + ;; + + irix | nonstopux) diff --git a/redland/raptor/raptor-1.4.18.patch.dmake b/redland/raptor/raptor-1.4.18.patch.dmake new file mode 100644 index 0000000..b017275 --- /dev/null +++ b/redland/raptor/raptor-1.4.18.patch.dmake @@ -0,0 +1,124 @@ +--- misc/raptor-1.4.18/src/makefile.mk Thu Nov 6 15:25:51 2008 ++++ misc/build/raptor-1.4.18/src/makefile.mk Thu Nov 6 15:33:14 2008 +@@ -1,1 +1,119 @@ +-dummy ++#************************************************************************* ++# ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++# ++# Copyright 2000, 2010 Oracle and/or its affiliates. ++# ++# OpenOffice.org - a multi-platform office productivity suite ++# ++# This file is part of OpenOffice.org. ++# ++# OpenOffice.org is free software: you can redistribute it and/or modify ++# it under the terms of the GNU Lesser General Public License version 3 ++# only, as published by the Free Software Foundation. ++# ++# OpenOffice.org 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 Lesser General Public License version 3 for more details ++# (a copy is included in the LICENSE file that accompanied this code). ++# ++# You should have received a copy of the GNU Lesser General Public License ++# version 3 along with OpenOffice.org. If not, see ++# <http://www.openoffice.org/license.html> ++# for a copy of the LGPLv3 License. ++# ++#************************************************************************* ++ ++PRJ=..$/..$/..$/..$/.. ++ ++PRJNAME=redland ++TARGET=raptor ++LIBTARGET=NO ++UWINAPIDLL= ++ ++EXTERNAL_WARNINGS_NOT_ERRORS=TRUE ++UWINAPILIB= ++ ++ ++# --- Settings ----------------------------------------------------- ++ ++.INCLUDE : settings.mk ++ ++CDEFS+=-DRAPTOR_INTERNAL -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS ++ ++# --- Files -------------------------------------------------------- ++ ++SLOFILES = \ ++ $(SLO)$/n3_lexer.obj \ ++ $(SLO)$/n3_parser.obj \ ++ $(SLO)$/ntriples_parse.obj \ ++ $(SLO)$/parsedate.obj \ ++ $(SLO)$/raptor_feature.obj \ ++ $(SLO)$/raptor_general.obj \ ++ $(SLO)$/raptor_guess.obj \ ++ $(SLO)$/raptor_identifier.obj \ ++ $(SLO)$/raptor_iostream.obj \ ++ $(SLO)$/raptor_libxml.obj \ ++ $(SLO)$/raptor_locator.obj \ ++ $(SLO)$/raptor_namespace.obj \ ++ $(SLO)$/raptor_nfc.obj \ ++ $(SLO)$/raptor_nfc_data.obj \ ++ $(SLO)$/raptor_parse.obj \ ++ $(SLO)$/raptor_qname.obj \ ++ $(SLO)$/raptor_rdfxml.obj \ ++ $(SLO)$/raptor_rfc2396.obj \ ++ $(SLO)$/raptor_rss.obj \ ++ $(SLO)$/raptor_rss_common.obj \ ++ $(SLO)$/raptor_sax2.obj \ ++ $(SLO)$/raptor_sequence.obj \ ++ $(SLO)$/raptor_serialize.obj \ ++ $(SLO)$/raptor_serialize_ntriples.obj \ ++ $(SLO)$/raptor_serialize_rdfxml.obj \ ++ $(SLO)$/raptor_serialize_rdfxmla.obj \ ++ $(SLO)$/raptor_serialize_simple.obj \ ++ $(SLO)$/raptor_set.obj \ ++ $(SLO)$/raptor_stringbuffer.obj \ ++ $(SLO)$/raptor_uri.obj \ ++ $(SLO)$/raptor_utf8.obj \ ++ $(SLO)$/raptor_win32.obj \ ++ $(SLO)$/raptor_www.obj \ ++ $(SLO)$/raptor_www_libxml.obj \ ++ $(SLO)$/raptor_xml.obj \ ++ $(SLO)$/raptor_xml_writer.obj \ ++ $(SLO)$/raptor_xsd.obj \ ++ $(SLO)$/raptor_strcasecmp.obj \ ++ $(SLO)$/turtle_common.obj \ ++ $(SLO)$/turtle_lexer.obj \ ++ $(SLO)$/turtle_parser.obj \ ++ $(SLO)$/raptor_abbrev.obj \ ++ $(SLO)$/raptor_avltree.obj \ ++ $(SLO)$/raptor_statement.obj \ ++ $(SLO)$/raptor_turtle_writer.obj \ ++ ++# $(SLO)$/raptor_grddl.obj \ ++# $(SLO)$/raptor_serialize_rss.obj \ ++ ++ ++SHL1DEPN= makefile.mk ++SHL1OBJS= $(SLOFILES) ++SHL1USE_EXPORTS=name ++ ++#SHL1TARGET= $(TARGET)$(DLLPOSTFIX) ++SHL1TARGET= $(TARGET) ++SHL1IMPLIB= lib$(TARGET) ++ ++#SHL1VERSIONMAP=../service/exports.map ++SHL1DEF=$(MISC)$/$(SHL1TARGET).def ++DEF1NAME=$(SHL1TARGET) ++ ++SHL1STDLIBS= \ ++ $(LIBXML2LIB) \ ++ $(XSLTLIB) \ ++ ++# --- Targets ------------------------------------------------------ ++ ++.INCLUDE : target.mk ++ ++$(MISC)$/raptor_strcasecmp.c : strcasecmp.c ++ $(COPY) $< $@ ++ diff --git a/redland/raptor/raptor-1.4.18.patch.legal b/redland/raptor/raptor-1.4.18.patch.legal new file mode 100644 index 0000000..217b7d1 --- /dev/null +++ b/redland/raptor/raptor-1.4.18.patch.legal @@ -0,0 +1,18 @@ +--- misc/raptor-1.4.18/LICENSE.txt Sun Mar 30 06:52:22 2008 ++++ misc/build/raptor-1.4.18/LICENSE.txt Mon Jun 16 15:55:38 2008 +@@ -60,3 +60,15 @@ + + Copyright (C) 2000-2008 David Beckett + Copyright (C) 2000-2005 University of Bristol ++ ++ ++LGPL Disclaimer ++ ++For the avoidance of doubt, except that if any license choice other ++than GPL or LGPL is available it will apply instead, Sun elects to ++use only the Lesser General Public License version 2.1 (LGPLv2) at ++this time for any software where a choice of LGPL license versions ++is made available with the language indicating that LGPLv2.1 or any ++later version may be used, or where a choice of which version of the ++LGPL is applied is otherwise unspecified. ++ diff --git a/redland/raptor/raptor-1.4.18.patch.mingw b/redland/raptor/raptor-1.4.18.patch.mingw new file mode 100644 index 0000000..e29a0a0 --- /dev/null +++ b/redland/raptor/raptor-1.4.18.patch.mingw @@ -0,0 +1,30 @@ +--- misc/raptor-1.4.18/configure 2008-06-15 17:25:55.000000000 +0900 ++++ misc/build/raptor-1.4.18/configure 2009-06-04 21:10:22.447125000 +0900 +@@ -25238,6 +25238,12 @@ + rdfa_parser=yes + + rdf_parsers_available="rdfxml ntriples turtle trig guess rss-tag-soup rdfa" ++case $host_os in ++mingw*) ++ rdfa_parser=no ++ rdf_parsers_available="rdfxml ntriples turtle trig guess rss-tag-soup" ++ ;; ++esac + if test "$USE_MAINTAINER_MODE" = yes; then + rdf_parsers_available="$rdf_parsers_available n3" + fi +--- misc/raptor-1.4.18/configure.ac 2008-06-15 17:25:20.000000000 +0900 ++++ misc/build/raptor-1.4.18/configure.ac 2009-06-04 21:10:31.025250000 +0900 +@@ -758,6 +758,12 @@ + rdfa_parser=yes + + rdf_parsers_available="rdfxml ntriples turtle trig guess rss-tag-soup rdfa" ++case $host_os in ++mingw*) ++ rdfa_parser=no ++ rdf_parsers_available="rdfxml ntriples turtle trig guess rss-tag-soup" ++ ;; ++esac + if test "$USE_MAINTAINER_MODE" = yes; then + rdf_parsers_available="$rdf_parsers_available n3" + fi diff --git a/redland/raptor/raptor-1.4.18.patch.ooo_build b/redland/raptor/raptor-1.4.18.patch.ooo_build new file mode 100644 index 0000000..a168785 --- /dev/null +++ b/redland/raptor/raptor-1.4.18.patch.ooo_build @@ -0,0 +1,43 @@ +--- misc/raptor-1.4.18/src/raptor-config.in Sat Jan 6 05:02:00 2007 ++++ misc/build/raptor-1.4.18/src/raptor-config.in Mon Jun 16 15:55:38 2008 +@@ -21,14 +21,23 @@ + # + # + +-prefix=@prefix@ +-exec_prefix=@exec_prefix@ ++prefix=${SOLARVERSION}/${INPATH} ++exec_prefix=${SOLARVERSION}/${INPATH} ++#includedir=${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/external ++#libdir=${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT} ++# HACK: map to build directory ++includedir=../../../../inc ++libdir=../../../../lib ++includes=-I${includedir} + +-if test "@includedir@" != /usr/include ; then +- includes="-I@includedir@" +-else +- includes= +-fi ++#prefix=@prefix@ ++#exec_prefix=@exec_prefix@ ++# ++#if test "@includedir@" != /usr/include ; then ++# includes="-I@includedir@" ++#else ++# includes= ++#fi + + + usage() +@@ -130,7 +139,8 @@ + done + fi + if test "$echo_libs" = "yes"; then +- echo -L@libdir@ -lraptor ++# echo -L@libdir@ -lraptor ++ echo -L${libdir} -lraptor + fi + if test "$echo_libtool_libs" = "yes"; then + echo @libdir@/@RAPTOR_LIBTOOLLIBS@ diff --git a/redland/raptor/raptor-1.4.18.patch.win32 b/redland/raptor/raptor-1.4.18.patch.win32 new file mode 100644 index 0000000..8de0d25 --- /dev/null +++ b/redland/raptor/raptor-1.4.18.patch.win32 @@ -0,0 +1,78 @@ +--- misc/raptor-1.4.18/src/win32_raptor_config.h Wed Apr 2 06:50:14 2008 ++++ misc/build/raptor-1.4.18/src/win32_raptor_config.h Wed Feb 18 13:21:23 2009 +@@ -38,6 +38,8 @@ + + #define HAVE_STDLIB_H 1 + ++#define HAVE_ERRNO_H 1 ++ + #if 0 + /* For using expat on win32 */ + #define RAPTOR_XML_EXPAT 1 +@@ -47,8 +49,17 @@ + /* For using libxml2 on win32 */ + #define RAPTOR_XML_LIBXML + #define HAVE_LIBXML_XMLREADER_H ++#define HAVE_LIBXML_HASH_H 1 ++#define HAVE_LIBXML_HTMLPARSER_H 1 ++#define HAVE_LIBXML_NANOHTTP_H 1 ++#define HAVE_LIBXML_PARSER_H 1 ++#define HAVE_LIBXSLT_XSLT_H 1 ++ ++#define RAPTOR_LIBXML_HTML_PARSE_NONET 1 ++#define RAPTOR_LIBXML_XML_PARSE_NONET 1 ++ + /* does libxml struct xmlEntity have a field etype */ +-/*#define RAPTOR_LIBXML_ENTITY_ETYPE*/ ++#define RAPTOR_LIBXML_ENTITY_ETYPE + + /* does libxml struct xmlEntity have a field name_length */ + /*#define RAPTOR_LIBXML_ENTITY_NAME_LENGTH*/ +@@ -60,16 +71,17 @@ + #define HAVE_XMLSAX2INTERNALSUBSET 1 + + /* does libxml xmlSAXHandler have externalSubset field */ +-/*#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET*/ ++#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET 1 + + /* does libxml xmlSAXHandler have initialized field */ +-/*#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED*/ ++#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED 1 + #endif + + #define HAVE_STRICMP 1 + + /* MS names for these functions */ +-#define vsnprintf _vsnprintf ++// next line breaks build on wntmsci12 ++//#define vsnprintf _vsnprintf + #define snprintf _snprintf + #define access _access + #define stricmp _stricmp +@@ -113,19 +125,23 @@ + #endif + + #define RAPTOR_PARSER_GUESS 1 +-#define RAPTOR_PARSER_GRDDL 1 ++/* #define RAPTOR_PARSER_GRDDL 1 disabled: (#i93768#) */ ++#ifndef __MINGW32__ /* conflicts with normal configure result */ + #define RAPTOR_PARSER_N3 1 ++#endif + #define RAPTOR_PARSER_TURTLE 1 + #define RAPTOR_PARSER_NTRIPLES 1 + #define RAPTOR_PARSER_RDFXML 1 + ++/* does not build on wntmsci12 due to gettimeofday + #define RAPTOR_SERIALIZER_ATOM 1 +-#define RAPTOR_SERIALIZER_RSS_1_0 1 ++#define RAPTOR_SERIALIZER_RSS_1_0 1 */ + #define RAPTOR_SERIALIZER_RDFXML 1 + #define RAPTOR_SERIALIZER_RDFXML_ABBREV 1 + #define RAPTOR_SERIALIZER_NTRIPLES 1 + +-#define RAPTOR_WWW_LIBCURL 1 ++//#define RAPTOR_WWW_LIBCURL 1 ++#define RAPTOR_WWW_LIBXML 1 + + + #include <windows.h> diff --git a/redland/raptor/raptor2.map b/redland/raptor/raptor2.map index 8c0cb81..109a74b 100644 --- a/redland/raptor/raptor2.map +++ b/redland/raptor/raptor2.map @@ -1,4 +1,4 @@ -RAPTOR2 { +UDK_3_0_0 { global: GetVersionInfo; raptor_ntriples_string_as_utf8_string; diff --git a/redland/rasqal-0.9.15.patch b/redland/rasqal-0.9.15.patch deleted file mode 100644 index 67261f6..0000000 --- a/redland/rasqal-0.9.15.patch +++ /dev/null @@ -1,419 +0,0 @@ ---- misc/rasqal-0.9.15/LICENSE.txt Sun Apr 22 23:09:08 2007 -+++ misc/build/rasqal-0.9.15/LICENSE.txt Mon Jun 16 15:55:45 2008 -@@ -61,3 +61,15 @@ - - Copyright (C) 2003-2007 Dave Beckett - Copyright (C) 2003-2005 University of Bristol -+ -+ -+LGPL Disclaimer -+ -+For the avoidance of doubt, except that if any license choice other -+than GPL or LGPL is available it will apply instead, Sun elects to -+use only the Lesser General Public License version 2.1 (LGPLv2) at -+this time for any software where a choice of LGPL license versions -+is made available with the language indicating that LGPLv2.1 or any -+later version may be used, or where a choice of which version of the -+LGPL is applied is otherwise unspecified. -+ ---- misc/rasqal-0.9.15/src/makefile.mk Mon Jun 16 19:30:20 2008 -+++ misc/build/rasqal-0.9.15/src/makefile.mk Mon Jun 16 19:25:48 2008 -@@ -1,1 +1,102 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile: rasqal-0.9.15.patch,v $ -+# -+# $Revision: 1.2.6.2 $ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+PRJ=..$/..$/..$/..$/.. -+ -+PRJNAME=redland -+TARGET=rasqal -+LIBTARGET=NO -+ -+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE -+ -+ -+# --- Settings ----------------------------------------------------- -+ -+.INCLUDE : settings.mk -+ -+.IF "$(GUI)"=="OS2" -+CDEFS+=-DRASQAL_INTERNAL -DHAVE_CONFIG_H -DNDEBUG -D_MT -+.ELSE -+CDEFS+=-DRASQAL_INTERNAL -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS -D_MT -+.ENDIF -+ -+# --- Files -------------------------------------------------------- -+ -+SLOFILES = \ -+ $(SLO)$/rasqal_datetime.obj \ -+ $(SLO)$/rasqal_decimal.obj \ -+ $(SLO)$/rasqal_engine.obj \ -+ $(SLO)$/rasqal_expr.obj \ -+ $(SLO)$/rasqal_feature.obj \ -+ $(SLO)$/rasqal_general.obj \ -+ $(SLO)$/rasqal_graph_pattern.obj \ -+ $(SLO)$/rasqal_literal.obj \ -+ $(SLO)$/rasqal_map.obj \ -+ $(SLO)$/rasqal_query_results.obj \ -+ $(SLO)$/rasqal_query.obj \ -+ $(SLO)$/rasqal_raptor.obj \ -+ $(SLO)$/rasqal_result_formats.obj \ -+ $(SLO)$/rasqal_xsd_datatypes.obj \ -+ $(SLO)$/rdql_lexer.obj \ -+ $(SLO)$/rdql_parser.obj \ -+ $(SLO)$/sparql_lexer.obj \ -+ $(SLO)$/sparql_parser.obj \ -+ $(SLO)$/strcasecmp.obj \ -+ -+ -+# $(SLO)$/rasqal_redland.obj \ -+ -+SHL1DEPN= makefile.mk -+SHL1OBJS= $(SLOFILES) -+SHL1USE_EXPORTS=name -+ -+#SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -+SHL1TARGET= $(TARGET) -+SHL1IMPLIB= lib$(TARGET) -+ -+#SHL1VERSIONMAP=../service/exports.map -+.IF "$(GUI)"=="OS2" -+SHL1VERSIONMAP=$(PRJ)$/rasqal$/rasqal2.map -+.ENDIF -+SHL1DEF=$(MISC)$/$(SHL1TARGET).def -+DEF1NAME=$(SHL1TARGET) -+ -+SHL1STDLIBS= \ -+ $(PRJ)$/$(INPATH)$/lib$/libraptor.lib \ -+ -+ -+#$(LIBXML2LIB) \ -+# $(XSLTLIB) \ -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk -+ ---- misc/rasqal-0.9.15/src/rasqal-config.in Sun Apr 22 22:58:51 2007 -+++ misc/build/rasqal-0.9.15/src/rasqal-config.in Mon Jun 16 15:55:45 2008 -@@ -22,13 +22,22 @@ - # - # - --prefix=@prefix@ -+prefix=${SOLARVERSION}/${INPATH} -+exec_prefix=${SOLARVERSION}/${INPATH} -+#includedir=${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/external -+#libdir=${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT} -+# HACK: map to build directory -+includedir=../../../../inc -+libdir=../../../../lib -+includes=-I${includedir} - --if test "@includedir@" != /usr/include ; then -- includes="-I@includedir@" --else -- includes= --fi -+#prefix=@prefix@ -+# -+#if test "@includedir@" != /usr/include ; then -+# includes="-I@includedir@" -+#else -+# includes= -+#fi - - - usage() -@@ -109,7 +118,8 @@ - echo $includes - fi - if test "$echo_libs" = "yes"; then -- echo -L@libdir@ -lrasqal -+# echo -L@libdir@ -lrasqal -+ echo -L${libdir} -lrasqal - fi - if test "$echo_libtool_libs" = "yes"; then - echo @libdir@/@RASQAL_LIBTOOLLIBS@ ---- misc/rasqal-0.9.15/src/win32_rasqal_config.h Mon Apr 23 09:18:27 2007 -+++ misc/build/rasqal-0.9.15/src/win32_rasqal_config.h Mon Jun 16 15:55:45 2008 -@@ -39,10 +39,13 @@ - - #define HAVE_STDLIB_H 1 - -+#define HAVE_ERRNO_H 1 -+ - #define HAVE_STRICMP 1 - - /* MS names for these functions */ --#define vsnprintf _vsnprintf -+// next line breaks build on wntmsci12 -+//#define vsnprintf _vsnprintf - #define snprintf _snprintf - #define access _access - #define stricmp _stricmp -@@ -87,6 +90,9 @@ - #include <io.h> - #include <memory.h> - -+// argh! stupid winnt.h... -+#undef DELETE -+ - /* This is a SPARQL token define */ - #ifdef OPTIONAL - #undef OPTIONAL -@@ -118,8 +124,14 @@ - /* #define RAPTOR_TRIPLES_SOURCE_REDLAND 1 */ - - /* Use PCRE regex library */ --#define RASQAL_REGEX_PCRE 1 -+//#define RASQAL_REGEX_PCRE 1 - -+#define HAVE_LIBXML_SCHEMASINTERNALS_H 1 -+#define HAVE_LIBXML_XMLSCHEMASTYPES_H 1 -+#define HAVE_LIBXML_XMLSCHEMAS_H 1 -+ -+#define RASQAL_DECIMAL_NONE 1 -+ - #ifdef _DEBUG - #define RASQAL_DEBUG 1 - #endif ---- misc/rasqal-0.9.15/ltmain.sh 2006-03-12 03:49:04.000000000 +0900 -+++ misc/build/rasqal-0.9.15/ltmain.sh 2008-07-06 14:30:56.975375000 +0900 -@@ -1518,6 +1518,11 @@ - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` -+ case $host_os in -+ mingw*) -+ absdir=`cygpath -m $absdir` -+ ;; -+ esac - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" -@@ -3195,9 +3200,9 @@ - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) -- current="$number_major" -- revision="$number_minor" -- age="0" -+ current=`expr $number_major + $number_minor` -+ age="$number_minor" -+ revision="$number_revision" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` -@@ -3275,8 +3280,8 @@ - ;; - - freebsd-elf) -- major=".$current" -- versuffix=".$current"; -+ major=.`expr $current - $age` -+ versuffix="$major.$age.$revision" - ;; - - irix | nonstopux) ---- misc/rasqal-0.9.15/src/rasqal_config.h Fri Dec 26 00:18:44 2008 -+++ misc/build/rasqal-0.9.15/src/rasqal_config.h Wed Nov 26 23:35:40 2008 -@@ -1 +1,169 @@ --dummy -+/* src/rasqal_config.h. Generated from rasqal_config.h.in by configure. */ -+/* src/rasqal_config.h.in. Generated from configure.ac by autoheader. */ -+ -+/* Define to 1 if you have the <dlfcn.h> header file. */ -+#define HAVE_DLFCN_H 1 -+ -+/* Define to 1 if you have the <dmalloc.h> header file. */ -+/* #undef HAVE_DMALLOC_H */ -+ -+/* Define to 1 if you have the <errno.h> header file. */ -+#define HAVE_ERRNO_H 1 -+ -+/* Define to 1 if you have the `getopt' function. */ -+#define HAVE_GETOPT 1 -+ -+/* Define to 1 if you have the <getopt.h> header file. */ -+#define HAVE_GETOPT_H 1 -+ -+/* Define to 1 if you have the `getopt_long' function. */ -+#define HAVE_GETOPT_LONG 1 -+ -+/* Define to 1 if you have the <gmp.h> header file. */ -+#define HAVE_GMP_H 1 -+ -+/* Define to 1 if you have the <inttypes.h> header file. */ -+#define HAVE_INTTYPES_H 1 -+ -+/* Define to 1 if you have the <libxml/schemasInternals.h> header file. */ -+/* #undef HAVE_LIBXML_SCHEMASINTERNALS_H */ -+ -+/* Define to 1 if you have the <libxml/xmlschemastypes.h> header file. */ -+/* #undef HAVE_LIBXML_XMLSCHEMASTYPES_H */ -+ -+/* Define to 1 if you have the <libxml/xmlschemas.h> header file. */ -+/* #undef HAVE_LIBXML_XMLSCHEMAS_H */ -+ -+/* Define to 1 if you have the <memory.h> header file. */ -+#define HAVE_MEMORY_H 1 -+ -+/* Define to 1 if you have the <mpfr.h> header file. */ -+/* #undef HAVE_MPFR_H */ -+ -+/* Define to 1 if you have the <regex.h> header file. */ -+#define HAVE_REGEX_H 1 -+ -+/* have PCRE regex - Perl Compatible Regular Expressions */ -+#define HAVE_REGEX_PCRE 1 -+ -+/* Define to 1 if you have the `srandomdev' function. */ -+#define HAVE_SRANDOMDEV 1 -+ -+/* Define to 1 if you have the <stdint.h> header file. */ -+#define HAVE_STDINT_H 1 -+ -+/* Define to 1 if you have the <stdlib.h> header file. */ -+#define HAVE_STDLIB_H 1 -+ -+/* Define to 1 if you have the `strcasecmp' function. */ -+#define HAVE_STRCASECMP 1 -+ -+/* Define to 1 if you have the `stricmp' function. */ -+#define HAVE_STRICMP 1 -+ -+/* Define to 1 if you have the <strings.h> header file. */ -+#define HAVE_STRINGS_H 1 -+ -+/* Define to 1 if you have the <string.h> header file. */ -+#define HAVE_STRING_H 1 -+ -+/* Define to 1 if you have the <sys/stat.h> header file. */ -+#define HAVE_SYS_STAT_H 1 -+ -+/* Define to 1 if you have the <sys/time.h> header file. */ -+#define HAVE_SYS_TIME_H 1 -+ -+/* Define to 1 if you have the <sys/types.h> header file. */ -+#define HAVE_SYS_TYPES_H 1 -+ -+/* Define to 1 if you have the <unistd.h> header file. */ -+#define HAVE_UNISTD_H 1 -+ -+/* Define to 1 if you have the `vsnprintf' function. */ -+#define HAVE_VSNPRINTF 1 -+ -+/* need 'extern int optind' declaration? */ -+/* #undef NEED_OPTIND_DECLARATION */ -+ -+/* Name of package */ -+#define PACKAGE "rasqal" -+ -+/* Define to the address where bug reports for this package should be sent. */ -+#define PACKAGE_BUGREPORT "http://bugs.librdf.org/" -+ -+/* Define to the full name of this package. */ -+#define PACKAGE_NAME "Rasqal RDF Query Library" -+ -+/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "Rasqal RDF Query Library 0.9.15" -+ -+/* Define to the one symbol short name of this package. */ -+#define PACKAGE_TARNAME "rasqal" -+ -+/* Define to the version of this package. */ -+#define PACKAGE_VERSION "0.9.15" -+ -+/* Use raptor to provide triples */ -+#define RAPTOR_TRIPLES_SOURCE_RAPTOR 1 -+ -+/* Use redland to provide triples */ -+/* #undef RAPTOR_TRIPLES_SOURCE_REDLAND */ -+ -+/* Decimal from GNU MP library */ -+/* #undef RASQAL_DECIMAL_GMP */ -+ -+/* Decimal from MPFR library */ -+/* #undef RASQAL_DECIMAL_MPFR */ -+ -+/* Decimal without a library */ -+#define RASQAL_DECIMAL_NONE 1 -+ -+/* Building LAQRS query */ -+/* #undef RASQAL_QUERY_LAQRS */ -+ -+/* Building RDQL query */ -+#define RASQAL_QUERY_RDQL 1 -+ -+/* Building SPARQL query */ -+#define RASQAL_QUERY_SPARQL 1 -+ -+/* Use no regex library */ -+/* #undef RASQAL_REGEX_NONE */ -+ -+/* Use PCRE regex library */ -+/* #undef RASQAL_REGEX_PCRE */ -+ -+/* Use posix regex library */ -+#define RASQAL_REGEX_POSIX 1 -+ -+/* Release version as a decimal */ -+#define RASQAL_VERSION_DECIMAL 915 -+ -+/* Major version number */ -+#define RASQAL_VERSION_MAJOR 0 -+ -+/* Minor version number */ -+#define RASQAL_VERSION_MINOR 9 -+ -+/* Release version number */ -+#define RASQAL_VERSION_RELEASE 15 -+ -+/* Define to 1 if you have the ANSI C header files. */ -+#define STDC_HEADERS 1 -+ -+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -+#define TIME_WITH_SYS_TIME 1 -+ -+/* Version number of package */ -+#define VERSION "0.9.15" -+ -+/* Define to 1 if your processor stores words with the most significant byte -+ first (like Motorola and SPARC, unlike Intel and VAX). */ -+/* #undef WORDS_BIGENDIAN */ -+ -+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a -+ `char[]'. */ -+/* #undef YYTEXT_POINTER */ -+ -+/* Define to empty if `const' does not conform to ANSI C. */ -+/* #undef const */ diff --git a/redland/rasqal/makefile.mk b/redland/rasqal/makefile.mk index e739671..efe099c 100644 --- a/redland/rasqal/makefile.mk +++ b/redland/rasqal/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -48,23 +44,40 @@ all: .INCLUDE : ../redlandversion.mk -RASQALVERSION=0.9.15 +RASQALVERSION=0.9.16 TARFILE_NAME=rasqal-$(RASQALVERSION) -PATCH_FILES=..$/$(TARFILE_NAME).patch +TARFILE_MD5=fca8706f2c4619e2fa3f8f42f8fc1e9d ADDITIONAL_FILES=src/makefile.mk src/rasqal_config.h +OOO_PATCH_FILES= \ + $(TARFILE_NAME).patch.legal \ + $(TARFILE_NAME).patch.autotools \ + $(TARFILE_NAME).patch.ooo_build \ + $(TARFILE_NAME).patch.dmake \ + $(TARFILE_NAME).patch.win32 + +PATCH_FILES=$(OOO_PATCH_FILES) + + .IF "$(OS)"=="OS2" -# there is no wntmsci build environment in the tarball; we use custom dmakefile BUILD_ACTION=dmake BUILD_DIR=$(CONFIGURE_DIR)$/src - .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" +rasqal_CC=$(CC) -mthreads +.IF "$(MINGW_SHARED_GCCLIB)"=="YES" +rasqal_CC+=-shared-libgcc +.ENDIF +rasqal_LIBS= +.IF "$(MINGW_SHARED_GXXLIB)"=="YES" +rasqal_LIBS+=-lstdc++_s +.ENDIF + CONFIGURE_DIR= CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH" -CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --disable-pcre --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CFLAGS=-D_MT CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols -L$(ILIB:s/;/ -L/)" LIBS=-lmingwthrd OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) ZLIB3RDLIB=$(ZLIB3RDLIB) XSLTLIB="$(XSLTLIB)" +CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --disable-pcre --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(rasqal_CC)" CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2,--export-all-symbols -L$(ILIB:s/;/ -L/)" LIBS="$(rasqal_LIBS)" OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) XSLTLIB="$(XSLTLIB)" BUILD_ACTION=$(GNUMAKE) BUILD_FLAGS+= -j$(EXTMAXPROCESS) BUILD_DIR=$(CONFIGURE_DIR) @@ -98,13 +111,14 @@ LDFLAGS+:=-L$(SYSBASE)$/lib -L$(SYSBASE)$/usr$/lib -lpthread -ldl .ENDIF .ENDIF # "$(SYSBASE)"!="" -CPPFLAGS+:=$(EXTRA_CFLAGS) +CPPFLAGS+:=$(EXTRA_CDEFS) $(EXTRA_CFLAGS) LDFLAGS+:=$(EXTRA_LINKFLAGS) +XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config .EXPORT: CPPFLAGS .EXPORT: LDFLAGS .EXPORT: LIBXML2LIB -.EXPORT: ZLIB3RDLIB +.EXPORT: XSLTLIB CONFIGURE_DIR= CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH" @@ -120,7 +134,7 @@ BUILD_DIR=$(CONFIGURE_DIR) OUT2INC+=src$/rasqal.h .IF "$(OS)"=="MACOSX" -OUT2LIB+=src$/.libs$/librasqal.0.dylib src$/.libs$/librasqal.dylib +OUT2LIB+=src$/.libs$/librasqal.$(RASQAL_MAJOR).dylib src$/.libs$/librasqal.dylib OUT2BIN+=src/rasqal-config .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" @@ -130,12 +144,10 @@ OUT2BIN+=src/rasqal-config .ELSE # if we use dmake, this is done automagically .ENDIF - .ELIF "$(OS)"=="OS2" # if we use dmake, this is done automagically - .ELSE -OUT2LIB+=src$/.libs$/librasqal.so.0 src$/.libs$/librasqal.so +OUT2LIB+=src$/.libs$/librasqal.so.$(RASQAL_MAJOR) src$/.libs$/librasqal.so OUT2BIN+=src/rasqal-config .ENDIF diff --git a/redland/rasqal/rasqal-0.9.16.patch.autotools b/redland/rasqal/rasqal-0.9.16.patch.autotools new file mode 100644 index 0000000..100499d --- /dev/null +++ b/redland/rasqal/rasqal-0.9.16.patch.autotools @@ -0,0 +1,38 @@ +--- misc/rasqal-0.9.16/ltmain.sh Tue Apr 29 23:33:55 2008 ++++ misc/build/rasqal-0.9.16/ltmain.sh Wed Feb 18 13:25:00 2009 +@@ -1565,6 +1565,11 @@ + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` ++ case $host_os in ++ mingw*) ++ absdir=`cygpath -m $absdir` ++ ;; ++ esac + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" +@@ -3262,9 +3267,9 @@ + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) +- current="$number_major" +- revision="$number_minor" +- age="0" ++ current=`expr $number_major + $number_minor` ++ age="$number_minor" ++ revision="$number_revision" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` +@@ -3344,8 +3349,8 @@ + ;; + + freebsd-elf) +- major=".$current" +- versuffix=".$current"; ++ major=.`expr $current - $age` ++ versuffix="$major.$age.$revision" + ;; + + irix | nonstopux) diff --git a/redland/rasqal/rasqal-0.9.16.patch.dmake b/redland/rasqal/rasqal-0.9.16.patch.dmake new file mode 100644 index 0000000..6795eb9 --- /dev/null +++ b/redland/rasqal/rasqal-0.9.16.patch.dmake @@ -0,0 +1,98 @@ +--- misc/rasqal-0.9.16/src/makefile.mk Thu Nov 6 15:56:45 2008 ++++ misc/build/rasqal-0.9.16/src/makefile.mk Thu Nov 6 15:55:09 2008 +@@ -1,1 +1,94 @@ +-dummy ++#************************************************************************* ++# ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++# ++# Copyright 2000, 2010 Oracle and/or its affiliates. ++# ++# OpenOffice.org - a multi-platform office productivity suite ++# ++# This file is part of OpenOffice.org. ++# ++# OpenOffice.org is free software: you can redistribute it and/or modify ++# it under the terms of the GNU Lesser General Public License version 3 ++# only, as published by the Free Software Foundation. ++# ++# OpenOffice.org 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 Lesser General Public License version 3 for more details ++# (a copy is included in the LICENSE file that accompanied this code). ++# ++# You should have received a copy of the GNU Lesser General Public License ++# version 3 along with OpenOffice.org. If not, see ++# <http://www.openoffice.org/license.html> ++# for a copy of the LGPLv3 License. ++# ++#************************************************************************* ++ ++PRJ=..$/..$/..$/..$/.. ++ ++PRJNAME=redland ++TARGET=rasqal ++LIBTARGET=NO ++UWINAPILIB= ++ ++EXTERNAL_WARNINGS_NOT_ERRORS=TRUE ++ ++ ++# --- Settings ----------------------------------------------------- ++ ++.INCLUDE : settings.mk ++ ++CDEFS+=-DRASQAL_INTERNAL -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS -D_MT ++ ++# --- Files -------------------------------------------------------- ++ ++SLOFILES = \ ++ $(SLO)$/rasqal_datetime.obj \ ++ $(SLO)$/rasqal_decimal.obj \ ++ $(SLO)$/rasqal_engine.obj \ ++ $(SLO)$/rasqal_expr.obj \ ++ $(SLO)$/rasqal_feature.obj \ ++ $(SLO)$/rasqal_general.obj \ ++ $(SLO)$/rasqal_graph_pattern.obj \ ++ $(SLO)$/rasqal_literal.obj \ ++ $(SLO)$/rasqal_map.obj \ ++ $(SLO)$/rasqal_query_results.obj \ ++ $(SLO)$/rasqal_query.obj \ ++ $(SLO)$/rasqal_raptor.obj \ ++ $(SLO)$/rasqal_result_formats.obj \ ++ $(SLO)$/rasqal_rowsource.obj \ ++ $(SLO)$/rasqal_sparql_xml.obj \ ++ $(SLO)$/rasqal_xsd_datatypes.obj \ ++ $(SLO)$/rdql_lexer.obj \ ++ $(SLO)$/rdql_parser.obj \ ++ $(SLO)$/sparql_lexer.obj \ ++ $(SLO)$/sparql_parser.obj \ ++ $(SLO)$/strcasecmp.obj \ ++ ++ ++# $(SLO)$/rasqal_redland.obj \ ++ ++SHL1DEPN= makefile.mk ++SHL1OBJS= $(SLOFILES) ++SHL1USE_EXPORTS=name ++ ++#SHL1TARGET= $(TARGET)$(DLLPOSTFIX) ++SHL1TARGET= $(TARGET) ++SHL1IMPLIB= lib$(TARGET) ++ ++#SHL1VERSIONMAP=../service/exports.map ++SHL1DEF=$(MISC)$/$(SHL1TARGET).def ++DEF1NAME=$(SHL1TARGET) ++ ++SHL1STDLIBS= \ ++ $(PRJ)$/$(INPATH)$/lib$/libraptor.lib \ ++ ++ ++#$(LIBXML2LIB) \ ++# $(XSLTLIB) \ ++ ++# --- Targets ------------------------------------------------------ ++ ++.INCLUDE : target.mk ++ diff --git a/redland/rasqal/rasqal-0.9.16.patch.legal b/redland/rasqal/rasqal-0.9.16.patch.legal new file mode 100644 index 0000000..59b125d --- /dev/null +++ b/redland/rasqal/rasqal-0.9.16.patch.legal @@ -0,0 +1,18 @@ +--- misc/rasqal-0.9.16/LICENSE.txt Fri Jun 27 04:24:52 2008 ++++ misc/build/rasqal-0.9.16/LICENSE.txt Thu Nov 6 12:06:55 2008 +@@ -60,3 +60,15 @@ + + Copyright (C) 2003-2008 Dave Beckett + Copyright (C) 2003-2005 University of Bristol ++ ++ ++LGPL Disclaimer ++ ++For the avoidance of doubt, except that if any license choice other ++than GPL or LGPL is available it will apply instead, Sun elects to ++use only the Lesser General Public License version 2.1 (LGPLv2) at ++this time for any software where a choice of LGPL license versions ++is made available with the language indicating that LGPLv2.1 or any ++later version may be used, or where a choice of which version of the ++LGPL is applied is otherwise unspecified. ++ diff --git a/redland/rasqal/rasqal-0.9.16.patch.ooo_build b/redland/rasqal/rasqal-0.9.16.patch.ooo_build new file mode 100644 index 0000000..8271479 --- /dev/null +++ b/redland/rasqal/rasqal-0.9.16.patch.ooo_build @@ -0,0 +1,56 @@ +--- misc/rasqal-0.9.16/src/rasqal-config.in Sun Jun 22 07:07:12 2008 ++++ misc/build/rasqal-0.9.16/src/rasqal-config.in Thu Nov 6 12:10:52 2008 +@@ -22,10 +22,19 @@ + # + # + +-prefix=@prefix@ +-includes="-I@includedir@/@PACKAGE@" ++prefix=${SOLARVERSION}/${INPATH} ++exec_prefix=${SOLARVERSION}/${INPATH} ++#includedir=${SOLARVERSION}/${INPATH}/inc${UPDMINOREXT}/external ++#libdir=${SOLARVERSION}/${INPATH}/lib${UPDMINOREXT} ++# HACK: map to build directory ++includedir=../../../../inc ++libdir=../../../../lib ++includes=-I${includedir} + ++#prefix=@prefix@ ++#includes="-I@includedir@/@PACKAGE@" + ++ + usage() + { + cat<<EOF +@@ -104,7 +113,8 @@ + echo $includes + fi + if test "$echo_libs" = "yes"; then +- echo -L@libdir@ -lrasqal ++# echo -L@libdir@ -lrasqal ++ echo -L${libdir} -lrasqal + fi + if test "$echo_libtool_libs" = "yes"; then + echo @libdir@/@RASQAL_LIBTOOLLIBS@ +--- misc/rasqal-0.9.16/Makefile.am 2010-02-12 08:43:21.000000000 +0000 ++++ misc/build/rasqal-0.9.16/Makefile.am 2010-02-12 08:43:56.000000000 +0000 +@@ -22,7 +22,7 @@ + + noinst_SCRIPTS = rasqal-src-config + +-SUBDIRS=src utils tests docs data win32 ++SUBDIRS=src tests docs data win32 + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = rasqal.pc +--- misc/rasqal-0.9.16/Makefile.in 2010-02-12 08:43:19.000000000 +0000 ++++ misc/build/rasqal-0.9.16/Makefile.in 2010-02-12 08:44:03.000000000 +0000 +@@ -242,7 +242,7 @@ + with_raptor = @with_raptor@ + with_redland = @with_redland@ + noinst_SCRIPTS = rasqal-src-config +-SUBDIRS = src utils tests docs data win32 ++SUBDIRS = src tests docs data win32 + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = rasqal.pc + EXTRA_DIST = ChangeLog ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \ diff --git a/redland/rasqal/rasqal-0.9.16.patch.win32 b/redland/rasqal/rasqal-0.9.16.patch.win32 new file mode 100644 index 0000000..51bad96 --- /dev/null +++ b/redland/rasqal/rasqal-0.9.16.patch.win32 @@ -0,0 +1,43 @@ +--- misc/rasqal-0.9.16/src/win32_rasqal_config.h Fri Jun 27 04:02:09 2008 ++++ misc/build/rasqal-0.9.16/src/win32_rasqal_config.h Thu Nov 6 12:07:06 2008 +@@ -37,10 +37,13 @@ + + #define HAVE_STDLIB_H 1 + ++#define HAVE_ERRNO_H 1 ++ + #define HAVE_STRICMP 1 + + /* MS names for these functions */ +-#define vsnprintf _vsnprintf ++// next line breaks build on wntmsci12 ++//#define vsnprintf _vsnprintf + #define snprintf _snprintf + #define access _access + #define stricmp _stricmp +@@ -85,6 +88,9 @@ + #include <io.h> + #include <memory.h> + ++// argh! stupid winnt.h... ++#undef DELETE ++ + /* This is a SPARQL token define */ + #ifdef OPTIONAL + #undef OPTIONAL +@@ -116,8 +122,14 @@ + /* #define RAPTOR_TRIPLES_SOURCE_REDLAND 1 */ + + /* Use PCRE regex library */ +-#define RASQAL_REGEX_PCRE 1 ++//#define RASQAL_REGEX_PCRE 1 + ++#define HAVE_LIBXML_SCHEMASINTERNALS_H 1 ++#define HAVE_LIBXML_XMLSCHEMASTYPES_H 1 ++#define HAVE_LIBXML_XMLSCHEMAS_H 1 ++ ++#define RASQAL_DECIMAL_NONE 1 ++ + #ifdef _DEBUG + #define RASQAL_DEBUG 1 + #endif diff --git a/redland/rasqal/rasqal2.map b/redland/rasqal/rasqal2.map index b36d25c..622043a 100644 --- a/redland/rasqal/rasqal2.map +++ b/redland/rasqal/rasqal2.map @@ -1,4 +1,4 @@ -RASQAL2 { +UDK_3_0_0 { global: GetVersionInfo; rasqal_xsd_decimal_set_string; diff --git a/redland/redland-1.0.7.patch b/redland/redland-1.0.7.patch deleted file mode 100644 index 97f7119..0000000 --- a/redland/redland-1.0.7.patch +++ /dev/null @@ -1,1018 +0,0 @@ ---- misc/redland-1.0.7/LICENSE.txt Wed May 2 07:45:42 2007 -+++ misc/build/redland-1.0.7/LICENSE.txt Mon Jun 16 15:55:51 2008 -@@ -77,3 +77,15 @@ - 10. NOTICE - 11. http://purl.org/net/dajobe/ - 12. http://www.bristol.ac.uk/ -+ -+ -+LGPL Disclaimer -+ -+For the avoidance of doubt, except that if any license choice other -+than GPL or LGPL is available it will apply instead, Sun elects to -+use only the Lesser General Public License version 2.1 (LGPLv2) at -+this time for any software where a choice of LGPL license versions -+is made available with the language indicating that LGPLv2.1 or any -+later version may be used, or where a choice of which version of the -+LGPL is applied is otherwise unspecified. -+ ---- misc/redland-1.0.7/librdf/makefile.mk 2008-12-26 17:24:00.000000000 +0100 -+++ misc/build/redland-1.0.7/librdf/makefile.mk 2008-12-26 17:20:46.000000000 +0100 -@@ -1 +1,124 @@ --dummy -+#************************************************************************* -+# -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# Copyright 2008 by Sun Microsystems, Inc. -+# -+# OpenOffice.org - a multi-platform office productivity suite -+# -+# $RCSfile: redland-1.0.7.patch,v $ -+# -+# $Revision: 1.2.6.2 $ -+# -+# This file is part of OpenOffice.org. -+# -+# OpenOffice.org is free software: you can redistribute it and/or modify -+# it under the terms of the GNU Lesser General Public License version 3 -+# only, as published by the Free Software Foundation. -+# -+# OpenOffice.org 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 Lesser General Public License version 3 for more details -+# (a copy is included in the LICENSE file that accompanied this code). -+# -+# You should have received a copy of the GNU Lesser General Public License -+# version 3 along with OpenOffice.org. If not, see -+# <http://www.openoffice.org/license.html> -+# for a copy of the LGPLv3 License. -+# -+#************************************************************************* -+ -+PRJ=..$/..$/..$/..$/.. -+ -+PRJNAME=redland -+TARGET=librdf -+LIBTARGET=NO -+ -+EXTERNAL_WARNINGS_NOT_ERRORS=TRUE -+ -+ -+# --- Settings ----------------------------------------------------- -+ -+.INCLUDE : settings.mk -+ -+.IF "$(GUI)"=="OS2" -+CDEFS+=-DLIBRDF_INTERNAL -DHAVE_CONFIG_H -DNDEBUG -+.ELSE -+CDEFS+=-DLIBRDF_INTERNAL -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS -+.ENDIF -+ -+# --- Files -------------------------------------------------------- -+ -+SLOFILES = \ -+ $(SLO)$/rdf_concepts.obj \ -+ $(SLO)$/rdf_digest.obj \ -+ $(SLO)$/rdf_digest_md5.obj \ -+ $(SLO)$/rdf_digest_openssl.obj \ -+ $(SLO)$/rdf_digest_sha1.obj \ -+ $(SLO)$/rdf_files.obj \ -+ $(SLO)$/rdf_hash.obj \ -+ $(SLO)$/rdf_hash_cursor.obj \ -+ $(SLO)$/rdf_hash_memory.obj \ -+ $(SLO)$/rdf_heuristics.obj \ -+ $(SLO)$/rdf_init.obj \ -+ $(SLO)$/rdf_iterator.obj \ -+ $(SLO)$/rdf_list.obj \ -+ $(SLO)$/rdf_log.obj \ -+ $(SLO)$/rdf_model.obj \ -+ $(SLO)$/rdf_model_storage.obj \ -+ $(SLO)$/rdf_node.obj \ -+ $(SLO)$/rdf_parser.obj \ -+ $(SLO)$/rdf_parser_raptor.obj \ -+ $(SLO)$/rdf_query.obj \ -+ $(SLO)$/rdf_query_rasqal.obj \ -+ $(SLO)$/rdf_query_results.obj \ -+ $(SLO)$/rdf_query_triples.obj \ -+ $(SLO)$/rdf_serializer.obj \ -+ $(SLO)$/rdf_serializer_raptor.obj \ -+ $(SLO)$/rdf_statement.obj \ -+ $(SLO)$/rdf_storage.obj \ -+ $(SLO)$/rdf_storage_file.obj \ -+ $(SLO)$/rdf_storage_list.obj \ -+ $(SLO)$/rdf_storage_hashes.obj \ -+ $(SLO)$/rdf_stream.obj \ -+ $(SLO)$/rdf_uri.obj \ -+ $(SLO)$/rdf_utf8.obj \ -+ -+ -+# $(SLO)$/rdf_hash_bdb.obj \ -+# $(SLO)$/rdf_storage_mysql.obj \ -+# $(SLO)$/rdf_storage_sqlite.obj \ -+ -+ -+SHL1DEPN= makefile.mk -+SHL1OBJS= $(SLOFILES) -+ -+#SHL1TARGET= $(TARGET)$(DLLPOSTFIX) -+SHL1TARGET= $(TARGET) -+SHL1IMPLIB= $(TARGET) -+SHL1USE_EXPORTS=name -+ -+#SHL1VERSIONMAP=../service/exports.map -+.IF "$(GUI)"=="OS2" -+SHL1VERSIONMAP=$(PRJ)$/redland$/redland2.map -+.ENDIF -+SHL1DEF=$(MISC)$/$(SHL1TARGET).def -+DEF1NAME=$(SHL1TARGET) -+ -+SHL1STDLIBS= \ -+ $(OPENSSLLIB) \ -+ $(PRJ)$/$(INPATH)$/lib$/libraptor.lib \ -+ $(PRJ)$/$(INPATH)$/lib$/librasqal.lib \ -+ -+.IF "$(GUI)"=="OS2" -+SHL1STDLIBS+= pthread.lib -+.ENDIF -+ -+#$(LIBXML2LIB) \ -+# $(XSLTLIB) \ -+ -+# --- Targets ------------------------------------------------------ -+ -+.INCLUDE : target.mk -+ ---- misc/redland-1.0.7/librdf/rdf_digest.c Wed Dec 5 18:25:18 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_digest.c Mon Jun 16 15:55:51 2008 -@@ -250,6 +250,8 @@ - void - librdf_free_digest(librdf_digest *digest) - { -+ if(!digest) -+ return; - if(digest->context) - LIBRDF_FREE(digest_context, digest->context); - if(digest->digest) ---- misc/redland-1.0.7/librdf/rdf_hash.c Thu Dec 20 22:39:42 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_hash.c Mon Jun 16 15:55:51 2008 -@@ -490,6 +490,8 @@ - void - librdf_free_hash(librdf_hash* hash) - { -+ if(!hash) -+ return; - if(hash->context) { - if(hash->is_open) - librdf_hash_close(hash); ---- misc/redland-1.0.7/librdf/rdf_init.c Tue Nov 6 16:26:18 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_init.c Mon Jun 16 15:55:51 2008 -@@ -178,6 +178,9 @@ - void - librdf_free_world(librdf_world *world) - { -+ if(!world) -+ return; -+ - /* NOTE: raptor is always initialised as a parser and may - * be also used as a serializer, but it is NOT finished - * in the serializer_raptor registration. Therefore, always ---- misc/redland-1.0.7/librdf/rdf_list.c Thu Dec 20 22:39:42 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_list.c Mon Jun 16 15:55:51 2008 -@@ -108,6 +108,8 @@ - void - librdf_free_list(librdf_list* list) - { -+ if(!list) -+ return; - LIBRDF_ASSERT_RETURN(list->iterator_count, - "Iterators were active on freeing list", ); - ---- misc/redland-1.0.7/librdf/rdf_model.c Tue Oct 23 16:55:06 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_model.c Mon Jun 16 15:55:51 2008 -@@ -393,7 +393,8 @@ - librdf_iterator* iterator; - librdf_model* m; - -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(model, librdf_model); -+ if(!model) -+ return; - - if(--model->usage) - return; ---- misc/redland-1.0.7/librdf/rdf_node.c Thu Dec 20 22:39:42 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_node.c Mon Jun 16 15:55:51 2008 -@@ -726,7 +726,8 @@ - librdf_world *world; - #endif - -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(node, librdf_node); -+ if(!node) -+ return; - - #ifdef WITH_THREADS - world = node->world; ---- misc/redland-1.0.7/librdf/rdf_parser.c Mon Dec 17 08:19:11 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_parser.c Mon Jun 16 15:55:51 2008 -@@ -371,7 +371,8 @@ - void - librdf_free_parser(librdf_parser *parser) - { -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(parser, librdf_parser); -+ if(!parser) -+ return; - - if(parser->context) { - if(parser->factory->terminate) ---- misc/redland-1.0.7/librdf/rdf_query.c Tue Oct 23 16:55:06 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_query.c Mon Jun 16 15:55:51 2008 -@@ -388,7 +388,8 @@ - void - librdf_free_query(librdf_query* query) - { -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(query, librdf_query); -+ if(!query) -+ return; - - if(--query->usage) - return; ---- misc/redland-1.0.7/librdf/rdf_query_results.c Fri Oct 26 04:23:36 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_query_results.c Mon Jun 16 15:55:51 2008 -@@ -244,7 +244,8 @@ - void - librdf_free_query_results(librdf_query_results* query_results) - { -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(query_results, librdf_query_results); -+ if(!query_results) -+ return; - - if(query_results->query->factory->free_results) - query_results->query->factory->free_results(query_results); -@@ -636,6 +637,8 @@ - void - librdf_free_query_results_formatter(librdf_query_results_formatter* formatter) - { -+ if(!formatter) -+ return; - if(formatter->query_results->query->factory->free_results_formatter) - formatter->query_results->query->factory->free_results_formatter(formatter); - } ---- misc/redland-1.0.7/librdf/rdf_serializer.c Tue Oct 23 16:55:06 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_serializer.c Mon Jun 16 15:55:51 2008 -@@ -373,7 +373,8 @@ - void - librdf_free_serializer(librdf_serializer *serializer) - { -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(serializer, librdf_serializer); -+ if(!serializer) -+ return; - - if(serializer->context) { - if(serializer->factory->terminate) ---- misc/redland-1.0.7/librdf/rdf_statement.c Tue Nov 6 16:26:18 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_statement.c Mon Jun 16 15:55:51 2008 -@@ -255,7 +255,8 @@ - librdf_world *world; - #endif - -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement); -+ if(!statement) -+ return; - - #ifdef WITH_THREADS - world = statement->world; ---- misc/redland-1.0.7/librdf/rdf_storage.c Thu Dec 20 22:39:42 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_storage.c Mon Jun 16 15:55:51 2008 -@@ -608,7 +608,8 @@ - void - librdf_free_storage (librdf_storage* storage) - { -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(storage, librdf_storage); -+ if(!storage) -+ return; - - if(--storage->usage) - return; ---- misc/redland-1.0.7/librdf/rdf_storage_hashes.c Thu Dec 20 22:39:42 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_storage_hashes.c Mon Jun 16 15:55:51 2008 -@@ -1389,6 +1389,66 @@ - LIBRDF_STATEMENT_OBJECT); - } - -+ -+/* return -1 on failure, 1 if context contains stmt, 0 if not */ -+static int -+librdf_storage_hashes_context_contains_statement(librdf_storage* storage, -+ librdf_node* context_node, -+ librdf_statement* statement) -+{ -+ librdf_storage_hashes_context* context=(librdf_storage_hashes_context*)storage->context; -+ librdf_hash_datum key, value; /* on stack - not allocated */ -+ size_t size; -+ int status; -+ -+ if(context->contexts_index < 0) { -+ librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, -+ "Storage was created without context support"); -+ return -1; -+ } -+ -+ /* ENCODE KEY */ -+ size=librdf_node_encode(context_node, NULL, 0); -+ if (!size) -+ return -1; -+ key.data=(char*)LIBRDF_MALLOC(cstring, size); -+ if (!key.data) -+ return -1; -+ key.size=librdf_node_encode(context_node, -+ (unsigned char*)key.data, size); -+ if (!key.size) { -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ -+ /* ENCODE VALUE */ -+ size=librdf_statement_encode(statement, NULL, 0); -+ if (!size) { -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ value.data=(char*)LIBRDF_MALLOC(cstring, size); -+ if (!value.data) { -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ value.size=librdf_statement_encode(statement, (unsigned char*)value.data, size); -+ if (!value.size) { -+ LIBRDF_FREE(data, value.data); -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ -+ status=librdf_hash_exists(context->hashes[context->contexts_index], &key, &value); -+ LIBRDF_FREE(data, value.data); -+ LIBRDF_FREE(data, key.data); -+ -+ /* DO NOT free statement, ownership was not passed in */ -+ return status; -+} -+ -+ -+ - /** - * librdf_storage_hashes_context_add_statement: - * @storage: #librdf_storage object -@@ -1414,7 +1474,15 @@ - "Storage was created without context support"); - return 1; - } -- -+ -+ /* Do not add duplicate statements */ -+ status=librdf_storage_hashes_context_contains_statement(storage, context_node, statement); -+ if(status) -+ if(status < 0) -+ return 1; -+ else -+ return 0; -+ - if(librdf_storage_hashes_add_remove_statement(storage, - statement, context_node, 1)) - return 1; -@@ -1595,7 +1663,6 @@ - { - librdf_storage_hashes_context_serialise_stream_context* scontext=(librdf_storage_hashes_context_serialise_stream_context*)context; - librdf_hash_datum* v; -- librdf_node** cnp=NULL; - - switch(flags) { - case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT: -@@ -1608,20 +1675,14 @@ - return scontext->context_node; - } - -- /* current stuff is out of date - get new cached answers */ -- if(scontext->index_contexts) { -- if(scontext->context_node) -- librdf_free_node(scontext->context_node); -- scontext->context_node=NULL; -- cnp=&scontext->context_node; -- } -- -+ /* note: scontext->context_node is still valid */ -+ - librdf_statement_clear(&scontext->current); - - v=(librdf_hash_datum*)librdf_iterator_get_value(scontext->iterator); -- -+ - /* decode value content and optional context */ -- if(!librdf_statement_decode_parts(&scontext->current, cnp, -+ if(!librdf_statement_decode_parts(&scontext->current, NULL, - (unsigned char*)v->data, v->size)) { - return NULL; - } ---- misc/redland-1.0.7/librdf/rdf_storage_list.c Thu Dec 20 22:39:42 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_storage_list.c Mon Jun 16 15:55:51 2008 -@@ -459,6 +459,64 @@ - } - - -+/* return -1 on failure, 1 if context contains stmt, 0 if not */ -+static int -+librdf_storage_list_context_contains_statement(librdf_storage* storage, -+ librdf_node* context_node, -+ librdf_statement* statement) -+{ -+ librdf_storage_list_context* context=(librdf_storage_list_context*)storage->context; -+ librdf_hash_datum key, value; /* on stack - not allocated */ -+ size_t size; -+ int status; -+ -+ if(!context->index_contexts) { -+ librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL, -+ "Storage was created without context support"); -+ return -1; -+ } -+ -+ /* ENCODE KEY */ -+ size=librdf_node_encode(context_node, NULL, 0); -+ if (!size) -+ return -1; -+ key.data=(char*)LIBRDF_MALLOC(cstring, size); -+ if (!key.data) -+ return -1; -+ key.size=librdf_node_encode(context_node, -+ (unsigned char*)key.data, size); -+ if (!key.size) { -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ -+ /* ENCODE VALUE */ -+ size=librdf_statement_encode(statement, NULL, 0); -+ if (!size) { -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ value.data=(char*)LIBRDF_MALLOC(cstring, size); -+ if (!value.data) { -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ value.size=librdf_statement_encode(statement, (unsigned char*)value.data, size); -+ if (!value.size) { -+ LIBRDF_FREE(data, value.data); -+ LIBRDF_FREE(data, key.data); -+ return -1; -+ } -+ -+ status=librdf_hash_exists(context->contexts, &key, &value); -+ LIBRDF_FREE(data, value.data); -+ LIBRDF_FREE(data, key.data); -+ -+ /* DO NOT free statement, ownership was not passed in */ -+ return status; -+} -+ -+ - /** - * librdf_storage_list_context_add_statement: - * @storage: #librdf_storage object -@@ -485,7 +543,15 @@ - "Storage was created without context support"); - return 1; - } -- -+ -+ /* Do not add duplicate statements */ -+ status=librdf_storage_list_context_contains_statement(storage, context_node, statement); -+ if(status) -+ if(status < 0) -+ return 1; -+ else -+ return 0; -+ - /* Store statement + node in the storage_list */ - sln=(librdf_storage_list_node*)LIBRDF_MALLOC(librdf_storage_list_node, sizeof(librdf_storage_list_node)); - if(!sln) ---- misc/redland-1.0.7/librdf/rdf_stream.c Mon Dec 24 00:23:10 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_stream.c Mon Jun 16 15:55:52 2008 -@@ -126,6 +126,9 @@ - void - librdf_free_stream(librdf_stream* stream) - { -+ if(!stream) -+ return; -+ - if(stream->finished_method) - stream->finished_method(stream->context); - ---- misc/redland-1.0.7/librdf/rdf_uri.c Tue Oct 23 16:55:06 2007 -+++ misc/build/redland-1.0.7/librdf/rdf_uri.c Mon Jun 16 15:55:52 2008 -@@ -409,7 +409,8 @@ - librdf_world *world; - #endif - -- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(uri, librdf_uri); -+ if(!uri) -+ return; - - #ifdef WITH_THREADS - world = uri->world; ---- misc/redland-1.0.7/librdf/win32_rdf_config.h Sun May 6 19:14:36 2007 -+++ misc/build/redland-1.0.7/librdf/win32_rdf_config.h Sat Jul 12 08:56:20 2008 -@@ -45,7 +45,8 @@ - #define HAVE_STRICMP 1 - - /* MS names for these functions */ --#define vsnprintf _vsnprintf -+// next line breaks build on wntmsci12 -+//#define vsnprintf _vsnprintf - #define snprintf _snprintf - #define access _access - #define stricmp _stricmp -@@ -74,40 +75,40 @@ - */ - - /* BDB has close method with 2 args */ --#define HAVE_BDB_CLOSE_2_ARGS 1 -+// #define HAVE_BDB_CLOSE_2_ARGS 1 - - /* BDB defines DBC */ --#define HAVE_BDB_CURSOR 1 -+// #define HAVE_BDB_CURSOR 1 - - /* BDB cursor method has 4 arguments */ --#define HAVE_BDB_CURSOR_4_ARGS 1 -+// #define HAVE_BDB_CURSOR_4_ARGS 1 - - /* BDB defines DB_TXN */ --#define HAVE_BDB_DB_TXN 1 -+// #define HAVE_BDB_DB_TXN 1 - - /* BDB has fd method with 2 args */ --#define HAVE_BDB_FD_2_ARGS 1 -+// #define HAVE_BDB_FD_2_ARGS 1 - - /* Have BDB hash support */ --#define HAVE_BDB_HASH 1 -+// #define HAVE_BDB_HASH 1 - - /* BDB has open method with 6 args */ - /* #undef HAVE_BDB_OPEN_6_ARGS */ - - /* BDB has open method with 7 args */ --#define HAVE_BDB_OPEN_7_ARGS 1 -+// #define HAVE_BDB_OPEN_7_ARGS 1 - - /* BDB has set_flags method */ --#define HAVE_BDB_SET_FLAGS 1 -+// #define HAVE_BDB_SET_FLAGS 1 - - /* BDB has dbopen method */ - /* #undef HAVE_DBOPEN */ - - /* BDB has db_create method */ --#define HAVE_DB_CREATE 1 -+// #define HAVE_DB_CREATE 1 - - /* Define to 1 if you have the <db.h> header file. */ --#define HAVE_DB_H 1 -+// #define HAVE_DB_H 1 - - /* Define to 1 if you have the <dlfcn.h> header file. */ - /* undef HAVE_DLFCN_H */ -@@ -143,13 +144,13 @@ - /* #undef HAVE_LIBWWW */ - - /* Have local MD5 digest */ --#define HAVE_LOCAL_MD5_DIGEST 1 -+// #define HAVE_LOCAL_MD5_DIGEST 1 - - /* Have local RIPEMD160 digest */ - /* #undef HAVE_LOCAL_RIPEMD160_DIGEST */ - - /* Have local SHA1 digest */ --#define HAVE_LOCAL_SHA1_DIGEST 1 -+// #define HAVE_LOCAL_SHA1_DIGEST 1 - - /* Define to 1 if you have the <memory.h> header file. */ - #define HAVE_MEMORY_H 1 -@@ -161,25 +162,33 @@ - #define HAVE_MKTEMP 1 - - /* MySQL libraries are present */ --#define HAVE_MYSQL 1 -+// #define HAVE_MYSQL 1 - - /* Define to 1 if you have the <openssl/crypto.h> header file. */ - /* #undef HAVE_OPENSSL_CRYPTO_H */ -+#define HAVE_OPENSSL_CRYPTO_H 1 - - /* Have openssl MD5 digest */ - /* #undef HAVE_OPENSSL_CRYPTO_MD5_DIGEST */ -+#define HAVE_OPENSSL_CRYPTO_MD5_DIGEST 1 - - /* Have openssl RIPEMD160 digest */ - /* #undef HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST */ -+#define HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST 1 - - /* Have openssl SHA1 digest */ - /* #undef HAVE_OPENSSL_CRYPTO_SHA1_DIGEST */ -+#define HAVE_OPENSSL_CRYPTO_SHA1_DIGEST 1 - - /* Have openssl digests */ - /* #undef HAVE_OPENSSL_DIGESTS */ -+#define HAVE_OPENSSL_DIGESTS 1 - - /* Define to 1 if you have the <pthread.h> header file. */ - /* #undef HAVE_PTHREAD_H */ -+#ifdef __MINGW32__ -+#undef HAVE_PTHREAD_H */ -+#endif - - /* Define to 1 if you have the <stdint.h> header file. */ - #define HAVE_STDINT_H 1 -@@ -248,7 +257,7 @@ - #define SIZEOF_UNSIGNED_LONG_LONG 8 - - /* SQLite API version */ --#define SQLITE_API 3 -+// #define SQLITE_API 3 - - /* Define to 1 if you have the ANSI C header files. */ - #define STDC_HEADERS 1 -@@ -256,14 +265,17 @@ - /* Building file storage */ - #define STORAGE_FILE 1 - -+#define STORAGE_HASHES 1 -+#define STORAGE_MEMORY 1 -+ - /* Building MySQL storage */ --#define STORAGE_MYSQL 1 -+// #define STORAGE_MYSQL 1 - - /* Building PostgreSQL storage */ - /*#undef STORAGE_POSTGRESQL*/ - - /* Building SQLite storage */ --#define STORAGE_SQLITE 1 -+// #define STORAGE_SQLITE 1 - - /* Building 3store storage */ - /*#undef STORAGE_TSTORE*/ ---- misc/redland-1.0.7/raptor/LICENSE.txt Fri Mar 23 06:28:24 2007 -+++ misc/build/redland-1.0.7/raptor/LICENSE.txt Mon Jun 16 15:55:52 2008 -@@ -61,3 +61,15 @@ - - Copyright (C) 2000-2007 David Beckett - Copyright (C) 2000-2005 University of Bristol -+ -+ -+LGPL Disclaimer -+ -+For the avoidance of doubt, except that if any license choice other -+than GPL or LGPL is available it will apply instead, Sun elects to -+use only the Lesser General Public License version 2.1 (LGPLv2) at -+this time for any software where a choice of LGPL license versions -+is made available with the language indicating that LGPLv2.1 or any -+later version may be used, or where a choice of which version of the -+LGPL is applied is otherwise unspecified. -+ ---- misc/redland-1.0.7/rasqal/LICENSE.txt Sun Apr 22 23:09:08 2007 -+++ misc/build/redland-1.0.7/rasqal/LICENSE.txt Mon Jun 16 15:55:52 2008 -@@ -61,3 +61,15 @@ - - Copyright (C) 2003-2007 Dave Beckett - Copyright (C) 2003-2005 University of Bristol -+ -+ -+LGPL Disclaimer -+ -+For the avoidance of doubt, except that if any license choice other -+than GPL or LGPL is available it will apply instead, Sun elects to -+use only the Lesser General Public License version 2.1 (LGPLv2) at -+this time for any software where a choice of LGPL license versions -+is made available with the language indicating that LGPLv2.1 or any -+later version may be used, or where a choice of which version of the -+LGPL is applied is otherwise unspecified. -+ ---- misc/redland-1.0.7/ltmain.sh 2007-11-28 06:23:09.000000000 +0900 -+++ misc/build/redland-1.0.7/ltmain.sh 2008-07-06 15:44:48.725250000 +0900 -@@ -1557,6 +1557,11 @@ - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` -+ case $host_os in -+ mingw*) -+ absdir=`cygpath -m $absdir` -+ ;; -+ esac - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" -@@ -3237,9 +3242,9 @@ - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) -- current="$number_major" -- revision="$number_minor" -- age="0" -+ current=`expr $number_major + $number_minor` -+ age="$number_minor" -+ revision="$number_revision" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor` -@@ -3319,8 +3324,8 @@ - ;; - - freebsd-elf) -- major=".$current" -- versuffix=".$current"; -+ major=.`expr $current - $age` -+ versuffix="$major.$age.$revision" - ;; - - irix | nonstopux) ---- misc/redland-1.0.7/configure 2007-12-17 16:58:16.000000000 +0900 -+++ misc/build/redland-1.0.7/configure 2008-07-06 15:12:01.397125000 +0900 -@@ -4544,7 +4544,7 @@ - - cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh -- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' -+ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -@@ -4553,7 +4553,7 @@ - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then -- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' -+ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' ---- misc/redland-1.0.7/utils/rdfproc.c 2007-10-23 23:55:06.000000000 +0900 -+++ misc/build/redland-1.0.7/utils/rdfproc.c 2008-07-06 17:44:47.615875000 +0900 -@@ -30,7 +30,7 @@ - #endif - - #ifdef WIN32 --#include <win32_config.h> -+#include <win32_rdf_config.h> - #endif - - #include <stdio.h> ---- misc/redland-1.0.7/librdf/rdf_config.h 2008-12-26 17:24:00.000000000 +0100 -+++ misc/build/redland-1.0.7/librdf/rdf_config.h 2008-12-26 17:20:46.000000000 +0100 -@@ -1 +1,243 @@ --dummy -+/* librdf/rdf_config.h. Generated from rdf_config.h.in by configure. */ -+/* librdf/rdf_config.h.in. Generated from configure.ac by autoheader. */ -+ -+/* BDB has close method with 2 args */ -+/* #undef HAVE_BDB_CLOSE_2_ARGS */ -+ -+/* BDB defines DBC */ -+/* #undef HAVE_BDB_CURSOR */ -+ -+/* BDB cursor method has 4 arguments */ -+/* #undef HAVE_BDB_CURSOR_4_ARGS */ -+ -+/* BDB defines DB_TXN */ -+/* #undef HAVE_BDB_DB_TXN */ -+ -+/* BDB has fd method with 2 args */ -+/* #undef HAVE_BDB_FD_2_ARGS */ -+ -+/* Have BDB hash support */ -+/* #undef HAVE_BDB_HASH */ -+ -+/* BDB has open method with 6 args */ -+/* #undef HAVE_BDB_OPEN_6_ARGS */ -+ -+/* BDB has open method with 7 args */ -+/* #undef HAVE_BDB_OPEN_7_ARGS */ -+ -+/* BDB has set_flags method */ -+/* #undef HAVE_BDB_SET_FLAGS */ -+ -+/* BDB has dbopen method */ -+/* #undef HAVE_DBOPEN */ -+ -+/* BDB has db_create method */ -+/* #undef HAVE_DB_CREATE */ -+ -+/* Define to 1 if you have the <db.h> header file. */ -+/* #undef HAVE_DB_H */ -+ -+/* BDB has db_open method */ -+/* #undef HAVE_DB_OPEN */ -+ -+/* Define to 1 if you have the <dlfcn.h> header file. */ -+#define HAVE_DLFCN_H 1 -+ -+/* Define to 1 if you have the <dmalloc.h> header file. */ -+/* #undef HAVE_DMALLOC_H */ -+ -+/* Define to 1 if you have the <errno.h> header file. */ -+#define HAVE_ERRNO_H 1 -+ -+/* Define to 1 if you have the <fcntl.h> header file. */ -+#define HAVE_FCNTL_H 1 -+ -+/* Define to 1 if you have the `getenv' function. */ -+#define HAVE_GETENV 1 -+ -+/* Define to 1 if you have the `getopt' function. */ -+#define HAVE_GETOPT 1 -+ -+/* Define to 1 if you have the <getopt.h> header file. */ -+#define HAVE_GETOPT_H 1 -+ -+/* Define to 1 if you have the `getopt_long' function. */ -+#define HAVE_GETOPT_LONG 1 -+ -+/* Define to 1 if you have the `gettimeofday' function. */ -+#define HAVE_GETTIMEOFDAY 1 -+ -+/* Define to 1 if you have the <inttypes.h> header file. */ -+#define HAVE_INTTYPES_H 1 -+ -+/* Define to 1 if you have the <libpq-fe.h> header file. */ -+/* #undef HAVE_LIBPQ_FE_H */ -+ -+/* Have local MD5 digest */ -+/* #undef HAVE_LOCAL_MD5_DIGEST */ -+ -+/* Have local RIPEMD160 digest */ -+/* #undef HAVE_LOCAL_RIPEMD160_DIGEST */ -+ -+/* Have local SHA1 digest */ -+/* #undef HAVE_LOCAL_SHA1_DIGEST */ -+ -+/* Define to 1 if you have the `memcmp' function. */ -+#define HAVE_MEMCMP 1 -+ -+/* Define to 1 if you have the <memory.h> header file. */ -+#define HAVE_MEMORY_H 1 -+ -+/* Define to 1 if you have the `mkstemp' function. */ -+#define HAVE_MKSTEMP 1 -+ -+/* Define to 1 if you have the `mktemp' function. */ -+#define HAVE_MKTEMP 1 -+ -+/* Define to 1 if you have the <openssl/crypto.h> header file. */ -+#define HAVE_OPENSSL_CRYPTO_H 1 -+ -+/* Have openssl MD5 digest */ -+#define HAVE_OPENSSL_CRYPTO_MD5_DIGEST 1 -+ -+/* Have openssl RIPEMD160 digest */ -+#define HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST 1 -+ -+/* Have openssl SHA1 digest */ -+#define HAVE_OPENSSL_CRYPTO_SHA1_DIGEST 1 -+ -+/* Have openssl digests */ -+#define HAVE_OPENSSL_DIGESTS 1 -+ -+/* Define to 1 if you have the <pthread.h> header file. */ -+#define HAVE_PTHREAD_H 1 -+ -+/* Define to 1 if you have the <sqlite3.h> header file. */ -+/* #undef HAVE_SQLITE3_H */ -+ -+/* Define to 1 if you have the <sqlite.h> header file. */ -+/* #undef HAVE_SQLITE_H */ -+ -+/* Define to 1 if you have the <stdint.h> header file. */ -+#define HAVE_STDINT_H 1 -+ -+/* Define to 1 if you have the <stdlib.h> header file. */ -+#define HAVE_STDLIB_H 1 -+ -+/* Define to 1 if you have the <strings.h> header file. */ -+#define HAVE_STRINGS_H 1 -+ -+/* Define to 1 if you have the <string.h> header file. */ -+#define HAVE_STRING_H 1 -+ -+/* Define to 1 if you have the <sys/stat.h> header file. */ -+#define HAVE_SYS_STAT_H 1 -+ -+/* Define to 1 if you have the <sys/time.h> header file. */ -+#define HAVE_SYS_TIME_H 1 -+ -+/* Define to 1 if you have the <sys/types.h> header file. */ -+#define HAVE_SYS_TYPES_H 1 -+ -+/* Define to 1 if you have the <time.h> header file. */ -+#define HAVE_TIME_H 1 -+ -+/* Define to 1 if you have the `tmpnam' function. */ -+#define HAVE_TMPNAM 1 -+ -+/* Define to 1 if you have the <unistd.h> header file. */ -+#define HAVE_UNISTD_H 1 -+ -+/* Run time assertion checks. */ -+#define LIBRDF_ASSERT 1 -+ -+/* Print run time assertion check failure messages. */ -+#define LIBRDF_ASSERT_MESSAGES 1 -+ -+/* Release version as a decimal */ -+#define LIBRDF_VERSION_DECIMAL 10007 -+ -+/* Major version number */ -+#define LIBRDF_VERSION_MAJOR 1 -+ -+/* Minor version number */ -+#define LIBRDF_VERSION_MINOR 0 -+ -+/* Release version number */ -+#define LIBRDF_VERSION_RELEASE 7 -+ -+/* Build storage backends as modules */ -+/* #undef MODULAR_LIBRDF */ -+ -+/* Name of package */ -+#define PACKAGE "redland" -+ -+/* Define to the address where bug reports for this package should be sent. */ -+#define PACKAGE_BUGREPORT "http://bugs.librdf.org/" -+ -+/* Define to the full name of this package. */ -+#define PACKAGE_NAME "Redland RDF Application Framework" -+ -+/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "Redland RDF Application Framework 1.0.7" -+ -+/* Define to the one symbol short name of this package. */ -+#define PACKAGE_TARNAME "redland" -+ -+/* Define to the version of this package. */ -+#define PACKAGE_VERSION "1.0.7" -+ -+/* The size of `unsigned char', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_CHAR 1 -+ -+/* The size of `unsigned int', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_INT 4 -+ -+/* The size of `unsigned long', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_LONG 4 -+ -+/* The size of `unsigned long long', as computed by sizeof. */ -+#define SIZEOF_UNSIGNED_LONG_LONG 8 -+ -+/* SQLite API version */ -+/* #undef SQLITE_API */ -+ -+/* Define to 1 if you have the ANSI C header files. */ -+#define STDC_HEADERS 1 -+ -+/* Building file storage */ -+#define STORAGE_FILE 1 -+ -+/* Building hashes storage */ -+#define STORAGE_HASHES 1 -+ -+/* Building memory storage */ -+#define STORAGE_MEMORY 1 -+ -+/* Building MySQL storage */ -+/* #undef STORAGE_MYSQL */ -+ -+/* Building PostgreSQL storage */ -+/* #undef STORAGE_POSTGRESQL */ -+ -+/* Building SQLite storage */ -+/* #undef STORAGE_SQLITE */ -+ -+/* Building 3store storage */ -+/* #undef STORAGE_TSTORE */ -+ -+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ -+#define TIME_WITH_SYS_TIME 1 -+ -+/* Version number of package */ -+#define VERSION "1.0.7" -+ -+/* Use POSIX threads */ -+#define WITH_THREADS 1 -+ -+/* Define to 1 if your processor stores words with the most significant byte -+ first (like Motorola and SPARC, unlike Intel and VAX). */ -+/* #undef WORDS_BIGENDIAN */ -+ -+/* Define to empty if `const' does not conform to ANSI C. */ -+/* #undef const */ diff --git a/redland/redland/makefile.mk b/redland/redland/makefile.mk index e8b4737..3db7c05 100644 --- a/redland/redland/makefile.mk +++ b/redland/redland/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.8 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -48,23 +44,40 @@ all: .INCLUDE : ../redlandversion.mk -REDLANDVERSION=1.0.7 +REDLANDVERSION=1.0.8 TARFILE_NAME=redland-$(REDLANDVERSION) -PATCH_FILES=..$/$(TARFILE_NAME).patch +TARFILE_MD5=ca66e26082cab8bb817185a116db809b ADDITIONAL_FILES=librdf/makefile.mk librdf/rdf_config.h +OOO_PATCH_FILES= \ + $(TARFILE_NAME).patch.legal \ + $(TARFILE_NAME).patch.autotools \ + $(TARFILE_NAME).patch.dmake \ + $(TARFILE_NAME).patch.ooo_build \ + $(TARFILE_NAME).patch.win32 + +PATCH_FILES=$(OOO_PATCH_FILES) \ + + .IF "$(OS)"=="OS2" -# there is no wntmsci build environment in the tarball; we use custom dmakefile BUILD_ACTION=dmake BUILD_DIR=$(CONFIGURE_DIR)$/librdf - .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" +redland_CC=$(CC) -mthreads +.IF "$(MINGW_SHARED_GCCLIB)"=="YES" +redland_CC+=-shared-libgcc +.ENDIF +redland_LIBS= +.IF "$(MINGW_SHARED_GXXLIB)"=="YES" +redland_LIBS+=-lstdc++_s +.ENDIF + CONFIGURE_DIR= CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH" -CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --with-xml-parser=libxml --with-raptor=system --with-rasqual=system --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CFLAGS=-D_MT CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc,--export-all-symbols -L$(ILIB:s/;/ -L/)" LIBS=-lmingwthrd OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) ZLIB3RDLIB=$(ZLIB3RDLIB) XSLTLIB="$(XSLTLIB)" +CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-openssl-digests --with-xml-parser=libxml --with-raptor=system --with-rasqual=system --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore --with-regex-library=posix --with-decimal=none --with-www=xml --build=i586-pc-mingw32 --host=i586-pc-mingw32 lt_cv_cc_dll_switch="-shared" CC="$(redland_CC)" CPPFLAGS="-nostdinc $(INCLUDE)" LDFLAGS="-no-undefined -Wl,--enable-runtime-pseudo-reloc-v2,--export-all-symbols -L$(ILIB:s/;/ -L/)" LIBS="$(redland_LIBS)" OBJDUMP="$(WRAPCMD) objdump" LIBXML2LIB=$(LIBXML2LIB) XSLTLIB="$(XSLTLIB)" BUILD_ACTION=$(GNUMAKE) BUILD_FLAGS+= -j$(EXTMAXPROCESS) BUILD_DIR=$(CONFIGURE_DIR) @@ -88,8 +101,8 @@ CFLAGS=-m64 .ENDIF # NB: SOLARDIR before SYSBASE, because linux SYSBASE contains obsolete libcrypto -CPPFLAGS+:=-I$(SOLARINCDIR)$/external -LDFLAGS+:=-L$(SOLARLIBDIR) +CPPFLAGS+:=-I$(PWD)$/$(INCCOM) -I$(SOLARINCDIR)$/external +LDFLAGS+:=-L$(PWD)$/$(LB) -L$(SOLARLIBDIR) .IF "$(SYSBASE)"!="" CPPFLAGS+:=-I$(SYSBASE)$/usr$/include @@ -102,14 +115,13 @@ LDFLAGS+:=-L$(SYSBASE)$/lib -L$(SYSBASE)$/usr$/lib -lpthread -ldl LDFLAGS+:=-Wl,-dylib_file,@loader_path/libraptor.1.dylib:$(PWD)/$(LB)/libraptor.1.dylib .ENDIF -CPPFLAGS+:=$(EXTRA_CFLAGS) +CPPFLAGS+:=$(EXTRA_CDEFS) $(EXTRA_CFLAGS) LDFLAGS+:=$(EXTRA_LINKFLAGS) -XSLTLIB!:=$(XSLTLIB) # expand variable for (internal) xslt-config +XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config .EXPORT: CPPFLAGS .EXPORT: LDFLAGS .EXPORT: LIBXML2LIB -.EXPORT: ZLIB3RDLIB .EXPORT: XSLTLIB CONFIGURE_DIR= @@ -126,7 +138,7 @@ BUILD_DIR=$(CONFIGURE_DIR) OUT2INC+=librdf$/*.h .IF "$(OS)"=="MACOSX" -OUT2LIB+=librdf$/.libs$/librdf.0.dylib +OUT2LIB+=librdf$/.libs$/librdf.$(REDLAND_MAJOR).dylib .ELIF "$(OS)"=="WNT" .IF "$(COM)"=="GCC" OUT2LIB+=librdf$/.libs$/*.a @@ -134,12 +146,10 @@ OUT2BIN+=librdf$/.libs$/*.dll .ELSE # if we use dmake, this is done automagically .ENDIF - .ELIF "$(OS)"=="OS2" # if we use dmake, this is done automagically - .ELSE -OUT2LIB+=librdf$/.libs$/librdf.so.0 +OUT2LIB+=librdf$/.libs$/librdf.so.$(REDLAND_MAJOR) .ENDIF # --- Targets ------------------------------------------------------ diff --git a/redland/redland/redland-1.0.8.patch.autotools b/redland/redland/redland-1.0.8.patch.autotools new file mode 100644 index 0000000..5b29d0b --- /dev/null +++ b/redland/redland/redland-1.0.8.patch.autotools @@ -0,0 +1,58 @@ +--- misc/redland-1.0.8/configure Fri Jul 4 18:00:39 2008 ++++ misc/build/redland-1.0.8/configure Wed Feb 18 13:27:43 2009 +@@ -4671,7 +4671,7 @@ + + cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +@@ -4680,7 +4680,7 @@ + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then +- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' ++ lt_cv_deplibs_check_method='file_magic ^x86 archive|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' +--- misc/redland-1.0.8/ltmain.sh Tue Apr 29 23:33:55 2008 ++++ misc/build/redland-1.0.8/ltmain.sh Wed Feb 18 13:28:39 2009 +@@ -1565,6 +1565,11 @@ + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` ++ case $host_os in ++ mingw*) ++ absdir=`cygpath -m $absdir` ++ ;; ++ esac + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" +@@ -3262,9 +3267,9 @@ + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) +- current="$number_major" +- revision="$number_minor" +- age="0" ++ current=`expr $number_major + $number_minor` ++ age="$number_minor" ++ revision="$number_revision" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` +@@ -3344,8 +3349,8 @@ + ;; + + freebsd-elf) +- major=".$current" +- versuffix=".$current"; ++ major=.`expr $current - $age` ++ versuffix="$major.$age.$revision" + ;; + + irix | nonstopux) diff --git a/redland/redland/redland-1.0.8.patch.dmake b/redland/redland/redland-1.0.8.patch.dmake new file mode 100644 index 0000000..34ba51d --- /dev/null +++ b/redland/redland/redland-1.0.8.patch.dmake @@ -0,0 +1,115 @@ +--- misc/redland-1.0.8/librdf/makefile.mk Mon Jun 16 19:32:46 2008 ++++ misc/build/redland-1.0.8/librdf/makefile.mk Mon Jun 16 19:26:20 2008 +@@ -1,1 +1,111 @@ +-dummy ++#************************************************************************* ++# ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++# ++# Copyright 2000, 2010 Oracle and/or its affiliates. ++# ++# OpenOffice.org - a multi-platform office productivity suite ++# ++# This file is part of OpenOffice.org. ++# ++# OpenOffice.org is free software: you can redistribute it and/or modify ++# it under the terms of the GNU Lesser General Public License version 3 ++# only, as published by the Free Software Foundation. ++# ++# OpenOffice.org 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 Lesser General Public License version 3 for more details ++# (a copy is included in the LICENSE file that accompanied this code). ++# ++# You should have received a copy of the GNU Lesser General Public License ++# version 3 along with OpenOffice.org. If not, see ++# <http://www.openoffice.org/license.html> ++# for a copy of the LGPLv3 License. ++# ++#************************************************************************* ++ ++PRJ=..$/..$/..$/..$/.. ++ ++PRJNAME=redland ++TARGET=librdf ++LIBTARGET=NO ++UWINAPILIB= ++ ++EXTERNAL_WARNINGS_NOT_ERRORS=TRUE ++ ++ ++# --- Settings ----------------------------------------------------- ++ ++.INCLUDE : settings.mk ++ ++CDEFS+=-DLIBRDF_INTERNAL -DWIN32 -DNDEBUG -D_WINDOWS -D_USRDLL -DWIN32_EXPORTS ++ ++# --- Files -------------------------------------------------------- ++ ++SLOFILES = \ ++ $(SLO)$/rdf_concepts.obj \ ++ $(SLO)$/rdf_digest.obj \ ++ $(SLO)$/rdf_digest_md5.obj \ ++ $(SLO)$/rdf_digest_openssl.obj \ ++ $(SLO)$/rdf_digest_sha1.obj \ ++ $(SLO)$/rdf_files.obj \ ++ $(SLO)$/rdf_hash.obj \ ++ $(SLO)$/rdf_hash_cursor.obj \ ++ $(SLO)$/rdf_hash_memory.obj \ ++ $(SLO)$/rdf_heuristics.obj \ ++ $(SLO)$/rdf_init.obj \ ++ $(SLO)$/rdf_iterator.obj \ ++ $(SLO)$/rdf_list.obj \ ++ $(SLO)$/rdf_log.obj \ ++ $(SLO)$/rdf_model.obj \ ++ $(SLO)$/rdf_model_storage.obj \ ++ $(SLO)$/rdf_node.obj \ ++ $(SLO)$/rdf_parser.obj \ ++ $(SLO)$/rdf_parser_raptor.obj \ ++ $(SLO)$/rdf_query.obj \ ++ $(SLO)$/rdf_query_rasqal.obj \ ++ $(SLO)$/rdf_query_results.obj \ ++ $(SLO)$/rdf_query_triples.obj \ ++ $(SLO)$/rdf_serializer.obj \ ++ $(SLO)$/rdf_serializer_raptor.obj \ ++ $(SLO)$/rdf_statement.obj \ ++ $(SLO)$/rdf_storage.obj \ ++ $(SLO)$/rdf_storage_file.obj \ ++ $(SLO)$/rdf_storage_list.obj \ ++ $(SLO)$/rdf_storage_hashes.obj \ ++ $(SLO)$/rdf_stream.obj \ ++ $(SLO)$/rdf_uri.obj \ ++ $(SLO)$/rdf_utf8.obj \ ++ ++ ++# $(SLO)$/rdf_hash_bdb.obj \ ++# $(SLO)$/rdf_storage_mysql.obj \ ++# $(SLO)$/rdf_storage_sqlite.obj \ ++ ++ ++SHL1DEPN= makefile.mk ++SHL1OBJS= $(SLOFILES) ++ ++#SHL1TARGET= $(TARGET)$(DLLPOSTFIX) ++SHL1TARGET= $(TARGET) ++SHL1IMPLIB= $(TARGET) ++SHL1USE_EXPORTS=name ++ ++#SHL1VERSIONMAP=../service/exports.map ++SHL1DEF=$(MISC)$/$(SHL1TARGET).def ++DEF1NAME=$(SHL1TARGET) ++ ++SHL1STDLIBS= \ ++ $(OPENSSLLIB) \ ++ $(PRJ)$/$(INPATH)$/lib$/libraptor.lib \ ++ $(PRJ)$/$(INPATH)$/lib$/librasqal.lib \ ++ ++ ++#$(LIBXML2LIB) \ ++# $(XSLTLIB) \ ++ ++# --- Targets ------------------------------------------------------ ++ ++.INCLUDE : target.mk ++ diff --git a/redland/redland/redland-1.0.8.patch.legal b/redland/redland/redland-1.0.8.patch.legal new file mode 100644 index 0000000..9e9a25b --- /dev/null +++ b/redland/redland/redland-1.0.8.patch.legal @@ -0,0 +1,54 @@ +--- misc/redland-1.0.8/LICENSE.txt Tue Jul 1 07:55:28 2008 ++++ misc/build/redland-1.0.8/LICENSE.txt Thu Nov 6 12:44:39 2008 +@@ -76,3 +76,15 @@ + 10. NOTICE + 11. http://www.dajobe.org/ + 12. http://www.bristol.ac.uk/ ++ ++ ++LGPL Disclaimer ++ ++For the avoidance of doubt, except that if any license choice other ++than GPL or LGPL is available it will apply instead, Sun elects to ++use only the Lesser General Public License version 2.1 (LGPLv2) at ++this time for any software where a choice of LGPL license versions ++is made available with the language indicating that LGPLv2.1 or any ++later version may be used, or where a choice of which version of the ++LGPL is applied is otherwise unspecified. ++ +--- misc/redland-1.0.8/raptor/LICENSE.txt Sun Mar 30 06:52:22 2008 ++++ misc/build/redland-1.0.8/raptor/LICENSE.txt Thu Nov 6 12:44:39 2008 +@@ -60,3 +60,15 @@ + + Copyright (C) 2000-2008 David Beckett + Copyright (C) 2000-2005 University of Bristol ++ ++ ++LGPL Disclaimer ++ ++For the avoidance of doubt, except that if any license choice other ++than GPL or LGPL is available it will apply instead, Sun elects to ++use only the Lesser General Public License version 2.1 (LGPLv2) at ++this time for any software where a choice of LGPL license versions ++is made available with the language indicating that LGPLv2.1 or any ++later version may be used, or where a choice of which version of the ++LGPL is applied is otherwise unspecified. ++ +--- misc/redland-1.0.8/rasqal/LICENSE.txt Fri Jun 27 04:24:52 2008 ++++ misc/build/redland-1.0.8/rasqal/LICENSE.txt Thu Nov 6 12:44:40 2008 +@@ -60,3 +60,15 @@ + + Copyright (C) 2003-2008 Dave Beckett + Copyright (C) 2003-2005 University of Bristol ++ ++ ++LGPL Disclaimer ++ ++For the avoidance of doubt, except that if any license choice other ++than GPL or LGPL is available it will apply instead, Sun elects to ++use only the Lesser General Public License version 2.1 (LGPLv2) at ++this time for any software where a choice of LGPL license versions ++is made available with the language indicating that LGPLv2.1 or any ++later version may be used, or where a choice of which version of the ++LGPL is applied is otherwise unspecified. ++ diff --git a/redland/redland/redland-1.0.8.patch.ooo_build b/redland/redland/redland-1.0.8.patch.ooo_build new file mode 100644 index 0000000..805a88d --- /dev/null +++ b/redland/redland/redland-1.0.8.patch.ooo_build @@ -0,0 +1,22 @@ +--- misc/redland-1.0.8/Makefile.am 2010-02-12 08:47:40.000000000 +0000 ++++ misc/build/redland-1.0.8/Makefile.am 2010-02-12 08:47:51.000000000 +0000 +@@ -48,7 +48,7 @@ + # to ensure that the raptor and rasqal subdirectories are called + # as CONFIG_SUBDIR directories. + # +-SUBDIRS=@LOCAL_SUBDIRS@ librdf examples utils demos docs data ++SUBDIRS=@LOCAL_SUBDIRS@ librdf examples demos docs data + + EXTRA_DIST=ChangeLog ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \ + ChangeLog.5 ChangeLog.6 ChangeLog.7 \ +--- misc/redland-1.0.8/Makefile.in 2010-02-12 08:47:39.000000000 +0000 ++++ misc/build/redland-1.0.8/Makefile.in 2010-02-12 08:47:55.000000000 +0000 +@@ -283,7 +283,7 @@ + # to ensure that the raptor and rasqal subdirectories are called + # as CONFIG_SUBDIR directories. + # +-SUBDIRS = @LOCAL_SUBDIRS@ librdf examples utils demos docs data ++SUBDIRS = @LOCAL_SUBDIRS@ librdf examples demos docs data + EXTRA_DIST = ChangeLog ChangeLog.1 ChangeLog.2 ChangeLog.3 ChangeLog.4 \ + ChangeLog.5 ChangeLog.6 ChangeLog.7 \ + README NEWS LICENSE.txt TODO \ diff --git a/redland/redland/redland-1.0.8.patch.win32 b/redland/redland/redland-1.0.8.patch.win32 new file mode 100644 index 0000000..41d3503 --- /dev/null +++ b/redland/redland/redland-1.0.8.patch.win32 @@ -0,0 +1,154 @@ +--- misc/redland-1.0.8/librdf/win32_rdf_config.h Tue Jul 1 05:10:26 2008 ++++ misc/build/redland-1.0.8/librdf/win32_rdf_config.h Wed Feb 18 13:31:07 2009 +@@ -43,7 +43,8 @@ + #define HAVE_STRICMP 1 + + /* MS names for these functions */ +-#define vsnprintf _vsnprintf ++// next line breaks build on wntmsci12 ++//#define vsnprintf _vsnprintf + #define snprintf _snprintf + #define access _access + #define stricmp _stricmp +@@ -72,40 +73,40 @@ + */ + + /* BDB has close method with 2 args */ +-#define HAVE_BDB_CLOSE_2_ARGS 1 ++// #define HAVE_BDB_CLOSE_2_ARGS 1 + + /* BDB defines DBC */ +-#define HAVE_BDB_CURSOR 1 ++// #define HAVE_BDB_CURSOR 1 + + /* BDB cursor method has 4 arguments */ +-#define HAVE_BDB_CURSOR_4_ARGS 1 ++// #define HAVE_BDB_CURSOR_4_ARGS 1 + + /* BDB defines DB_TXN */ +-#define HAVE_BDB_DB_TXN 1 ++// #define HAVE_BDB_DB_TXN 1 + + /* BDB has fd method with 2 args */ +-#define HAVE_BDB_FD_2_ARGS 1 ++// #define HAVE_BDB_FD_2_ARGS 1 + + /* Have BDB hash support */ +-#define HAVE_BDB_HASH 1 ++// #define HAVE_BDB_HASH 1 + + /* BDB has open method with 6 args */ + /* #undef HAVE_BDB_OPEN_6_ARGS */ + + /* BDB has open method with 7 args */ +-#define HAVE_BDB_OPEN_7_ARGS 1 ++// #define HAVE_BDB_OPEN_7_ARGS 1 + + /* BDB has set_flags method */ +-#define HAVE_BDB_SET_FLAGS 1 ++// #define HAVE_BDB_SET_FLAGS 1 + + /* BDB has dbopen method */ + /* #undef HAVE_DBOPEN */ + + /* BDB has db_create method */ +-#define HAVE_DB_CREATE 1 ++// #define HAVE_DB_CREATE 1 + + /* Define to 1 if you have the <db.h> header file. */ +-#define HAVE_DB_H 1 ++// #define HAVE_DB_H 1 + + /* Define to 1 if you have the <dlfcn.h> header file. */ + /* undef HAVE_DLFCN_H */ +@@ -141,13 +142,13 @@ + /* #undef HAVE_LIBWWW */ + + /* Have local MD5 digest */ +-#define HAVE_LOCAL_MD5_DIGEST 1 ++// #define HAVE_LOCAL_MD5_DIGEST 1 + + /* Have local RIPEMD160 digest */ + /* #undef HAVE_LOCAL_RIPEMD160_DIGEST */ + + /* Have local SHA1 digest */ +-#define HAVE_LOCAL_SHA1_DIGEST 1 ++// #define HAVE_LOCAL_SHA1_DIGEST 1 + + /* Define to 1 if you have the <memory.h> header file. */ + #define HAVE_MEMORY_H 1 +@@ -159,25 +160,33 @@ + #define HAVE_MKTEMP 1 + + /* MySQL libraries are present */ +-#define HAVE_MYSQL 1 ++// #define HAVE_MYSQL 1 + + /* Define to 1 if you have the <openssl/crypto.h> header file. */ + /* #undef HAVE_OPENSSL_CRYPTO_H */ ++#define HAVE_OPENSSL_CRYPTO_H 1 + + /* Have openssl MD5 digest */ + /* #undef HAVE_OPENSSL_CRYPTO_MD5_DIGEST */ ++#define HAVE_OPENSSL_CRYPTO_MD5_DIGEST 1 + + /* Have openssl RIPEMD160 digest */ + /* #undef HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST */ ++#define HAVE_OPENSSL_CRYPTO_RIPEMD160_DIGEST 1 + + /* Have openssl SHA1 digest */ + /* #undef HAVE_OPENSSL_CRYPTO_SHA1_DIGEST */ ++#define HAVE_OPENSSL_CRYPTO_SHA1_DIGEST 1 + + /* Have openssl digests */ + /* #undef HAVE_OPENSSL_DIGESTS */ ++#define HAVE_OPENSSL_DIGESTS 1 + + /* Define to 1 if you have the <pthread.h> header file. */ + /* #undef HAVE_PTHREAD_H */ ++#ifdef __MINGW32__ ++#undef HAVE_PTHREAD_H ++#endif + + /* Define to 1 if you have the <stdint.h> header file. */ + #define HAVE_STDINT_H 1 +@@ -246,7 +255,7 @@ + #define SIZEOF_UNSIGNED_LONG_LONG 8 + + /* SQLite API version */ +-#define SQLITE_API 3 ++// #define SQLITE_API 3 + + /* Define to 1 if you have the ANSI C header files. */ + #define STDC_HEADERS 1 +@@ -254,14 +263,17 @@ + /* Building file storage */ + #define STORAGE_FILE 1 + ++#define STORAGE_HASHES 1 ++#define STORAGE_MEMORY 1 ++ + /* Building MySQL storage */ +-#define STORAGE_MYSQL 1 ++// #define STORAGE_MYSQL 1 + + /* Building PostgreSQL storage */ + /*#undef STORAGE_POSTGRESQL*/ + + /* Building SQLite storage */ +-#define STORAGE_SQLITE 1 ++// #define STORAGE_SQLITE 1 + + /* Building 3store storage */ + /*#undef STORAGE_TSTORE*/ +--- misc/redland-1.0.8/utils/rdfproc.c Tue Jul 1 05:10:25 2008 ++++ misc/build/redland-1.0.8/utils/rdfproc.c Wed Feb 18 13:26:41 2009 +@@ -28,7 +28,7 @@ + #endif + + #ifdef WIN32 +-#include <win32_config.h> ++#include <win32_rdf_config.h> + #endif + + #include <stdio.h> diff --git a/redland/redland/redland2.map b/redland/redland/redland2.map index 660f80a..5798f46 100644 --- a/redland/redland/redland2.map +++ b/redland/redland/redland2.map @@ -1,4 +1,4 @@ -REDLAND2 { +UDK_3_0_0 { global: GetVersionInfo; librdf_get_concept_resource_by_index; diff --git a/redland/redlandversion.mk b/redland/redlandversion.mk index 9b7f736..e5389da 100644 --- a/redland/redlandversion.mk +++ b/redland/redlandversion.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: redlandversion.mk,v $ -# -# $Revision: 1.1 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -30,8 +26,7 @@ #************************************************************************* RAPTOR_MAJOR=1 -# rasqal has no stable abi -RASQAL_MAJOR=0 +RASQAL_MAJOR=1 # redland has no stable abi REDLAND_MAJOR=0 diff --git a/rhino/download/rhino1_5R5.zip b/rhino/download/rhino1_5R5.zip Binary files differdeleted file mode 100644 index f1fb1db..0000000 --- a/rhino/download/rhino1_5R5.zip +++ /dev/null diff --git a/rhino/download/swingExSrc.zip b/rhino/download/swingExSrc.zip Binary files differdeleted file mode 100644 index 2709644..0000000 --- a/rhino/download/swingExSrc.zip +++ /dev/null diff --git a/rhino/makefile.mk b/rhino/makefile.mk index 24517b6..008fb0c 100755 --- a/rhino/makefile.mk +++ b/rhino/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.10 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -43,12 +39,14 @@ TARGET=ooo_rhino # --- Files -------------------------------------------------------- TARFILE_NAME=rhino1_5R5 +TARFILE_MD5=798b2ffdc8bcfe7bca2cf92b62caf685 TARFILE_ROOTDIR=rhino1_5R5 ADDITIONAL_FILES= \ toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java -PATCH_FILES=rhino1_5R5.patch +PATCH_FILES=rhino1_5R5.patch \ + rhino1_5R5-find_swing.patch .IF "$(JAVACISGCJ)"=="yes" JAVA_HOME= diff --git a/rhino/rhino1_5R5-find_swing.patch b/rhino/rhino1_5R5-find_swing.patch new file mode 100644 index 0000000..220c4f4 --- /dev/null +++ b/rhino/rhino1_5R5-find_swing.patch @@ -0,0 +1,20 @@ +--- misc/rhino1_5R5/toolsrc/build.xml 2009-10-29 18:29:46.605524507 +0100 ++++ misc/build/rhino1_5R5/toolsrc/build.xml 2009-10-29 18:29:26.536908810 +0100 +@@ -12,6 +12,8 @@ + <os family="unix"/> + </and> + </condition> ++ <property environment="solenv"/> ++ <property name="swing_zip" value="${solenv.TARFILE_LOCATION}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip"/> + <path id="macPath" location="${java.home}/../Classes/classes.jar"/> + <!-- rhino.jar from OpenJDK breaks build --> + <path id="nonMacPath"> +@@ -38,7 +42,7 @@ + <!-- Download source from Sun's site, unzip it, remove + the files we don't need, and change the package + --> +- <unzip src="../../../../../download/swingExSrc.zip" dest="${src.debugger}"/> ++ <unzip src="${swing_zip}" dest="${src.debugger}"/> + <delete file="${src.debugger}/FileSystemModel2.java" /> + <delete file="${src.debugger}/MergeSort.java" /> + <delete file="${src.debugger}/TreeTableExample2.java" /> diff --git a/rhino/rhino1_5R5.patch b/rhino/rhino1_5R5.patch index 1c8fb23..21b4a48 100644 --- a/rhino/rhino1_5R5.patch +++ b/rhino/rhino1_5R5.patch @@ -1043,19 +1043,16 @@ --- misc/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java Fri Mar 28 17:25:34 2008 +++ misc/build/rhino1_5R5/toolsrc/org/mozilla/javascript/tools/debugger/OfficeScriptInfo.java Fri Mar 28 17:24:59 2008 -@@ -1 +1,133 @@ +@@ -1 +1,130 @@ -dummy +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * -+ * Copyright 2008 by Sun Microsystems, Inc. ++ * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * -+ * $RCSfile: rhino1_5R5.patch,v $ -+ * $Revision: 1.3 $ -+ * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/twain/util/makefile.mk b/twain/util/makefile.mk index de99d74..043de88 100644 --- a/twain/util/makefile.mk +++ b/twain/util/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.4 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/unixODBC/inc/sql.h b/unixODBC/inc/sql.h index 8aa1708..7ff7a40 100644 --- a/unixODBC/inc/sql.h +++ b/unixODBC/inc/sql.h @@ -7,6 +7,7 @@ #ifndef __SQL_H #define __SQL_H + /**************************** * default to 3.51 declare something else before here and you get a whole new ball of wax ***************************/ @@ -14,7 +15,9 @@ #define ODBCVER 0x0351 #endif -#include "sqltypes.h" +#ifndef __SQLTYPES_H +#include "odbc/sqltypes.h" +#endif #ifdef __cplusplus extern "C" { @@ -270,6 +273,7 @@ extern "C" { #define SQL_NULL_HSTMT 0 #if (ODBCVER >= 0x0300) #define SQL_NULL_HDESC 0 +#define SQL_NULL_DESC 0 #endif /* null handle used in place of parent handle when allocating HENV */ @@ -562,254 +566,257 @@ extern "C" { #define SQL_NC_HIGH 0 #define SQL_NC_LOW 1 -SQLRETURN SQLAllocConnect(SQLHENV EnvironmentHandle, - SQLHDBC *ConnectionHandle); + SQLRETURN SQL_API SQLAllocConnect(SQLHENV EnvironmentHandle, + SQLHDBC *ConnectionHandle); -SQLRETURN SQLAllocEnv(SQLHENV *EnvironmentHandle); + SQLRETURN SQL_API SQLAllocEnv(SQLHENV *EnvironmentHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLAllocHandle(SQLSMALLINT HandleType, - SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); + SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT HandleType, + SQLHANDLE InputHandle, SQLHANDLE *OutputHandle); #endif -SQLRETURN SQLAllocStmt(SQLHDBC ConnectionHandle, - SQLHSTMT *StatementHandle); + SQLRETURN SQL_API SQLAllocStmt(SQLHDBC ConnectionHandle, + SQLHSTMT *StatementHandle); -SQLRETURN SQLBindCol(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLINTEGER BufferLength, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLBindCol(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, + SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) -SQLRETURN SQLBindParam(SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLBindParam(SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, + SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, + SQLLEN *StrLen_or_Ind); #endif -SQLRETURN SQLCancel(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLCancel(SQLHSTMT StatementHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLCloseCursor(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLCloseCursor(SQLHSTMT StatementHandle); -SQLRETURN SQLColAttribute (SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, - SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength, SQLPOINTER NumericAttribute); + SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLUSMALLINT FieldIdentifier, + SQLPOINTER CharacterAttribute, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength, SQLLEN *NumericAttribute + /* spec says (SQLPOINTER) not (SQLEN*) - PAH */ ); + /* Ms now say SQLLEN* http://msdn.microsoft.com/library/en-us/odbc/htm/dasdkodbcoverview_64bit.asp - NG */ + #endif -SQLRETURN SQLColumns(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLCHAR *ColumnName, SQLSMALLINT NameLength4); + SQLRETURN SQL_API SQLColumns(SQLHSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *ColumnName, SQLSMALLINT NameLength4); -SQLRETURN SQLConnect(SQLHDBC ConnectionHandle, - SQLCHAR *ServerName, SQLSMALLINT NameLength1, - SQLCHAR *UserName, SQLSMALLINT NameLength2, - SQLCHAR *Authentication, SQLSMALLINT NameLength3); + SQLRETURN SQL_API SQLConnect(SQLHDBC ConnectionHandle, + SQLCHAR *ServerName, SQLSMALLINT NameLength1, + SQLCHAR *UserName, SQLSMALLINT NameLength2, + SQLCHAR *Authentication, SQLSMALLINT NameLength3); #if (ODBCVER >= 0x0300) -SQLRETURN SQLCopyDesc(SQLHDESC SourceDescHandle, - SQLHDESC TargetDescHandle); + SQLRETURN SQL_API SQLCopyDesc(SQLHDESC SourceDescHandle, + SQLHDESC TargetDescHandle); #endif -SQLRETURN SQLDataSources(SQLHENV EnvironmentHandle, - SQLUSMALLINT Direction, SQLCHAR *ServerName, - SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, - SQLCHAR *Description, SQLSMALLINT BufferLength2, - SQLSMALLINT *NameLength2); + SQLRETURN SQL_API SQLDataSources(SQLHENV EnvironmentHandle, + SQLUSMALLINT Direction, SQLCHAR *ServerName, + SQLSMALLINT BufferLength1, SQLSMALLINT *NameLength1, + SQLCHAR *Description, SQLSMALLINT BufferLength2, + SQLSMALLINT *NameLength2); -SQLRETURN SQLDescribeCol(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, - SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, - SQLSMALLINT *DataType, SQLUINTEGER *ColumnSize, - SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); + SQLRETURN SQL_API SQLDescribeCol(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLCHAR *ColumnName, + SQLSMALLINT BufferLength, SQLSMALLINT *NameLength, + SQLSMALLINT *DataType, SQLULEN *ColumnSize, + SQLSMALLINT *DecimalDigits, SQLSMALLINT *Nullable); -SQLRETURN SQLDisconnect(SQLHDBC ConnectionHandle); + SQLRETURN SQL_API SQLDisconnect(SQLHDBC ConnectionHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT CompletionType); + SQLRETURN SQL_API SQLEndTran(SQLSMALLINT HandleType, SQLHANDLE Handle, + SQLSMALLINT CompletionType); #endif -SQLRETURN SQLError(SQLHENV EnvironmentHandle, - SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, - SQLCHAR *Sqlstate, SQLINTEGER *NativeError, - SQLCHAR *MessageText, SQLSMALLINT BufferLength, - SQLSMALLINT *TextLength); + SQLRETURN SQL_API SQLError(SQLHENV EnvironmentHandle, + SQLHDBC ConnectionHandle, SQLHSTMT StatementHandle, + SQLCHAR *Sqlstate, SQLINTEGER *NativeError, + SQLCHAR *MessageText, SQLSMALLINT BufferLength, + SQLSMALLINT *TextLength); -SQLRETURN SQLExecDirect(SQLHSTMT StatementHandle, - SQLCHAR *StatementText, SQLINTEGER TextLength); + SQLRETURN SQL_API SQLExecDirect(SQLHSTMT StatementHandle, + SQLCHAR *StatementText, SQLINTEGER TextLength); -SQLRETURN SQLExecute(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLExecute(SQLHSTMT StatementHandle); -SQLRETURN SQLFetch(SQLHSTMT StatementHandle); + SQLRETURN SQL_API SQLFetch(SQLHSTMT StatementHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLFetchScroll(SQLHSTMT StatementHandle, - SQLSMALLINT FetchOrientation, SQLINTEGER FetchOffset); + SQLRETURN SQL_API SQLFetchScroll(SQLHSTMT StatementHandle, + SQLSMALLINT FetchOrientation, SQLLEN FetchOffset); #endif -SQLRETURN SQLFreeConnect(SQLHDBC ConnectionHandle); + SQLRETURN SQL_API SQLFreeConnect(SQLHDBC ConnectionHandle); -SQLRETURN SQLFreeEnv(SQLHENV EnvironmentHandle); + SQLRETURN SQL_API SQLFreeEnv(SQLHENV EnvironmentHandle); #if (ODBCVER >= 0x0300) -SQLRETURN SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); + SQLRETURN SQL_API SQLFreeHandle(SQLSMALLINT HandleType, SQLHANDLE Handle); #endif -SQLRETURN SQLFreeStmt(SQLHSTMT StatementHandle, - SQLUSMALLINT Option); + SQLRETURN SQL_API SQLFreeStmt(SQLHSTMT StatementHandle, + SQLUSMALLINT Option); #if (ODBCVER >= 0x0300) -SQLRETURN SQLGetConnectAttr(SQLHDBC ConnectionHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength); + SQLRETURN SQL_API SQLGetConnectAttr(SQLHDBC ConnectionHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif -SQLRETURN SQLGetConnectOption(SQLHDBC ConnectionHandle, - SQLUSMALLINT Option, SQLPOINTER Value); + SQLRETURN SQL_API SQLGetConnectOption(SQLHDBC ConnectionHandle, + SQLUSMALLINT Option, SQLPOINTER Value); -SQLRETURN SQLGetCursorName(SQLHSTMT StatementHandle, - SQLCHAR *CursorName, SQLSMALLINT BufferLength, - SQLSMALLINT *NameLength); + SQLRETURN SQL_API SQLGetCursorName(SQLHSTMT StatementHandle, + SQLCHAR *CursorName, SQLSMALLINT BufferLength, + SQLSMALLINT *NameLength); -SQLRETURN SQLGetData(SQLHSTMT StatementHandle, - SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, - SQLPOINTER TargetValue, SQLINTEGER BufferLength, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLGetData(SQLHSTMT StatementHandle, + SQLUSMALLINT ColumnNumber, SQLSMALLINT TargetType, + SQLPOINTER TargetValue, SQLLEN BufferLength, + SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) -SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength, - SQLINTEGER *StringLength); + SQLRETURN SQLGetDescField(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength, + SQLINTEGER *StringLength); -SQLRETURN SQLGetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLCHAR *Name, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, - SQLSMALLINT *Type, SQLSMALLINT *SubType, - SQLINTEGER *Length, SQLSMALLINT *Precision, - SQLSMALLINT *Scale, SQLSMALLINT *Nullable); + SQLRETURN SQL_API SQLGetDescRec(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLCHAR *Name, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength, + SQLSMALLINT *Type, SQLSMALLINT *SubType, + SQLLEN *Length, SQLSMALLINT *Precision, + SQLSMALLINT *Scale, SQLSMALLINT *Nullable); -SQLRETURN SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, - SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength); + SQLRETURN SQL_API SQLGetDiagField(SQLSMALLINT HandleType, SQLHANDLE Handle, + SQLSMALLINT RecNumber, SQLSMALLINT DiagIdentifier, + SQLPOINTER DiagInfo, SQLSMALLINT BufferLength, + SQLSMALLINT *StringLength); -SQLRETURN SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, - SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, - SQLINTEGER *NativeError, SQLCHAR *MessageText, - SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); + SQLRETURN SQL_API SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, + SQLSMALLINT RecNumber, SQLCHAR *Sqlstate, + SQLINTEGER *NativeError, SQLCHAR *MessageText, + SQLSMALLINT BufferLength, SQLSMALLINT *TextLength); -SQLRETURN SQLGetEnvAttr(SQLHENV EnvironmentHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength); + SQLRETURN SQL_API SQLGetEnvAttr(SQLHENV EnvironmentHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLGetFunctions(SQLHDBC ConnectionHandle, - SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); + SQLRETURN SQL_API SQLGetFunctions(SQLHDBC ConnectionHandle, + SQLUSMALLINT FunctionId, SQLUSMALLINT *Supported); -SQLRETURN SQLGetInfo(SQLHDBC ConnectionHandle, - SQLUSMALLINT InfoType, SQLPOINTER InfoValue, - SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); + SQLRETURN SQL_API SQLGetInfo(SQLHDBC ConnectionHandle, + SQLUSMALLINT InfoType, SQLPOINTER InfoValue, + SQLSMALLINT BufferLength, SQLSMALLINT *StringLength); #if (ODBCVER >= 0x0300) -SQLRETURN SQLGetStmtAttr(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER BufferLength, SQLINTEGER *StringLength); + SQLRETURN SQL_API SQLGetStmtAttr(SQLHSTMT StatementHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER BufferLength, SQLINTEGER *StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLGetStmtOption(SQLHSTMT StatementHandle, - SQLUSMALLINT Option, SQLPOINTER Value); + SQLRETURN SQL_API SQLGetStmtOption(SQLHSTMT StatementHandle, + SQLUSMALLINT Option, SQLPOINTER Value); -SQLRETURN SQLGetTypeInfo(SQLHSTMT StatementHandle, - SQLSMALLINT DataType); + SQLRETURN SQL_API SQLGetTypeInfo(SQLHSTMT StatementHandle, + SQLSMALLINT DataType); -SQLRETURN SQLNumResultCols(SQLHSTMT StatementHandle, - SQLSMALLINT *ColumnCount); + SQLRETURN SQL_API SQLNumResultCols(SQLHSTMT StatementHandle, + SQLSMALLINT *ColumnCount); -SQLRETURN SQLParamData(SQLHSTMT StatementHandle, - SQLPOINTER *Value); + SQLRETURN SQL_API SQLParamData(SQLHSTMT StatementHandle, + SQLPOINTER *Value); -SQLRETURN SQLPrepare(SQLHSTMT StatementHandle, - SQLCHAR *StatementText, SQLINTEGER TextLength); + SQLRETURN SQL_API SQLPrepare(SQLHSTMT StatementHandle, + SQLCHAR *StatementText, SQLINTEGER TextLength); -SQLRETURN SQLPutData(SQLHSTMT StatementHandle, - SQLPOINTER Data, SQLINTEGER StrLen_or_Ind); + SQLRETURN SQL_API SQLPutData(SQLHSTMT StatementHandle, + SQLPOINTER Data, SQLLEN StrLen_or_Ind); -SQLRETURN SQLRowCount(SQLHSTMT StatementHandle, - SQLINTEGER *RowCount); + SQLRETURN SQL_API SQLRowCount(SQLHSTMT StatementHandle, + SQLLEN *RowCount); #if (ODBCVER >= 0x0300) -SQLRETURN SQLSetConnectAttr(SQLHDBC ConnectionHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength); + SQLRETURN SQL_API SQLSetConnectAttr(SQLHDBC ConnectionHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLSetConnectOption(SQLHDBC ConnectionHandle, - SQLUSMALLINT Option, SQLUINTEGER Value); + SQLRETURN SQL_API SQLSetConnectOption(SQLHDBC ConnectionHandle, + SQLUSMALLINT Option, SQLULEN Value); -SQLRETURN SQLSetCursorName(SQLHSTMT StatementHandle, - SQLCHAR *CursorName, SQLSMALLINT NameLength); + SQLRETURN SQL_API SQLSetCursorName(SQLHSTMT StatementHandle, + SQLCHAR *CursorName, SQLSMALLINT NameLength); #if (ODBCVER >= 0x0300) -SQLRETURN SQLSetDescField(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, - SQLPOINTER Value, SQLINTEGER BufferLength); + SQLRETURN SQL_API SQLSetDescField(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, SQLINTEGER BufferLength); -SQLRETURN SQLSetDescRec(SQLHDESC DescriptorHandle, - SQLSMALLINT RecNumber, SQLSMALLINT Type, - SQLSMALLINT SubType, SQLINTEGER Length, - SQLSMALLINT Precision, SQLSMALLINT Scale, - SQLPOINTER Data, SQLINTEGER *StringLength, - SQLINTEGER *Indicator); + SQLRETURN SQL_API SQLSetDescRec(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, SQLSMALLINT Type, + SQLSMALLINT SubType, SQLLEN Length, + SQLSMALLINT Precision, SQLSMALLINT Scale, + SQLPOINTER Data, SQLLEN *StringLength, + SQLLEN *Indicator); -SQLRETURN SQLSetEnvAttr(SQLHENV EnvironmentHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength); + SQLRETURN SQL_API SQLSetEnvAttr(SQLHENV EnvironmentHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLSetParam(SQLHSTMT StatementHandle, - SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, - SQLSMALLINT ParameterType, SQLUINTEGER LengthPrecision, - SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, - SQLINTEGER *StrLen_or_Ind); + SQLRETURN SQL_API SQLSetParam(SQLHSTMT StatementHandle, + SQLUSMALLINT ParameterNumber, SQLSMALLINT ValueType, + SQLSMALLINT ParameterType, SQLULEN LengthPrecision, + SQLSMALLINT ParameterScale, SQLPOINTER ParameterValue, + SQLLEN *StrLen_or_Ind); #if (ODBCVER >= 0x0300) -SQLRETURN SQLSetStmtAttr(SQLHSTMT StatementHandle, - SQLINTEGER Attribute, SQLPOINTER Value, - SQLINTEGER StringLength); + SQLRETURN SQL_API SQLSetStmtAttr(SQLHSTMT StatementHandle, + SQLINTEGER Attribute, SQLPOINTER Value, + SQLINTEGER StringLength); #endif -SQLRETURN SQLSetStmtOption(SQLHSTMT StatementHandle, - SQLUSMALLINT Option, SQLUINTEGER Value); + SQLRETURN SQL_API SQLSetStmtOption(SQLHSTMT StatementHandle, + SQLUSMALLINT Option, SQLULEN Value); -SQLRETURN SQLSpecialColumns(SQLHSTMT StatementHandle, - SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, - SQLSMALLINT NameLength1, SQLCHAR *SchemaName, - SQLSMALLINT NameLength2, SQLCHAR *TableName, - SQLSMALLINT NameLength3, SQLUSMALLINT Scope, - SQLUSMALLINT Nullable); + SQLRETURN SQL_API SQLSpecialColumns(SQLHSTMT StatementHandle, + SQLUSMALLINT IdentifierType, SQLCHAR *CatalogName, + SQLSMALLINT NameLength1, SQLCHAR *SchemaName, + SQLSMALLINT NameLength2, SQLCHAR *TableName, + SQLSMALLINT NameLength3, SQLUSMALLINT Scope, + SQLUSMALLINT Nullable); -SQLRETURN SQLStatistics(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLUSMALLINT Unique, SQLUSMALLINT Reserved); + SQLRETURN SQL_API SQLStatistics(SQLHSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLUSMALLINT Unique, SQLUSMALLINT Reserved); -SQLRETURN SQLTables(SQLHSTMT StatementHandle, - SQLCHAR *CatalogName, SQLSMALLINT NameLength1, - SQLCHAR *SchemaName, SQLSMALLINT NameLength2, - SQLCHAR *TableName, SQLSMALLINT NameLength3, - SQLCHAR *TableType, SQLSMALLINT NameLength4); + SQLRETURN SQL_API SQLTables(SQLHSTMT StatementHandle, + SQLCHAR *CatalogName, SQLSMALLINT NameLength1, + SQLCHAR *SchemaName, SQLSMALLINT NameLength2, + SQLCHAR *TableName, SQLSMALLINT NameLength3, + SQLCHAR *TableType, SQLSMALLINT NameLength4); -SQLRETURN SQLTransact(SQLHENV EnvironmentHandle, - SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); + SQLRETURN SQL_API SQLTransact(SQLHENV EnvironmentHandle, + SQLHDBC ConnectionHandle, SQLUSMALLINT CompletionType); #ifdef __cplusplus } diff --git a/unixODBC/inc/sqlext.h b/unixODBC/inc/sqlext.h index 03f3c74..ca07d60 100644 --- a/unixODBC/inc/sqlext.h +++ b/unixODBC/inc/sqlext.h @@ -39,7 +39,9 @@ /* END - unixODBC ONLY */ -#include "sql.h" +#ifndef __SQL_H +#include "odbc/sql.h" +#endif #ifdef __cplusplus extern "C" { /* Assume C declarations for C++ */ @@ -47,8 +49,8 @@ extern "C" { /* Assume C declarations for C++ */ /* generally useful constants */ #define SQL_SPEC_MAJOR 3 /* Major version of specification */ -#define SQL_SPEC_MINOR 51 /* Minor version of specification */ -#define SQL_SPEC_STRING "03.51" /* String constant for version */ +#define SQL_SPEC_MINOR 52 /* Minor version of specification */ +#define SQL_SPEC_STRING "03.52" /* String constant for version */ #define SQL_SQLSTATE_SIZE 5 /* size of SQLSTATE */ #define SQL_MAX_DSN_LENGTH 32 /* maximum data source name size */ @@ -72,6 +74,11 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_ATTR_ODBC_VERSION 200 #define SQL_ATTR_CONNECTION_POOLING 201 #define SQL_ATTR_CP_MATCH 202 + +/* unixODBC additions */ +#define SQL_ATTR_UNIXODBC_SYSPATH 65001 +#define SQL_ATTR_UNIXODBC_VERSION 65002 +#define SQL_ATTR_UNIXODBC_ENVATTR 65003 #endif /* ODBCVER >= 0x0300 */ #if (ODBCVER >= 0x0300) @@ -127,6 +134,8 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_ATTR_CONNECTION_DEAD 1209 /* GetConnectAttr only */ +#define SQL_ATTR_DRIVER_THREADING 1028 /* Driver threading level */ + #if (ODBCVER >= 0x0351) /* ODBC Driver Manager sets this connection attribute to a unicode driver (which supports SQLConnectW) when the application is an ANSI application @@ -170,7 +179,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_OPT_TRACE_OFF 0UL #define SQL_OPT_TRACE_ON 1UL #define SQL_OPT_TRACE_DEFAULT SQL_OPT_TRACE_OFF -#define SQL_OPT_TRACE_FILE_DEFAULT "\\SQL.LOG" +#define SQL_OPT_TRACE_FILE_DEFAULT "/tmp/SQL.LOG" /* SQL_ODBC_CURSORS options */ #define SQL_CUR_USE_IF_NEEDED 0UL @@ -516,7 +525,12 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_C_ULONG (SQL_C_LONG+SQL_UNSIGNED_OFFSET) /* UNSIGNED INTEGER*/ #define SQL_C_USHORT (SQL_C_SHORT+SQL_UNSIGNED_OFFSET) /* UNSIGNED SMALLINT*/ #define SQL_C_UTINYINT (SQL_TINYINT+SQL_UNSIGNED_OFFSET) /* UNSIGNED TINYINT*/ + +#if (ODBCVER >= 0x0300) && (SIZEOF_LONG_INT == 8) && !defined(BUILD_LEGACY_64_BIT_MODE) +#define SQL_C_BOOKMARK SQL_C_UBIGINT /* BOOKMARK */ +#else #define SQL_C_BOOKMARK SQL_C_ULONG /* BOOKMARK */ +#endif #if (ODBCVER >= 0x0350) #define SQL_C_GUID SQL_GUID @@ -751,6 +765,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_CONVERT_VARBINARY 69 #define SQL_CONVERT_VARCHAR 70 #define SQL_CONVERT_LONGVARBINARY 71 +#define SQL_CONVERT_GUID 173 #define SQL_ODBC_SQL_OPT_IEF 73 /* SQL_INTEGRITY */ #define SQL_CORRELATION_NAME 74 #define SQL_NON_NULLABLE_COLUMNS 75 @@ -780,7 +795,9 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_QUALIFIER_LOCATION 114 #if (ODBCVER >= 0x0201 && ODBCVER < 0x0300) +#ifndef SQL_OJ_CAPABILITIES #define SQL_OJ_CAPABILITIES 65003 /* Temp value until ODBC 3.0 */ +#endif #endif /* ODBCVER >= 0x0201 && ODBCVER < 0x0300 */ /*----------------------------------------------*/ @@ -927,6 +944,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_CVT_WCHAR 0x00200000L #define SQL_CVT_WLONGVARCHAR 0x00400000L #define SQL_CVT_WVARCHAR 0x00800000L +#define SQL_CVT_GUID 0x01000000L #endif /* ODBCVER >= 0x0300 */ @@ -1199,7 +1217,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_FILE_NOT_SUPPORTED 0x0000 #define SQL_FILE_TABLE 0x0001 #define SQL_FILE_QUALIFIER 0x0002 -#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER // ODBC 3.0 +#define SQL_FILE_CATALOG SQL_FILE_QUALIFIER /* ODBC 3.0 */ /* SQL_GETDATA_EXTENSIONS values */ @@ -1688,7 +1706,7 @@ extern "C" { /* Assume C declarations for C++ */ #define SQL_DRIVER_PROMPT 2 #define SQL_DRIVER_COMPLETE_REQUIRED 3 -SQLRETURN SQLDriverConnect( +SQLRETURN SQL_API SQLDriverConnect( SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *szConnStrIn, @@ -1762,8 +1780,7 @@ SQLRETURN SQLDriverConnect( #define SQL_PT_FUNCTION 2 /* This define is too large for RC */ -#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS," -/* +#define SQL_ODBC_KEYWORDS "ABSOLUTE,ACTION,ADA,ADD,ALL,ALLOCATE,ALTER,AND,ANY,ARE,AS,"\ "ASC,ASSERTION,AT,AUTHORIZATION,AVG,"\ "BEGIN,BETWEEN,BIT,BIT_LENGTH,BOTH,BY,CASCADE,CASCADED,CASE,CAST,CATALOG,"\ "CHAR,CHAR_LENGTH,CHARACTER,CHARACTER_LENGTH,CHECK,CLOSE,COALESCE,"\ @@ -1794,9 +1811,8 @@ SQLRETURN SQLDriverConnect( "UNION,UNIQUE,UNKNOWN,UPDATE,UPPER,USAGE,USER,USING,"\ "VALUE,VALUES,VARCHAR,VARYING,VIEW,WHEN,WHENEVER,WHERE,WITH,WORK,WRITE,"\ "YEAR,ZONE" -*/ -SQLRETURN SQLBrowseConnect( +SQLRETURN SQL_API SQLBrowseConnect( SQLHDBC hdbc, SQLCHAR *szConnStrIn, SQLSMALLINT cbConnStrIn, @@ -1805,21 +1821,21 @@ SQLRETURN SQLBrowseConnect( SQLSMALLINT *pcbConnStrOut); #if (ODBCVER >= 0x0300) -SQLRETURN SQLBulkOperations( +SQLRETURN SQL_API SQLBulkOperations( SQLHSTMT StatementHandle, SQLSMALLINT Operation); #endif /* ODBCVER >= 0x0300 */ -SQLRETURN SQLColAttributes( +SQLRETURN SQL_API SQLColAttributes( SQLHSTMT hstmt, SQLUSMALLINT icol, SQLUSMALLINT fDescType, SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLINTEGER *pfDesc); + SQLLEN *pfDesc); -SQLRETURN SQLColumnPrivileges( +SQLRETURN SQL_API SQLColumnPrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1830,22 +1846,22 @@ SQLRETURN SQLColumnPrivileges( SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); -SQLRETURN SQLDescribeParam( +SQLRETURN SQL_API SQLDescribeParam( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT *pfSqlType, - SQLUINTEGER *pcbParamDef, + SQLULEN *pcbParamDef, SQLSMALLINT *pibScale, SQLSMALLINT *pfNullable); -SQLRETURN SQLExtendedFetch( +SQLRETURN SQL_API SQLExtendedFetch( SQLHSTMT hstmt, SQLUSMALLINT fFetchType, - SQLINTEGER irow, - SQLUINTEGER *pcrow, - SQLUSMALLINT *rgfRowStatus); + SQLLEN irow, + SQLULEN *pcrow, + SQLUSMALLINT *rgfRowStatus); -SQLRETURN SQLForeignKeys( +SQLRETURN SQL_API SQLForeignKeys( SQLHSTMT hstmt, SQLCHAR *szPkCatalogName, SQLSMALLINT cbPkCatalogName, @@ -1860,10 +1876,10 @@ SQLRETURN SQLForeignKeys( SQLCHAR *szFkTableName, SQLSMALLINT cbFkTableName); -SQLRETURN SQLMoreResults( +SQLRETURN SQL_API SQLMoreResults( SQLHSTMT hstmt); -SQLRETURN SQLNativeSql( +SQLRETURN SQL_API SQLNativeSql( SQLHDBC hdbc, SQLCHAR *szSqlStrIn, SQLINTEGER cbSqlStrIn, @@ -1871,16 +1887,16 @@ SQLRETURN SQLNativeSql( SQLINTEGER cbSqlStrMax, SQLINTEGER *pcbSqlStr); -SQLRETURN SQLNumParams( +SQLRETURN SQL_API SQLNumParams( SQLHSTMT hstmt, SQLSMALLINT *pcpar); -SQLRETURN SQLParamOptions( +SQLRETURN SQL_API SQLParamOptions( SQLHSTMT hstmt, - SQLUINTEGER crow, - SQLUINTEGER *pirow); + SQLULEN crow, + SQLULEN *pirow); -SQLRETURN SQLPrimaryKeys( +SQLRETURN SQL_API SQLPrimaryKeys( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1889,7 +1905,7 @@ SQLRETURN SQLPrimaryKeys( SQLCHAR *szTableName, SQLSMALLINT cbTableName); -SQLRETURN SQLProcedureColumns( +SQLRETURN SQL_API SQLProcedureColumns( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1900,7 +1916,7 @@ SQLRETURN SQLProcedureColumns( SQLCHAR *szColumnName, SQLSMALLINT cbColumnName); -SQLRETURN SQLProcedures( +SQLRETURN SQL_API SQLProcedures( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1909,13 +1925,13 @@ SQLRETURN SQLProcedures( SQLCHAR *szProcName, SQLSMALLINT cbProcName); -SQLRETURN SQLSetPos( +SQLRETURN SQL_API SQLSetPos( SQLHSTMT hstmt, - SQLUSMALLINT irow, + SQLSETPOSIROW irow, SQLUSMALLINT fOption, SQLUSMALLINT fLock); -SQLRETURN SQLTablePrivileges( +SQLRETURN SQL_API SQLTablePrivileges( SQLHSTMT hstmt, SQLCHAR *szCatalogName, SQLSMALLINT cbCatalogName, @@ -1924,7 +1940,7 @@ SQLRETURN SQLTablePrivileges( SQLCHAR *szTableName, SQLSMALLINT cbTableName); -SQLRETURN SQLDrivers( +SQLRETURN SQL_API SQLDrivers( SQLHENV henv, SQLUSMALLINT fDirection, SQLCHAR *szDriverDesc, @@ -1934,17 +1950,17 @@ SQLRETURN SQLDrivers( SQLSMALLINT cbDrvrAttrMax, SQLSMALLINT *pcbDrvrAttr); -SQLRETURN SQLBindParameter( +SQLRETURN SQL_API SQLBindParameter( SQLHSTMT hstmt, SQLUSMALLINT ipar, SQLSMALLINT fParamType, SQLSMALLINT fCType, SQLSMALLINT fSqlType, - SQLUINTEGER cbColDef, + SQLULEN cbColDef, SQLSMALLINT ibScale, SQLPOINTER rgbValue, - SQLINTEGER cbValueMax, - SQLINTEGER *pcbValue); + SQLLEN cbValueMax, + SQLLEN *pcbValue); /*---------------------------------------------------------*/ /* SQLAllocHandleStd is implemented to make SQLAllocHandle */ @@ -1972,7 +1988,7 @@ SQLRETURN SQLBindParameter( #endif /* ODBC_STD */ #if (ODBCVER >= 0x0300) -SQLRETURN SQLAllocHandleStd( +SQLRETURN SQL_API SQLAllocHandleStd( SQLSMALLINT fHandleType, SQLHANDLE hInput, SQLHANDLE *phOutput); @@ -1999,20 +2015,56 @@ SQLRETURN SQLAllocHandleStd( #define SQL_SCROLL_STATIC (-3L) /*-SQL_CURSOR_STATIC */ /* Deprecated functions from prior versions of ODBC */ -SQLRETURN SQLSetScrollOptions( /* Use SQLSetStmtOptions */ +SQLRETURN SQL_API SQLSetScrollOptions( /* Use SQLSetStmtOptions */ SQLHSTMT hstmt, SQLUSMALLINT fConcurrency, - SQLINTEGER crowKeyset, + SQLLEN crowKeyset, SQLUSMALLINT crowRowset); -/* Tracing section */ - -#define TRACE_VERSION 1000 /* Version of trace API */ - -RETCODE TraceOpenLogFile(LPWSTR,LPWSTR,DWORD); /* open a trace log file */ -RETCODE TraceCloseLogFile(); /* Request to close a trace log */ -VOID TraceReturn(RETCODE,RETCODE); /* Processes trace after FN is called */ -DWORD TraceVersion(); /* Returns trace API version */ +/*! + * \defgroup Tracing. + * + * unixODBC implements a slight variation of the tracing mechanism used + * on MS platforms. The unixODBC method loses the ability to produce trace + * output for invalid handles but gains the following; + * + * - better concurrency + * - allows tracing to be turned on/off and configured at finer granularity + * - hopefully; better performance + * + * unixODBC provides a cross-platform helper library called 'trace' and an + * example/default trace plugin called 'odbctrac'. Those writing an ODBC + * driver can use the 'trace' helper library (a static library). Those wanting + * to create custom trace output can implement a different version of the + * 'odbctrac' plugin. + * + * The text file driver (odbctxt) included with unixODBC is an example of a + * driver using the 'trace' helper library. + * + * The 'trace' library and the example plugin 'odbctrac' are designed to be + * portable on all platforms where unixODBC is available and on MS platforms. + * This will allow drivers using 'trace' and 'odbctrac' plugin to equilly + * portable. On MS platforms - this compliments traditional tracing (mostly + * just used by the Driver Manager). + * + * \sa trace + * odbctxt + * odbctrac + */ +/*@{*/ +#define TRACE_VERSION 1000 /*!< Version of trace API */ +#ifdef UNICODE +RETCODE TraceOpenLogFile(SQLPOINTER,LPWSTR,LPWSTR,DWORD); /*!< open a trace log file */ +#else +RETCODE TraceOpenLogFile(SQLPOINTER,LPSTR,LPSTR,DWORD); /*!< open a trace log file */ +#endif +RETCODE TraceCloseLogFile(SQLPOINTER); /*!< Request to close a trace log */ +SQLRETURN TraceReturn(SQLPOINTER,SQLRETURN); /*!< Call to produce trace output upon function return. */ +#ifdef __cplusplus +DWORD TraceVersion(); /*!< Returns trace API version */ +#else +DWORD TraceVersion(VOID); /*!< Returns trace API version */ +#endif /* Functions for Visual Studio Analyzer*/ /* to turn on/off tracing or VS events, call TraceVSControl by setting or clearing the following bits */ @@ -2028,7 +2080,11 @@ RETCODE TraceVSControl(DWORD); #define ODBC_VS_FLAG_STOP 0x00000008L /* Stop firing visual studio analyzer events */ typedef struct tagODBC_VS_ARGS { +#ifdef GUID_DEFINED const GUID *pguidEvent; /* the GUID for event */ +#else + const void *pguidEvent; /* the GUID for event */ +#endif DWORD dwFlags; /* flags for the call */ union { WCHAR *wszArg; @@ -2042,10 +2098,25 @@ typedef struct tagODBC_VS_ARGS { } ODBC_VS_ARGS, *PODBC_VS_ARGS; VOID FireVSDebugEvent(PODBC_VS_ARGS); - +/*@}*/ #ifdef __cplusplus } #endif +/* + * connection pooling retry times + */ + +BOOL ODBCSetTryWaitValue ( DWORD dwValue ); +#ifdef __cplusplus +DWORD ODBCGetTryWaitValue ( ); +#else +DWORD ODBCGetTryWaitValue ( VOID ); +#endif + +#ifndef __SQLUCODE_H +#include "odbc/sqlucode.h" +#endif + #endif diff --git a/unixODBC/inc/sqltypes.h b/unixODBC/inc/sqltypes.h index 67604b8..130de90 100644 --- a/unixODBC/inc/sqltypes.h +++ b/unixODBC/inc/sqltypes.h @@ -26,47 +26,110 @@ #define ODBCVER 0x0351 #endif +/* + * if thi sis set, then use a 4 byte unicode definition, insteead of the 2 bye that MS use + */ + +#ifdef SQL_WCHART_CONVERT +/* + * Use this if you want to use the C/C++ portable definition of a wide char, wchar_t + * Microsoft hardcoded a definition of unsigned short which may not be compatible with + * your platform specific wide char definition. + */ +#include <wchar.h> +#endif + +#include <sal/types.h> + #ifdef __cplusplus extern "C" { #endif -#ifndef SIZEOF_LONG -# if defined(__alpha__) || defined(__x86_64__) || defined(__ia64__) || defined(__s390x__) || defined(__sparcv9) || defined(__LP64__) -# define SIZEOF_LONG 8 -#else -# define SIZEOF_LONG 4 +#ifndef SIZEOF_LONG_INT +# define SIZEOF_LONG_INT SAL_TYPES_SIZEOFLONG +#endif +#ifndef ODBCINT64 +# define ODBCINT64 sal_Int64 #endif +#ifndef UODBCINT64 +# define UODBCINT64 sal_uInt64 +#endif + +/* + * this is defined by configure, but will not be on a normal application build + * the install creates a unixodbc_conf.h file that contains the current build settings + */ + +#ifndef SIZEOF_LONG_INT +#include <unixodbc_conf.h> +#endif + +#ifndef SIZEOF_LONG_INT +#error "Needs to know how big a long int is to continue!!!" #endif /**************************** * These make up for having no windows.h ***************************/ +#ifndef ALLREADY_HAVE_WINDOWS_TYPE + #define FAR #define CALLBACK +#ifdef __OS2__ +#define SQL_API _System +#else #define SQL_API +#endif #define BOOL int typedef void* HWND; -#ifndef CHAR -typedef char* GUID; -#endif -#define GUID_DEFINED typedef char CHAR; +#ifdef UNICODE + +/* + * NOTE: The Microsoft unicode define is only for apps that want to use TCHARs and + * be able to compile for both unicode and non-unicode with the same source. + * This is not recommanded for linux applications and is not supported + * by the standard linux string header files. + */ +#ifdef SQL_WCHART_CONVERT +typedef wchar_t TCHAR; +#else +typedef signed short TCHAR; +#endif + +#else +typedef char TCHAR; +#endif + #ifndef DONT_TD_VOID typedef void VOID; #endif + typedef unsigned short WORD; -#if SIZEOF_LONG == 4 - typedef unsigned long DWORD; +#if (SIZEOF_LONG_INT == 4) +typedef unsigned long DWORD; #else - typedef unsigned int DWORD; +typedef unsigned int DWORD; #endif typedef unsigned char BYTE; + +#ifdef SQL_WCHART_CONVERT +typedef wchar_t WCHAR; +#else typedef unsigned short WCHAR; -typedef WCHAR* LPWSTR; +#endif + +typedef WCHAR* LPWSTR; typedef const char* LPCSTR; +typedef const WCHAR* LPCWSTR; +typedef TCHAR* LPTSTR; typedef char* LPSTR; typedef DWORD* LPDWORD; +typedef void* HINSTANCE; + +#endif + /**************************** * standard SQL* data types. use these as much as possible when using ODBC calls/vars @@ -80,10 +143,60 @@ typedef double SQLDOUBLE; typedef double SQLFLOAT; #endif -#if SIZEOF_LONG == 4 - typedef long SQLINTEGER; +/* + * can't use a long it fails on 64 platforms + */ + +/* + * Hopefully by now it should be safe to assume most drivers know about SQLLEN now + * and the defaukt is now sizeof( SQLLEN ) = 8 on 64 bit platforms + * + */ + +#if (SIZEOF_LONG_INT == 8) +#ifdef BUILD_LEGACY_64_BIT_MODE +typedef int SQLINTEGER; +typedef unsigned int SQLUINTEGER; +#define SQLLEN SQLINTEGER +#define SQLULEN SQLUINTEGER +#define SQLSETPOSIROW SQLUSMALLINT +/* + * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril + * + typedef SQLULEN SQLROWCOUNT; + typedef SQLULEN SQLROWSETSIZE; + typedef SQLULEN SQLTRANSID; + typedef SQLLEN SQLROWOFFSET; +*/ +#else +typedef int SQLINTEGER; +typedef unsigned int SQLUINTEGER; +typedef long SQLLEN; +typedef unsigned long SQLULEN; +typedef unsigned long SQLSETPOSIROW; +/* + * These are not supprted on 64bit ODBC according to MS, removed, so use at your peril + * + typedef SQLULEN SQLTRANSID; + typedef SQLULEN SQLROWCOUNT; + typedef SQLUINTEGER SQLROWSETSIZE; + typedef SQLLEN SQLROWOFFSET; + */ +typedef SQLULEN SQLROWCOUNT; +typedef SQLULEN SQLROWSETSIZE; +typedef SQLULEN SQLTRANSID; +typedef SQLLEN SQLROWOFFSET; +#endif #else - typedef int SQLINTEGER; +typedef long SQLINTEGER; +typedef unsigned long SQLUINTEGER; +#define SQLLEN SQLINTEGER +#define SQLULEN SQLUINTEGER +#define SQLSETPOSIROW SQLUSMALLINT +typedef SQLULEN SQLROWCOUNT; +typedef SQLULEN SQLROWSETSIZE; +typedef SQLULEN SQLTRANSID; +typedef SQLLEN SQLROWOFFSET; #endif #if (ODBCVER >= 0x0300) @@ -107,39 +220,58 @@ typedef unsigned char SQLVARCHAR; typedef SQLSMALLINT SQLRETURN; -/* typedef void * SQLHANDLE; */ - -typedef SQLINTEGER SQLHANDLE; #if (ODBCVER >= 0x0300) - +typedef void * SQLHANDLE; typedef SQLHANDLE SQLHENV; typedef SQLHANDLE SQLHDBC; typedef SQLHANDLE SQLHSTMT; typedef SQLHANDLE SQLHDESC; +#else +typedef void * SQLHENV; +typedef void * SQLHDBC; +typedef void * SQLHSTMT; +/* + * some things like PHP won't build without this + */ +typedef void * SQLHANDLE; +#endif + +/**************************** + * These are cast into the actual struct that is being passed around. The + * DriverManager knows what its structs look like and the Driver knows about its + * structs... the app knows nothing about them... just void* + * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT + ***************************/ +#if (ODBCVER >= 0x0300) +typedef SQLHANDLE HENV; +typedef SQLHANDLE HDBC; +typedef SQLHANDLE HSTMT; #else -typedef SQLINTEGER SQLHENV; -typedef SQLINTEGER SQLHDBC; -typedef SQLINTEGER SQLHSTMT; +typedef void * HENV; +typedef void * HDBC; +typedef void * HSTMT; #endif /**************************** * more basic data types to augment what windows.h provides ***************************/ +#ifndef ALLREADY_HAVE_WINDOWS_TYPE + typedef unsigned char UCHAR; typedef signed char SCHAR; typedef SCHAR SQLSCHAR; -#if SIZEOF_LONG == 4 - typedef long int SDWORD; - typedef unsigned long int UDWORD; +#if (SIZEOF_LONG_INT == 4) +typedef long int SDWORD; +typedef unsigned long int UDWORD; #else - typedef signed int SDWORD; - typedef unsigned int UDWORD; +typedef int SDWORD; +typedef unsigned int UDWORD; #endif typedef signed short int SWORD; typedef unsigned short int UWORD; -typedef UDWORD SQLUINTEGER; +typedef unsigned int UINT; typedef signed long SLONG; typedef signed short SSHORT; typedef unsigned long ULONG; @@ -151,20 +283,7 @@ typedef void* PTR; typedef signed short RETCODE; typedef void* SQLHWND; -/**************************** - * These are cast into the actual struct that is being passed around. The - * DriverManager knows what its structs look like and the Driver knows about its - * structs... the app knows nothing about them... just void* - * These are deprecated in favour of SQLHENV, SQLHDBC, SQLHSTMT - ***************************/ -/* -typedef void* HENV; -typedef void* HDBC; -typedef void* HSTMT; -*/ -typedef SQLHANDLE HENV; -typedef SQLHANDLE HDBC; -typedef SQLHANDLE HSTMT; +#endif /**************************** * standard structs for working with date/times @@ -263,12 +382,41 @@ typedef struct tagSQL_INTERVAL_STRUCT /**************************** * ***************************/ -#if (ODBCVER >= 0x0300) -#define ODBCINT64 long +#ifndef ODBCINT64 +# if (ODBCVER >= 0x0300) +# if (SIZEOF_LONG_INT == 8) +# define ODBCINT64 long +# define UODBCINT64 unsigned long +# else +# ifdef HAVE_LONG_LONG +# define ODBCINT64 long long +# define UODBCINT64 unsigned long long +# else +/* + * may fail in some cases, but what else can we do ? + */ +struct __bigint_struct +{ + int hiword; + unsigned int loword; +}; +struct __bigint_struct_u +{ + unsigned int hiword; + unsigned int loword; +}; +# define ODBCINT64 struct __bigint_struct +# define UODBCINT64 struct __bigint_struct_u +# endif +# endif +#endif +#endif + #ifdef ODBCINT64 typedef ODBCINT64 SQLBIGINT; -typedef unsigned ODBCINT64 SQLUBIGINT; #endif +#ifdef UODBCINT64 +typedef UODBCINT64 SQLUBIGINT; #endif @@ -288,6 +436,7 @@ typedef struct tagSQL_NUMERIC_STRUCT #if (ODBCVER >= 0x0350) #ifdef GUID_DEFINED +#ifndef ALLREADY_HAVE_WINDOWS_TYPE typedef GUID SQLGUID; #else typedef struct tagSQLGUID @@ -298,17 +447,20 @@ typedef struct tagSQLGUID BYTE Data4[ 8 ]; } SQLGUID; #endif +#else +typedef struct tagSQLGUID +{ + DWORD Data1; + WORD Data2; + WORD Data3; + BYTE Data4[ 8 ]; +} SQLGUID; +#endif #endif +typedef SQLULEN BOOKMARK; -typedef unsigned long int BOOKMARK; - - -#ifdef _WCHAR_T_DEFINED -typedef wchar_t SQLWCHAR; -#else -typedef unsigned short SQLWCHAR; -#endif +typedef WCHAR SQLWCHAR; #ifdef UNICODE typedef SQLWCHAR SQLTCHAR; @@ -321,3 +473,6 @@ typedef SQLCHAR SQLTCHAR; #endif #endif + + + diff --git a/unixODBC/inc/sqlucode.h b/unixODBC/inc/sqlucode.h new file mode 100644 index 0000000..14ea0b4 --- /dev/null +++ b/unixODBC/inc/sqlucode.h @@ -0,0 +1,789 @@ +/************************************************** + * sqlucode.h + * + * These should be consistent with the MS version. + * + **************************************************/ +#ifndef __SQLUCODE_H +#define __SQLUCODE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define SQL_WCHAR (-8) +#define SQL_WVARCHAR (-9) +#define SQL_WLONGVARCHAR (-10) +#define SQL_C_WCHAR SQL_WCHAR + +#ifdef UNICODE +#define SQL_C_TCHAR SQL_C_WCHAR +#else +#define SQL_C_TCHAR SQL_C_CHAR +#endif + +#define SQL_SQLSTATE_SIZEW 10 /* size of SQLSTATE for unicode */ + +/* UNICODE versions */ + +SQLRETURN SQL_API SQLColAttributeW( + SQLHSTMT hstmt, + SQLUSMALLINT iCol, + SQLUSMALLINT iField, + SQLPOINTER pCharAttr, + SQLSMALLINT cbCharAttrMax, + SQLSMALLINT *pcbCharAttr, + SQLLEN *pNumAttr); + +SQLRETURN SQL_API SQLColAttributesW( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, + SQLSMALLINT cbDescMax, + SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc); + +SQLRETURN SQL_API SQLConnectW( + SQLHDBC hdbc, + SQLWCHAR *szDSN, + SQLSMALLINT cbDSN, + SQLWCHAR *szUID, + SQLSMALLINT cbUID, + SQLWCHAR *szAuthStr, + SQLSMALLINT cbAuthStr); + + +SQLRETURN SQL_API SQLDescribeColW( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLWCHAR *szColName, + SQLSMALLINT cbColNameMax, + SQLSMALLINT *pcbColName, + SQLSMALLINT *pfSqlType, + SQLULEN *pcbColDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + + +SQLRETURN SQL_API SQLErrorW( + SQLHENV henv, + SQLHDBC hdbc, + SQLHSTMT hstmt, + SQLWCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLWCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + +SQLRETURN SQL_API SQLExecDirectW( + SQLHSTMT hstmt, + SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLGetConnectAttrW( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetCursorNameW( + SQLHSTMT hstmt, + SQLWCHAR *szCursor, + SQLSMALLINT cbCursorMax, + SQLSMALLINT *pcbCursor); + +#if (ODBCVER >= 0x0300) +SQLRETURN SQL_API SQLSetDescFieldW(SQLHDESC DescriptorHandle, + SQLSMALLINT RecNumber, + SQLSMALLINT FieldIdentifier, + SQLPOINTER Value, + SQLINTEGER BufferLength); + + + +SQLRETURN SQL_API SQLGetDescFieldW( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLSMALLINT iField, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetDescRecW( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLWCHAR *szName, + SQLSMALLINT cbNameMax, + SQLSMALLINT *pcbName, + SQLSMALLINT *pfType, + SQLSMALLINT *pfSubType, + SQLLEN *pLength, + SQLSMALLINT *pPrecision, + SQLSMALLINT *pScale, + SQLSMALLINT *pNullable); + +SQLRETURN SQL_API SQLGetDiagFieldW( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLSMALLINT fDiagField, + SQLPOINTER rgbDiagInfo, + SQLSMALLINT cbDiagInfoMax, + SQLSMALLINT *pcbDiagInfo); + +SQLRETURN SQL_API SQLGetDiagRecW( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLWCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLWCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + + +#endif + + +SQLRETURN SQL_API SQLPrepareW( + SQLHSTMT hstmt, + SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLSetConnectAttrW( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValue); + +SQLRETURN SQL_API SQLSetCursorNameW( + SQLHSTMT hstmt, + SQLWCHAR *szCursor, + SQLSMALLINT cbCursor); + + + + + + + +SQLRETURN SQL_API SQLColumnsW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLWCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLGetConnectOptionW( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLPOINTER pvParam); + + + +SQLRETURN SQL_API SQLGetInfoW( + SQLHDBC hdbc, + SQLUSMALLINT fInfoType, + SQLPOINTER rgbInfoValue, + SQLSMALLINT cbInfoValueMax, + SQLSMALLINT *pcbInfoValue); + +SQLRETURN SQL_API SQLGetTypeInfoW( + SQLHSTMT StatementHandle, + SQLSMALLINT DataType); + + +SQLRETURN SQL_API SQLSetConnectOptionW( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLULEN vParam); + + +SQLRETURN SQL_API SQLSpecialColumnsW( + SQLHSTMT hstmt, + SQLUSMALLINT fColType, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fScope, + SQLUSMALLINT fNullable); + +SQLRETURN SQL_API SQLStatisticsW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fUnique, + SQLUSMALLINT fAccuracy); + +SQLRETURN SQL_API SQLTablesW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLWCHAR *szTableType, + SQLSMALLINT cbTableType); + + + +SQLRETURN SQL_API SQLDataSourcesW( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLWCHAR *szDSN, + SQLSMALLINT cbDSNMax, + SQLSMALLINT *pcbDSN, + SQLWCHAR *szDescription, + SQLSMALLINT cbDescriptionMax, + SQLSMALLINT *pcbDescription); + + + + +SQLRETURN SQL_API SQLDriverConnectW( + SQLHDBC hdbc, + SQLHWND hwnd, + SQLWCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLWCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut, + SQLUSMALLINT fDriverCompletion); + + +SQLRETURN SQL_API SQLBrowseConnectW( + SQLHDBC hdbc, + SQLWCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLWCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut); + +SQLRETURN SQL_API SQLColumnPrivilegesW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLWCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLGetStmtAttrW( + SQLHSTMT hstmt, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLSetStmtAttrW( + SQLHSTMT hstmt, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax); + +SQLRETURN SQL_API SQLForeignKeysW( + SQLHSTMT hstmt, + SQLWCHAR *szPkCatalogName, + SQLSMALLINT cbPkCatalogName, + SQLWCHAR *szPkSchemaName, + SQLSMALLINT cbPkSchemaName, + SQLWCHAR *szPkTableName, + SQLSMALLINT cbPkTableName, + SQLWCHAR *szFkCatalogName, + SQLSMALLINT cbFkCatalogName, + SQLWCHAR *szFkSchemaName, + SQLSMALLINT cbFkSchemaName, + SQLWCHAR *szFkTableName, + SQLSMALLINT cbFkTableName); + + +SQLRETURN SQL_API SQLNativeSqlW( + SQLHDBC hdbc, + SQLWCHAR *szSqlStrIn, + SQLINTEGER cbSqlStrIn, + SQLWCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, + SQLINTEGER *pcbSqlStr); + + +SQLRETURN SQL_API SQLPrimaryKeysW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLProcedureColumnsW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szProcName, + SQLSMALLINT cbProcName, + SQLWCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLProceduresW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szProcName, + SQLSMALLINT cbProcName); + + +SQLRETURN SQL_API SQLTablePrivilegesW( + SQLHSTMT hstmt, + SQLWCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLWCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLWCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLDriversW( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLWCHAR *szDriverDesc, + SQLSMALLINT cbDriverDescMax, + SQLSMALLINT *pcbDriverDesc, + SQLWCHAR *szDriverAttributes, + SQLSMALLINT cbDrvrAttrMax, + SQLSMALLINT *pcbDrvrAttr); + + +/* ANSI versions */ + +SQLRETURN SQL_API SQLColAttributeA( + SQLHSTMT hstmt, + SQLSMALLINT iCol, + SQLSMALLINT iField, + SQLPOINTER pCharAttr, + SQLSMALLINT cbCharAttrMax, + SQLSMALLINT *pcbCharAttr, + SQLLEN *pNumAttr); + +SQLRETURN SQL_API SQLColAttributesA( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLUSMALLINT fDescType, + SQLPOINTER rgbDesc, + SQLSMALLINT cbDescMax, + SQLSMALLINT *pcbDesc, + SQLLEN *pfDesc); + +SQLRETURN SQL_API SQLConnectA( + SQLHDBC hdbc, + SQLCHAR *szDSN, + SQLSMALLINT cbDSN, + SQLCHAR *szUID, + SQLSMALLINT cbUID, + SQLCHAR *szAuthStr, + SQLSMALLINT cbAuthStr); + + +SQLRETURN SQL_API SQLDescribeColA( + SQLHSTMT hstmt, + SQLUSMALLINT icol, + SQLCHAR *szColName, + SQLSMALLINT cbColNameMax, + SQLSMALLINT *pcbColName, + SQLSMALLINT *pfSqlType, + SQLULEN *pcbColDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + + +SQLRETURN SQL_API SQLErrorA( + SQLHENV henv, + SQLHDBC hdbc, + SQLHSTMT hstmt, + SQLCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + +SQLRETURN SQL_API SQLExecDirectA( + SQLHSTMT hstmt, + SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLGetConnectAttrA( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetCursorNameA( + SQLHSTMT hstmt, + SQLCHAR *szCursor, + SQLSMALLINT cbCursorMax, + SQLSMALLINT *pcbCursor); + +#if (ODBCVER >= 0x0300) +SQLRETURN SQL_API SQLGetDescFieldA( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLSMALLINT iField, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +SQLRETURN SQL_API SQLGetDescRecA( + SQLHDESC hdesc, + SQLSMALLINT iRecord, + SQLCHAR *szName, + SQLSMALLINT cbNameMax, + SQLSMALLINT *pcbName, + SQLSMALLINT *pfType, + SQLSMALLINT *pfSubType, + SQLLEN *pLength, + SQLSMALLINT *pPrecision, + SQLSMALLINT *pScale, + SQLSMALLINT *pNullable); + +SQLRETURN SQL_API SQLGetDiagFieldA( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLSMALLINT fDiagField, + SQLPOINTER rgbDiagInfo, + SQLSMALLINT cbDiagInfoMax, + SQLSMALLINT *pcbDiagInfo); + +SQLRETURN SQL_API SQLGetDiagRecA( + SQLSMALLINT fHandleType, + SQLHANDLE handle, + SQLSMALLINT iRecord, + SQLCHAR *szSqlState, + SQLINTEGER *pfNativeError, + SQLCHAR *szErrorMsg, + SQLSMALLINT cbErrorMsgMax, + SQLSMALLINT *pcbErrorMsg); + + +SQLRETURN SQL_API SQLGetStmtAttrA( + SQLHSTMT hstmt, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValueMax, + SQLINTEGER *pcbValue); + +#endif + +SQLRETURN SQL_API SQLGetTypeInfoA( + SQLHSTMT StatementHandle, + SQLSMALLINT DataTyoe); + +SQLRETURN SQL_API SQLPrepareA( + SQLHSTMT hstmt, + SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStr); + +SQLRETURN SQL_API SQLSetConnectAttrA( + SQLHDBC hdbc, + SQLINTEGER fAttribute, + SQLPOINTER rgbValue, + SQLINTEGER cbValue); + +SQLRETURN SQL_API SQLSetCursorNameA( + SQLHSTMT hstmt, + SQLCHAR *szCursor, + SQLSMALLINT cbCursor); + + + + + + + +SQLRETURN SQL_API SQLColumnsA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLGetConnectOptionA( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLPOINTER pvParam); + + + +SQLRETURN SQL_API SQLGetInfoA( + SQLHDBC hdbc, + SQLUSMALLINT fInfoType, + SQLPOINTER rgbInfoValue, + SQLSMALLINT cbInfoValueMax, + SQLSMALLINT* pcbInfoValue); + +SQLRETURN SQL_API SQLGetStmtOptionA( + SQLHSTMT hstmt, + SQLUSMALLINT fOption, + SQLPOINTER pvParam); + +SQLRETURN SQL_API SQLSetConnectOptionA( + SQLHDBC hdbc, + SQLUSMALLINT fOption, + SQLULEN vParam); + +SQLRETURN SQL_API SQLSetStmtOptionA( + SQLHSTMT hstmt, + SQLUSMALLINT fOption, + SQLULEN vParam); + +SQLRETURN SQL_API SQLSpecialColumnsA( + SQLHSTMT hstmt, + SQLUSMALLINT fColType, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fScope, + SQLUSMALLINT fNullable); + +SQLRETURN SQL_API SQLStatisticsA( + SQLHSTMT hstmt, + + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLUSMALLINT fUnique, + SQLUSMALLINT fAccuracy); + +SQLRETURN SQL_API SQLTablesA( + SQLHSTMT hstmt, + + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLCHAR *szTableType, + + SQLSMALLINT cbTableType); + + + +SQLRETURN SQL_API SQLDataSourcesA( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLCHAR *szDSN, + SQLSMALLINT cbDSNMax, + SQLSMALLINT *pcbDSN, + SQLCHAR *szDescription, + SQLSMALLINT cbDescriptionMax, + SQLSMALLINT *pcbDescription); + + + + +SQLRETURN SQL_API SQLDriverConnectA( + SQLHDBC hdbc, + SQLHWND hwnd, + SQLCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut, + SQLUSMALLINT fDriverCompletion); + + +SQLRETURN SQL_API SQLBrowseConnectA( + SQLHDBC hdbc, + SQLCHAR *szConnStrIn, + SQLSMALLINT cbConnStrIn, + SQLCHAR *szConnStrOut, + SQLSMALLINT cbConnStrOutMax, + SQLSMALLINT *pcbConnStrOut); + +SQLRETURN SQL_API SQLColumnPrivilegesA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName, + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLDescribeParamA( + SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT *pfSqlType, + SQLUINTEGER *pcbParamDef, + SQLSMALLINT *pibScale, + SQLSMALLINT *pfNullable); + + +SQLRETURN SQL_API SQLForeignKeysA( + SQLHSTMT hstmt, + SQLCHAR *szPkCatalogName, + SQLSMALLINT cbPkCatalogName, + SQLCHAR *szPkSchemaName, + SQLSMALLINT cbPkSchemaName, + SQLCHAR *szPkTableName, + SQLSMALLINT cbPkTableName, + SQLCHAR *szFkCatalogName, + SQLSMALLINT cbFkCatalogName, + SQLCHAR *szFkSchemaName, + SQLSMALLINT cbFkSchemaName, + SQLCHAR *szFkTableName, + SQLSMALLINT cbFkTableName); + + +SQLRETURN SQL_API SQLNativeSqlA( + SQLHDBC hdbc, + SQLCHAR *szSqlStrIn, + SQLINTEGER cbSqlStrIn, + SQLCHAR *szSqlStr, + SQLINTEGER cbSqlStrMax, + SQLINTEGER *pcbSqlStr); + + +SQLRETURN SQL_API SQLPrimaryKeysA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLProcedureColumnsA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szProcName, + SQLSMALLINT cbProcName, + SQLCHAR *szColumnName, + SQLSMALLINT cbColumnName); + +SQLRETURN SQL_API SQLProceduresA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szProcName, + SQLSMALLINT cbProcName); + + +SQLRETURN SQL_API SQLTablePrivilegesA( + SQLHSTMT hstmt, + SQLCHAR *szCatalogName, + SQLSMALLINT cbCatalogName, + SQLCHAR *szSchemaName, + SQLSMALLINT cbSchemaName, + SQLCHAR *szTableName, + SQLSMALLINT cbTableName); + +SQLRETURN SQL_API SQLDriversA( + SQLHENV henv, + SQLUSMALLINT fDirection, + SQLCHAR *szDriverDesc, + SQLSMALLINT cbDriverDescMax, + SQLSMALLINT *pcbDriverDesc, + SQLCHAR *szDriverAttributes, + SQLSMALLINT cbDrvrAttrMax, + SQLSMALLINT *pcbDrvrAttr); + + + + + +/*---------------------------------------------*/ +/* Mapping macros for Unicode */ +/*---------------------------------------------*/ + +#ifndef SQL_NOUNICODEMAP /* define this to disable the mapping */ +#ifdef UNICODE + +#define SQLColAttribute SQLColAttributeW +#define SQLColAttributes SQLColAttributesW +#define SQLConnect SQLConnectW +#define SQLDescribeCol SQLDescribeColW +#define SQLError SQLErrorW +#define SQLExecDirect SQLExecDirectW +#define SQLGetConnectAttr SQLGetConnectAttrW +#define SQLGetCursorName SQLGetCursorNameW +#define SQLGetDescField SQLGetDescFieldW +#define SQLGetDescRec SQLGetDescRecW +#define SQLGetDiagField SQLGetDiagFieldW +#define SQLGetDiagRec SQLGetDiagRecW +#define SQLPrepare SQLPrepareW +#define SQLSetConnectAttr SQLSetConnectAttrW +#define SQLSetCursorName SQLSetCursorNameW +#define SQLSetDescField SQLSetDescFieldW +#define SQLSetStmtAttr SQLSetStmtAttrW +#define SQLGetStmtAttr SQLGetStmtAttrW +#define SQLColumns SQLColumnsW +#define SQLGetConnectOption SQLGetConnectOptionW +#define SQLGetInfo SQLGetInfoW +#define SQLGetTypeInfo SQLGetTypeInfoW +#define SQLSetConnectOption SQLSetConnectOptionW +#define SQLSpecialColumns SQLSpecialColumnsW +#define SQLStatistics SQLStatisticsW +#define SQLTables SQLTablesW +#define SQLDataSources SQLDataSourcesW +#define SQLDriverConnect SQLDriverConnectW +#define SQLBrowseConnect SQLBrowseConnectW +#define SQLColumnPrivileges SQLColumnPrivilegesW +#define SQLForeignKeys SQLForeignKeysW +#define SQLNativeSql SQLNativeSqlW +#define SQLPrimaryKeys SQLPrimaryKeysW +#define SQLProcedureColumns SQLProcedureColumnsW +#define SQLProcedures SQLProceduresW +#define SQLTablePrivileges SQLTablePrivilegesW +#define SQLDrivers SQLDriversW + +#endif /* UNICODE */ +#endif /* SQL_NOUNICODEMAP */ + +#ifdef __cplusplus +} +#endif + +#ifndef __SQLEXT_H +#include <odbx/sqlext.h> + +#endif + + +#endif diff --git a/unixODBC/prj/d.lst b/unixODBC/prj/d.lst index 23f12b2..2825e1c 100644 --- a/unixODBC/prj/d.lst +++ b/unixODBC/prj/d.lst @@ -1,5 +1,3 @@ mkdir: %_DEST%\inc%_EXT%\external mkdir: %_DEST%\inc%_EXT%\external\odbc -..\inc\sql.h %_DEST%\inc%_EXT%\external\odbc\sql.h -..\inc\sqlext.h %_DEST%\inc%_EXT%\external\odbc\sqlext.h -..\inc\sqltypes.h %_DEST%\inc%_EXT%\external\odbc\sqltypes.h +..\inc\*.h %_DEST%\inc%_EXT%\external\odbc\*.h diff --git a/vigra/download/vigra1.4.0.tar.gz b/vigra/download/vigra1.4.0.tar.gz Binary files differdeleted file mode 100644 index f961025..0000000 --- a/vigra/download/vigra1.4.0.tar.gz +++ /dev/null diff --git a/vigra/makefile.mk b/vigra/makefile.mk index 97f6b0e..db08373 100644 --- a/vigra/makefile.mk +++ b/vigra/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -51,6 +47,7 @@ all: # --- Files -------------------------------------------------------- TARFILE_NAME=vigra1.4.0 +TARFILE_MD5=ea91f2fb4212a21d708aced277e6e85a PATCH_FILES=$(TARFILE_NAME).patch CONFIGURE_DIR= diff --git a/xsltml/download/xsltml_2.1.2.zip b/xsltml/download/xsltml_2.1.2.zip Binary files differdeleted file mode 100755 index e622cf1..0000000 --- a/xsltml/download/xsltml_2.1.2.zip +++ /dev/null diff --git a/xsltml/makefile.mk b/xsltml/makefile.mk index 7192cd5..7c1a37c 100755 --- a/xsltml/makefile.mk +++ b/xsltml/makefile.mk @@ -2,14 +2,10 @@ # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # -# Copyright 2008 by Sun Microsystems, Inc. +# Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.6 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify @@ -43,6 +39,7 @@ TARGET=xsltml # --- Files -------------------------------------------------------- TARFILE_NAME=xsltml_2.1.2 +TARFILE_MD5=a7983f859eafb2677d7ff386a023bc40 PATCH_FILES=$(TARFILE_NAME).patch TARFILE_IS_FLAT:=TRUE |