Package fixes. master upstream/trunk trunk
authorcantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Tue, 18 Mar 2008 03:06:52 +0000 (03:06 +0000)
committercantor <cantor@de75baf8-a10c-0410-a50a-987c0e22f00f>
Tue, 18 Mar 2008 03:06:52 +0000 (03:06 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@488 de75baf8-a10c-0410-a50a-987c0e22f00f

depend
dependencies/curl/depend [new file with mode: 0644]
dependencies/openssl/pkginfo
dependencies/openssl/postinstall [new file with mode: 0644]
dependencies/xml-security/depend [new file with mode: 0644]
pkginfo.in
xmltooling/security/BasicX509Credential.h
xmltooling/security/X509Credential.h
xmltooling/security/impl/BasicX509Credential.cpp
xmltooling/security/impl/InlineKeyResolver.cpp

diff --git a/depend b/depend
index 6d0e187..f3ebd3e 100644 (file)
--- 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 (file)
index 0000000..c0fa6b2
--- /dev/null
@@ -0,0 +1,2 @@
+P SHIBossl OpenSSL
+       0.9.8g
index 3f3e178..a2db7ab 100644 (file)
@@ -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 (file)
index 0000000..f19e1cf
--- /dev/null
@@ -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 (file)
index 0000000..5a583f8
--- /dev/null
@@ -0,0 +1,4 @@
+P SHIBossl OpenSSL
+       0.9.8g
+P SHIBxerces xerces-c
+       2.8.0
index 4fe456e..76b88a6 100644 (file)
@@ -1,5 +1,4 @@
 PKG=SHIBxmltool
-ARCH=sparc
 VERSION=@-VERSION-@
 NAME=xmltooling-c
 CATEGORY=application,textproc,security
index 37948e5..e33e785 100644 (file)
@@ -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<XSECCryptoX509*>& 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<XSECCryptoX509*> 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();
index 387dc72..a4d6e69 100644 (file)
@@ -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.
index ff7fb52..f6bd596 100644 (file)
@@ -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);
index a9771fb..45136c5 100644 (file)
@@ -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();
+            }
         }
     }
 }