blautenb 2004/02/18 02:46:52
Modified: c/Projects/VC6.0/xsec/xtest xtest.dsp
c/src/enc/OpenSSL OpenSSLCryptoSymmetricKey.cpp
c/src/enc/WinCAPI WinCAPICryptoProvider.cpp
WinCAPICryptoProvider.hpp
c/src/framework XSECW32Config.hpp
Log:
Updates for OpenSSL 0.9.6 under Windows
Revision Changes Path
1.6 +1 -1 xml-security/c/Projects/VC6.0/xsec/xtest/xtest.dsp
Index: xtest.dsp
===================================================================
RCS file: /home/cvs/xml-security/c/Projects/VC6.0/xsec/xtest/xtest.dsp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- xtest.dsp 25 Jun 2003 12:16:06 -0000 1.5
+++ xtest.dsp 18 Feb 2004 10:46:52 -0000 1.6
@@ -44,7 +44,7 @@
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D
"_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../../../include" /D "WIN32" /D
"NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../../include" /D "WIN32" /D
"NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
# ADD RSC /l 0xc09 /d "NDEBUG"
1.12 +3 -3
xml-security/c/src/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp
Index: OpenSSLCryptoSymmetricKey.cpp
===================================================================
RCS file:
/home/cvs/xml-security/c/src/enc/OpenSSL/OpenSSLCryptoSymmetricKey.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- OpenSSLCryptoSymmetricKey.cpp 16 Feb 2004 11:30:02 -0000 1.11
+++ OpenSSLCryptoSymmetricKey.cpp 18 Feb 2004 10:46:52 -0000 1.12
@@ -395,7 +395,7 @@
so we need to work around it */
unsigned char *scrPlainBuf;
unsigned char *cipherBuf;
- scrPlainBuf = new unsigned char[2 * m_blockSize];
+ scrPlainBuf = new unsigned char[3 * m_blockSize];
ArrayJanitor<unsigned char> j_scrPlainBuf(scrPlainBuf);
cipherBuf = new unsigned char[m_blockSize];
ArrayJanitor<unsigned char> j_cipherBuf(cipherBuf);
@@ -406,7 +406,7 @@
unsigned int offset = 0;
/* Get any previous bytes from the m_lastBlock */
- if (m_bytesInLastBlock > 0 & m_bytesInLastBlock <= m_blockSize) {
+ if (m_bytesInLastBlock > 0 && m_bytesInLastBlock <= m_blockSize) {
memcpy(scrPlainBuf, m_lastBlock, m_bytesInLastBlock);
offset = m_bytesInLastBlock;
}
1.12 +25 -1 xml-security/c/src/enc/WinCAPI/WinCAPICryptoProvider.cpp
Index: WinCAPICryptoProvider.cpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/enc/WinCAPI/WinCAPICryptoProvider.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- WinCAPICryptoProvider.cpp 8 Feb 2004 10:23:33 -0000 1.11
+++ WinCAPICryptoProvider.cpp 18 Feb 2004 10:46:52 -0000 1.12
@@ -243,6 +243,30 @@
}
+bool
WinCAPICryptoProvider::algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType
alg) {
+
+ switch (alg) {
+
+ case (XSECCryptoSymmetricKey::KEY_AES_128) :
+ case (XSECCryptoSymmetricKey::KEY_AES_192) :
+ case (XSECCryptoSymmetricKey::KEY_AES_256) :
+
+ return m_haveAES;
+
+ case (XSECCryptoSymmetricKey::KEY_3DES_192) :
+
+ return true;
+
+ default:
+
+ return false;
+
+ }
+
+ return false;
+
+}
+
XSECCryptoSymmetricKey *
WinCAPICryptoProvider::keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType
alg) {
// Only temporary
1.12 +10 -1 xml-security/c/src/enc/WinCAPI/WinCAPICryptoProvider.hpp
Index: WinCAPICryptoProvider.hpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/enc/WinCAPI/WinCAPICryptoProvider.hpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- WinCAPICryptoProvider.hpp 8 Feb 2004 10:23:33 -0000 1.11
+++ WinCAPICryptoProvider.hpp 18 Feb 2004 10:46:52 -0000 1.12
@@ -272,6 +272,15 @@
static unsigned char * WinBN2b64(BYTE * n, DWORD nLen, unsigned int
&retLen);
/**
+ * \brief Determine whether a given algorithm is supported
+ *
+ * A call that can be used to determine whether a given
+ * symmetric algorithm is supported
+ */
+
+ virtual bool
algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg);
+
+ /**
* \brief Return a Symmetric Key implementation object.
*
* Call used by the library to obtain a bulk encryption
1.16 +20 -1 xml-security/c/src/framework/XSECW32Config.hpp
Index: XSECW32Config.hpp
===================================================================
RCS file: /home/cvs/xml-security/c/src/framework/XSECW32Config.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- XSECW32Config.hpp 8 Feb 2004 10:24:24 -0000 1.15
+++ XSECW32Config.hpp 18 Feb 2004 10:46:52 -0000 1.16
@@ -78,6 +78,24 @@
#define HAVE_WINCAPI 1
+
+/*
+ * Some settings for OpenSSL if we have it
+ *
+ */
+
+#if defined (HAVE_OPENSSL)
+
+# include <openssl/opensslv.h>
+# if (OPENSSL_VERSION_NUMBER >= 0x00907000)
+
+# define XSEC_OPENSSL_CONST_BUFFERS
+# define XSEC_OPENSSL_HAVE_AES
+# define XSEC_OPENSSL_CANSET_PADDING
+# endif
+
+#endif
+
/*
* Macros used to determine what header files exist on this
* system
@@ -88,4 +106,5 @@
/* Windows direct.h */
#define HAVE_DIRECT_H 1
+