From: Scott Cantor Date: Tue, 18 Mar 2008 03:06:52 +0000 (+0000) Subject: Package fixes. X-Git-Tag: 1.0.0^0 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=commitdiff_plain;h=a934a8b4cfcb4c9a6aabad577f7194eaeba9f78e Package fixes. --- diff --git a/depend b/depend index 6d0e187..f3ebd3e 100644 --- a/depend +++ b/depend @@ -4,3 +4,5 @@ P SHIBxerces xerces-c 2.8.0 P SHIBxmlsec xml-security-c 1.4.0 +P SHIBlog4shib log4shib + 1.0 diff --git a/dependencies/curl/depend b/dependencies/curl/depend new file mode 100644 index 0000000..c0fa6b2 --- /dev/null +++ b/dependencies/curl/depend @@ -0,0 +1,2 @@ +P SHIBossl OpenSSL + 0.9.8g diff --git a/dependencies/openssl/pkginfo b/dependencies/openssl/pkginfo index 3f3e178..a2db7ab 100644 --- a/dependencies/openssl/pkginfo +++ b/dependencies/openssl/pkginfo @@ -1,10 +1,9 @@ -ARCH=sparc PKG=SHIBossl NAME=openssl - OpenSSL Secure Sockets Layer lib and utilities -VERSION=0.9.8e +VERSION=0.9.8g CATEGORY=system VENDOR=http://www.openssl.org/source/ packaged for Shibboleth by Scott Cantor -HOTLINE=http://bugs.internet2.edu/ +HOTLINE=https://bugs.internet2.edu/ EMAIL=cantor.2@osu.edu -PSTAMP=11Jun2007 +PSTAMP=17Mar2008 CLASSES=none diff --git a/dependencies/openssl/postinstall b/dependencies/openssl/postinstall new file mode 100644 index 0000000..f19e1cf --- /dev/null +++ b/dependencies/openssl/postinstall @@ -0,0 +1,17 @@ +#!/bin/sh + +cd ${CLIENT_BASEDIR}/lib/pkgconfig + +sed "s|^prefix=.*|prefix=${CLIENT_BASEDIR}|1" libcrypto.pc > libcrypto.pc.tmp +mv libcrypto.pc.tmp libcrypto.pc +chmod 644 libcrypto.pc + +sed "s|^prefix=.*|prefix=${CLIENT_BASEDIR}|1" libssl.pc > libssl.pc.tmp +mv libssl.pc.tmp libssl.pc +chmod 644 libssl.pc + +sed "s|^prefix=.*|prefix=${CLIENT_BASEDIR}|1" openssl.pc > openssl.pc.tmp +mv openssl.pc.tmp openssl.pc +chmod 644 openssl.pc + +exit 0 diff --git a/dependencies/xml-security/depend b/dependencies/xml-security/depend new file mode 100644 index 0000000..5a583f8 --- /dev/null +++ b/dependencies/xml-security/depend @@ -0,0 +1,4 @@ +P SHIBossl OpenSSL + 0.9.8g +P SHIBxerces xerces-c + 2.8.0 diff --git a/pkginfo.in b/pkginfo.in index 4fe456e..76b88a6 100644 --- a/pkginfo.in +++ b/pkginfo.in @@ -1,5 +1,4 @@ PKG=SHIBxmltool -ARCH=sparc VERSION=@-VERSION-@ NAME=xmltooling-c CATEGORY=application,textproc,security diff --git a/xmltooling/security/BasicX509Credential.h b/xmltooling/security/BasicX509Credential.h index 37948e5..e33e785 100644 --- a/xmltooling/security/BasicX509Credential.h +++ b/xmltooling/security/BasicX509Credential.h @@ -41,7 +41,7 @@ namespace xmltooling { * * @param ownCerts true iff any certificates subsequently stored should be freed by destructor */ - BasicX509Credential(bool ownCerts) : m_key(NULL), m_serial(-1), m_ownCerts(ownCerts), m_crl(NULL), m_keyInfo(NULL), m_compactKeyInfo(NULL) { + BasicX509Credential(bool ownCerts) : m_key(NULL), m_ownCerts(ownCerts), m_crl(NULL), m_keyInfo(NULL), m_compactKeyInfo(NULL) { } /** @@ -52,7 +52,7 @@ namespace xmltooling { * @param crl optional CRL */ BasicX509Credential(XSECCryptoKey* key, const std::vector& certs, XSECCryptoX509CRL* crl=NULL) - : m_key(key), m_serial(-1), m_xseccerts(certs), m_ownCerts(true), m_crl(crl), m_keyInfo(NULL), m_compactKeyInfo(NULL) { + : m_key(key), m_xseccerts(certs), m_ownCerts(true), m_crl(crl), m_keyInfo(NULL), m_compactKeyInfo(NULL) { } /** The private/secret key/keypair. */ @@ -68,7 +68,7 @@ namespace xmltooling { std::string m_issuerName; /** Serial number. */ - int m_serial; + std::string m_serial; /** The X.509 certificate chain. */ std::vector m_xseccerts; @@ -143,8 +143,8 @@ namespace xmltooling { return m_issuerName.c_str(); } - int getSerialNumber() const { - return m_serial; + const char* getSerialNumber() const { + return m_serial.c_str(); } void extract(); diff --git a/xmltooling/security/X509Credential.h b/xmltooling/security/X509Credential.h index 387dc72..a4d6e69 100644 --- a/xmltooling/security/X509Credential.h +++ b/xmltooling/security/X509Credential.h @@ -83,7 +83,7 @@ namespace xmltooling { * * @return the serial number */ - virtual int getSerialNumber() const=0; + virtual const char* getSerialNumber() const=0; /** * Extracts properties like issuer and subject from the first certificate in the chain. diff --git a/xmltooling/security/impl/BasicX509Credential.cpp b/xmltooling/security/impl/BasicX509Credential.cpp index ff7fb52..f6bd596 100644 --- a/xmltooling/security/impl/BasicX509Credential.cpp +++ b/xmltooling/security/impl/BasicX509Credential.cpp @@ -63,7 +63,7 @@ void BasicX509Credential::initKeyInfo() } } - if (!m_subjectName.empty() || (!m_issuerName.empty() && m_serial >= 0)) { + if (!m_subjectName.empty() || (!m_issuerName.empty() && !m_serial.empty())) { if (!m_compactKeyInfo) m_compactKeyInfo = KeyInfoBuilder::buildKeyInfo(); X509Data* x509Data=X509DataBuilder::buildX509Data(); @@ -75,16 +75,14 @@ void BasicX509Credential::initKeyInfo() x509Data->getX509SubjectNames().push_back(sn); } - if (!m_issuerName.empty() && m_serial >= 0) { + if (!m_issuerName.empty() && !m_serial.empty()) { X509IssuerSerial* is = X509IssuerSerialBuilder::buildX509IssuerSerial(); X509IssuerName* in = X509IssuerNameBuilder::buildX509IssuerName(); auto_ptr_XMLCh wide(m_issuerName.c_str()); in->setName(wide.get()); is->setX509IssuerName(in); X509SerialNumber* ser = X509SerialNumberBuilder::buildX509SerialNumber(); - char buf[64]; - sprintf(buf,"%d",m_serial); - auto_ptr_XMLCh wide2(buf); + auto_ptr_XMLCh wide2(m_serial.c_str()); ser->setSerialNumber(wide2.get()); is->setX509SerialNumber(ser); x509Data->getX509IssuerSerials().push_back(is); @@ -137,7 +135,7 @@ void BasicX509Credential::extract() if (serialBN) { char* serial = BN_bn2dec(serialBN); if (serial) { - m_serial = atoi(serial); + m_serial = serial; free(serial); } BN_free(serialBN); diff --git a/xmltooling/security/impl/InlineKeyResolver.cpp b/xmltooling/security/impl/InlineKeyResolver.cpp index a9771fb..45136c5 100644 --- a/xmltooling/security/impl/InlineKeyResolver.cpp +++ b/xmltooling/security/impl/InlineKeyResolver.cpp @@ -217,8 +217,10 @@ void InlineCredential::resolve(const KeyInfo* keyInfo, int types) } const X509SerialNumber* ser = inames.front()->getX509SerialNumber(); - if (ser) - m_serial = XMLString::parseInt(ser->getSerialNumber()); + if (ser) { + auto_ptr_char sn(ser->getSerialNumber()); + m_serial = sn.get(); + } } } } @@ -433,8 +435,10 @@ void InlineCredential::resolve(DSIGKeyInfoList* keyInfo, int types) delete[] kn; } n = kix->getX509IssuerSerialNumber(); - if (n && *n) - m_serial = XMLString::parseInt(n); + if (n && *n) { + auto_ptr_char sn(n); + m_serial = sn.get(); + } } } }