Author: mcalmer
Date: Sun Jul 4 10:28:49 2010
New Revision: 2676
URL: http://svn.opensuse.org/viewcvs/limal?rev=2676&view=rev
Log:
fix testcases after string changes
Modified:
limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp
limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp
limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp
limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp
limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp
limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp
limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp
limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp
limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/cam.txt
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/.rand
limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem
limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ListTest.out
Modified: limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/BasicConstraintsExtension.cpp Sun Jul 4 10:28:49 2010
@@ -97,7 +97,7 @@
{
if(0 == str::compareCI(*it, "ca:true")) isCA = true;
else if(0 == str::compareCI(*it, "ca:false")) isCA = false;
- else if(0 == str::startsWithCI(*it, "pathlen:"))
+ else if(str::startsWithCI(*it, "pathlen:"))
{
std::vectorstd::string plA = PerlRegEx(":").split(*it);
pl = str::strtonum(plA[1]);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/BitExtensions.cpp Sun Jul 4 10:28:49 2010
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
#include "Utils.hpp"
@@ -129,7 +128,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- str::form(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %d."), type).c_str());
}
bool p = caConfig->exists(type2Section(type, true), "keyUsage");
@@ -242,7 +241,7 @@
{
LOGIT_ERROR("wrong type" << type);
BLOCXX_THROW(ca_mgm::ValueException,
- str::form(__("Wrong type: %1."), type).c_str());
+ str::form(__("Wrong type: %d."), type).c_str());
}
if(isPresent())
@@ -332,7 +331,7 @@
appendArray(result, ExtensionBase::dump());
if(!isPresent()) return result;
- result.push_back("KeyUsage = " + str::hexstring(getValue(), 4));
+ result.push_back("KeyUsage = " + str::hexstring(getValue(), 6));
return result;
}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLData.cpp Sun Jul 4 10:28:49 2010
@@ -327,7 +327,7 @@
std::string s;
for(uint i = 0; i < m_impl->signature.size(); ++i)
{
- s += str::form( "%02x", static_cast<UInt8>(m_impl->signature[i]));
+ s += str::form( "%02x", static_cast<UInt8>(m_impl->signature[i])) + ":";
}
result.push_back("Signature = " + s);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLDataImpl.hpp Sun Jul 4 10:28:49 2010
@@ -35,7 +35,7 @@
{
public:
RevocationEntryImpl()
- : serial(0)
+ : serial("0")
, revocationDate(0)
, revocationReason(CRLReason())
{}
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CRLReason.cpp Sun Jul 4 10:28:49 2010
@@ -23,8 +23,8 @@
#include
#include
#include
-#include
#include
+#include
#include
#include "Utils.hpp"
Modified: limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/CertificateData.cpp Sun Jul 4 10:28:49 2010
@@ -310,7 +310,7 @@
std::string s;
for(uint i = 0; i < m_impl->signature.size(); ++i)
{
- s += str::form( "%02x", (UInt8)m_impl->signature[i] );
+ s += str::form( "%02x", (UInt8)m_impl->signature[i] ) + ":";
}
result.push_back("Signature = " + s);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/DNObject.cpp Sun Jul 4 10:28:49 2010
@@ -24,7 +24,6 @@
#include
#include
#include
-#include
#include <map>
#include
@@ -109,8 +108,11 @@
str::form(__("Invalid type %s."), m_impl->type.c_str()).c_str());
}
- PerlRegEx regex("([\\\\/])");
- std::string v = regex.replace(m_impl->value, "\\\\\\1", true);
+ //PosixRegEx regex("([\\\\/])");
+ //std::string v = regex.replace(m_impl->value, "\\1", true);
+ std::string v = str::escape(m_impl->value, '\\');
+ v = str::escape(v, '/');
+ //LOGIT_DEBUG("RDNObject::getOpenSSLValue Value: '" << m_impl->value << "' quoted: '" << v << "'");
ret += v;
Modified: limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/Date.cpp Sun Jul 4 10:28:49 2010
@@ -31,6 +31,7 @@
static std::string adjustLocale();
static void restoreLocale(const std::string & locale);
+ static bool isDST( tm tm );
///////////////////////////////////////////////////////////////////
//
@@ -49,10 +50,18 @@
char * res = ::strptime( date_str.c_str(), format.c_str(), &tm );
if ( res != NULL )
{
+ if( isDST( tm ) )
+ {
+ tm.tm_isdst = 1;
+ }
if(utc)
+ {
_date = ::timegm( &tm );
+ }
else
+ {
_date = ::timelocal( &tm );
+ }
}
restoreLocale(thisLocale);
@@ -83,6 +92,15 @@
return buf;
}
+ static bool isDST( tm tm )
+ {
+ time_t t = ::mktime( &tm );
+ struct tm *tm2 = ::localtime( &t );
+ if( tm2->tm_isdst > 0 )
+ return true;
+ return false;
+ }
+
static std::string adjustLocale()
{
const char * tmp = ::setlocale( LC_TIME, NULL );
Modified: limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/OpenSSLUtils.cpp Sun Jul 4 10:28:49 2010
@@ -2125,12 +2125,12 @@
std::string md5 = sa[1];
std::string date;
- if(sa.size() == 3 && !sa[2].empty())
+ if(sa.size() == 3 && !sa[2].empty())
{
md5 += "-" + sa[2];
- Date dt( str::strtonum(sa[2]) );
- date = std::string(dt.form("%Y-%m-%d %H:%M:%S"));
+ Date dt( sa[2] );
+ date = std::string(dt.form("%Y-%m-%d %H:%M:%S", false));
}
std::map reqLine;
@@ -2617,6 +2617,7 @@
}
if(!stdOutput.empty())
{
+ stdOutput = str::rtrim(stdOutput);
LOGIT_DEBUG("openssl stdout:" << stdOutput);
}
path::removeFile(randfile);
Modified: limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp (original)
+++ limal-branches/mc-devel/limal-ca-mgm/src/RequestData.cpp Sun Jul 4 10:28:49 2010
@@ -218,7 +218,7 @@
std::string s;
for(uint i = 0; i < m_impl->signature.size(); ++i)
{
- s += str::form( "%02x", static_cast<UInt8>(m_impl->signature[i]));
+ s += str::form( "%02x", static_cast<UInt8>(m_impl->signature[i])) + ":";
}
result.push_back("Signature = " + s);
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/ListTest.cc Sun Jul 4 10:28:49 2010
@@ -62,9 +62,12 @@
{
if((*it2).first == "date")
{
- Date dt((*it2).second, "%Y-%m-%d %H:%M:%S", true);
-
- cout << (*it2).first << " = " << dt.form("%Y-%m-%d %H:%M:%S UTC", true) << endl;
+ if(!((*it2).second.empty()) )
+ {
+ //cout << "DATE: " << (*it2).second << endl;
+ Date dt((*it2).second, "%Y-%m-%d %H:%M:%S", false);
+ cout << (*it2).first << " = " << dt.form("%Y-%m-%d %H:%M:%S", true) << " UTC"<< endl;
+ }
}
else
{
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/ParseCertificateTest2.cc Sun Jul 4 10:28:49 2010
@@ -60,7 +60,7 @@
std::vectorstd::string params = PerlRegEx("\\s").split(line);
if(params.size() != 2) break;
- cout << "Parse " << params[0] << " str::form:" << params[1] <http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/cam.txt?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/cam.txt (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA1/cam.txt Sun Jul 4 10:28:49 2010
@@ -1,6 +0,0 @@
-05bbd3f28fafdff5d068dcdc6559ba6f
--1278156285 /C=DE/CN=Test CA//SUSE Inc.Gmbh/emailAddress=suse@suse.de
-c293624b6a877f401407ce8f8f1f327e
--1278156286 /C=DE/L=Nuremberg/O=SUSE Linux GmbH/OU=IT/CN=SUSE User CA/emailAddress=security-team@suse.de
-05bbd3f28fafdff5d068dcdc6559ba6f
--1278156288 /C=DE/CN=Test CA//SUSE Inc.Gmbh/emailAddress=suse@suse.de
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/.rand
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/.rand?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
Binary files - no diff available.
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/TestRepos/Test_CA2/crl/crl.pem Sun Jul 4 10:28:49 2010
@@ -1,7 +1,7 @@
-----BEGIN X509 CRL-----
MIIC+TCCAeECAQEwDQYJKoZIhvcNAQEFBQAwQzELMAkGA1UEBhMCREUxFzAVBgNV
BAMTDlN0YXRpYyBUZXN0IENBMRswGQYJKoZIhvcNAQkBFgxzdXNlQHN1c2UuZGUX
-DTEwMDcwMzExMjQ1MVoXDTEwMDcwNDExMjQ1MVowgfAwEgIBAxcNMDUwODE4MTQx
+DTEwMDcwNDA4Mjc1MVoXDTEwMDcwNTA4Mjc1MVowgfAwEgIBAxcNMDUwODE4MTQx
MzIzWjAyAgEEFw0wNTA4MTgxNDEzMjVaMB4wCgYDVR0VBAMKAQYwEAYDVR0XBAkG
ByqGSM44AgIwOgIBBRcNM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ZXidb2O7kYThjtJJ9lxuLUaz6MvSD7
-----END X509 CRL-----
Modified: limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ListTest.out
URL: http://svn.opensuse.org/viewcvs/limal/limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ListTest.out?rev=2676&r1=2675&r2=2676&view=diff
==============================================================================
--- limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ListTest.out (original)
+++ limal-branches/mc-devel/limal-ca-mgm/testsuite/single.out/ListTest.out Sun Jul 4 10:28:49 2010
@@ -27,7 +27,6 @@
New Entry
commonName = Michael Calmer
country = DE
-date =
emailAddress = mc@suse.de
localityName = Nuremberg
organizationName = My Linux Tux GmbH
--
To unsubscribe, e-mail: limal-commit+unsubscribe@opensuse.org
For additional commands, e-mail: limal-commit+help@opensuse.org