Remove dependency to boost 03/40703/1 accepted/tizen_3.0.2015.q2_common tizen_3.0.2015.q2_common accepted/tizen/3.0.2015.q2/common/20150615.091829 accepted/tizen/common/20150610.144456 accepted/tizen/mobile/20150612.003429 accepted/tizen/tv/20150612.003543 accepted/tizen/wearable/20150611.085704 submit/tizen/20150604.065932 submit/tizen/20150608.113003 submit/tizen/20150609.065415 submit/tizen_3.0.2015.q2_common/20150615.075539 submit/tizen_common/20150610.013111 submit/tizen_common/20150610.072250 submit/tizen_mobile/20150611.000000 submit/tizen_tv/20150611.000001 submit/tizen_wearable/20150611.000000
authorkyungwook tak <k.tak@samsung.com>
Mon, 8 Jun 2015 08:12:29 +0000 (17:12 +0900)
committerkyungwook tak <k.tak@samsung.com>
Mon, 8 Jun 2015 08:12:29 +0000 (17:12 +0900)
Change-Id: Id51496cc064626b0dc2913f5e83a27454909d7a2
Signed-off-by: kyungwook tak <k.tak@samsung.com>
packaging/cert-svc.spec [changed mode: 0755->0644]
vcore/src/vcore/CertStoreType.h
vcore/src/vcore/Certificate.cpp
vcore/src/vcore/Certificate.h
vcore/src/vcore/OCSPImpl.h
vcore/src/vcore/api.cpp

old mode 100755 (executable)
new mode 100644 (file)
index 018067a..d940aa0
@@ -8,7 +8,6 @@ License: Apache-2.0
 Source0: %{name}-%{version}.tar.gz
 Source1001: %{name}.manifest
 BuildRequires: cmake
-BuildRequires: boost-devel
 BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(openssl)
 BuildRequires: pkgconfig(evas)
@@ -22,10 +21,8 @@ BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(libxml-2.0)
 BuildRequires: pkgconfig(libxslt)
 BuildRequires: pkgconfig(libtzplatform-config)
-Requires(post):   /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
+Requires: ca-certificates
 Requires: libtzplatform-config
-Provides: libcert-svc-vcore.so.1
 
 %description
 Certification service
@@ -36,7 +33,7 @@ Group:      Development/Libraries
 Requires:   %{name} = %{version}-%{release}
 
 %description devel
-Certification service (developement files)
+Certification service (development files)
 
 %prep
 %setup -q
index e5f79a5..409d9b7 100644 (file)
@@ -25,7 +25,6 @@
 #define _VALIDATION_CORE_CERTSTORETYPE_H_
 
 #include <string.h>
-#include <boost/optional.hpp>
 
 namespace ValidationCore {
 namespace CertStoreId {
index 3080ab9..45bfba6 100644 (file)
@@ -199,12 +199,12 @@ DPL::String Certificate::getOneLine(FieldType type) const
     return DPL::FromUTF8String(buffer);
 }
 
-boost::optional<DPL::String> Certificate::getField(FieldType type,
+DPL::String Certificate::getField(FieldType type,
                                      int fieldNid) const
 {
     X509_NAME *subjectName = getX509Name(type);
     X509_NAME_ENTRY *subjectEntry = NULL;
-    boost::optional < DPL::String > output;
+    DPL::String output;
     int entryCount = X509_NAME_entry_count(subjectName);
 
     for (int i = 0; i < entryCount; ++i) {
@@ -243,45 +243,45 @@ boost::optional<DPL::String> Certificate::getField(FieldType type,
     return output;
 }
 
-boost::optional<DPL::String> Certificate::getCommonName(FieldType type) const
+DPL::String Certificate::getCommonName(FieldType type) const
 {
     return getField(type, NID_commonName);
 }
 
-boost::optional<DPL::String> Certificate::getCountryName(FieldType type) const
+DPL::String Certificate::getCountryName(FieldType type) const
 {
     return getField(type, NID_countryName);
 }
 
-boost::optional<DPL::String> Certificate::getStateOrProvinceName(FieldType type) const
+DPL::String Certificate::getStateOrProvinceName(FieldType type) const
 {
     return getField(type, NID_stateOrProvinceName);
 }
 
-boost::optional<DPL::String> Certificate::getLocalityName(FieldType type) const
+DPL::String Certificate::getLocalityName(FieldType type) const
 {
     return getField(type, NID_localityName);
 }
 
-boost::optional<DPL::String> Certificate::getOrganizationName(FieldType type) const
+DPL::String Certificate::getOrganizationName(FieldType type) const
 {
     return getField(type, NID_organizationName);
 }
 
-boost::optional<DPL::String> Certificate::getOrganizationalUnitName(FieldType type) const
+DPL::String Certificate::getOrganizationalUnitName(FieldType type) const
 {
     return getField(type, NID_organizationalUnitName);
 }
 
-boost::optional<DPL::String> Certificate::getEmailAddres(FieldType type) const
+DPL::String Certificate::getEmailAddres(FieldType type) const
 {
     return getField(type, NID_pkcs9_emailAddress);
 }
 
-boost::optional<DPL::String> Certificate::getOCSPURL() const
+DPL::String Certificate::getOCSPURL() const
 {
     // TODO verify this code
-    boost::optional<DPL::String> retValue;
+    DPL::String retValue;
     AUTHORITY_INFO_ACCESS *aia = static_cast<AUTHORITY_INFO_ACCESS*>(
             X509_get_ext_d2i(m_x509,
                              NID_info_access,
@@ -302,7 +302,7 @@ boost::optional<DPL::String> Certificate::getOCSPURL() const
             ad->location->type == GEN_URI)
         {
             void* data = ASN1_STRING_data(ad->location->d.ia5);
-            retValue = boost::optional<DPL::String>(DPL::FromUTF8String(
+            retValue = DPL::String(DPL::FromUTF8String(
                     static_cast<char*>(data)));
 
             break;
index 8611436..2687468 100644 (file)
@@ -32,8 +32,6 @@
 #include <dpl/noncopyable.h>
 #include <memory>
 #include <dpl/string.h>
-#include <boost/optional.hpp>
-
 
 #include <openssl/x509.h>
 
@@ -111,17 +109,17 @@ class Certificate : public std::enable_shared_from_this<Certificate>
     // getName uses deprecated functions. Usage is strongly discouraged.
     DPL::String getOneLine(FieldType type = FIELD_SUBJECT) const;
 
-    boost::optional<DPL::String> getCommonName(FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getCountryName(FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getStateOrProvinceName(
+    DPL::String getCommonName(FieldType type = FIELD_SUBJECT) const;
+    DPL::String getCountryName(FieldType type = FIELD_SUBJECT) const;
+    DPL::String getStateOrProvinceName(
             FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getLocalityName(FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getOrganizationName(
+    DPL::String getLocalityName(FieldType type = FIELD_SUBJECT) const;
+    DPL::String getOrganizationName(
             FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getOrganizationalUnitName(
+    DPL::String getOrganizationalUnitName(
             FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getEmailAddres(FieldType type = FIELD_SUBJECT) const;
-    boost::optional<DPL::String> getOCSPURL() const;
+    DPL::String getEmailAddres(FieldType type = FIELD_SUBJECT) const;
+    DPL::String getOCSPURL() const;
 
 
     // Openssl supports 9 types of alternative name filed.
@@ -176,7 +174,7 @@ class Certificate : public std::enable_shared_from_this<Certificate>
   protected:
     X509_NAME *getX509Name(FieldType type) const;
 
-    boost::optional<DPL::String> getField(FieldType type,
+    DPL::String getField(FieldType type,
                             int fieldNid) const;
 
     X509 *m_x509;
index 451a244..11cd647 100644 (file)
@@ -38,8 +38,6 @@
 
 #include <dpl/assert.h>
 #include <dpl/exception.h>
-#include <boost/optional.hpp>
-
 
 #include <vcore/scoped_gpointer.h>
 #include <vcore/OCSPCertMgrUtil.h>
@@ -166,8 +164,8 @@ class OCSPImpl
     typedef std::pair<char*, size_t> HttpResponseBuffer;
 
     SoupWrapper::SoupMessageSendBase::RequestStatus sendOcspRequest(
-       OCSP_REQUEST* argRequest,
-       const boost::optional<DPL::String>& argUri);
+        OCSP_REQUEST* argRequest,
+        const DPL::String& argUri);
 
 
 
index 742b434..34ee76b 100644 (file)
@@ -244,13 +244,13 @@ public:
 
         auto certPtr = iter->second;
 
-               boost::optional<DPL::String> result;
+               DPL::String result;
         switch(field) {
             case CERTSVC_SUBJECT:
-                result = boost::optional<DPL::String>(certPtr->getOneLine());
+                result = certPtr->getOneLine();
                 break;
             case CERTSVC_ISSUER:
-                result = boost::optional<DPL::String>(certPtr->getOneLine(Certificate::FIELD_ISSUER));
+                result = certPtr->getOneLine(Certificate::FIELD_ISSUER);
                 break;
             case CERTSVC_SUBJECT_COMMON_NAME:
                 result = certPtr->getCommonName();
@@ -286,32 +286,32 @@ public:
                 {
                     std::stringstream stream;
                     stream << (certPtr->getVersion()+1);
-                    result = boost::optional<DPL::String>(DPL::FromUTF8String(stream.str()));
+                    result = DPL::FromUTF8String(stream.str());
                     break;
                 }
             case CERTSVC_SERIAL_NUMBER:
-                result = boost::optional<DPL::String>(certPtr->getSerialNumberString());
+                result = certPtr->getSerialNumberString();
                 break;
             case CERTSVC_KEY_USAGE:
-                result = boost::optional<DPL::String>(certPtr->getKeyUsageString());
+                result = certPtr->getKeyUsageString();
                 break;
             case CERTSVC_KEY:
-                result = boost::optional<DPL::String>(certPtr->getPublicKeyString());
+                result = certPtr->getPublicKeyString();
                 break;
             case CERTSVC_SIGNATURE_ALGORITHM:
-                result = boost::optional<DPL::String>(certPtr->getSignatureAlgorithmString());
+                result = certPtr->getSignatureAlgorithmString();
                 break;
             default:
                 break;
         }
 
-        if (!result) {
+        if (result.empty()) {
             buffer->privateHandler = NULL;
             buffer->privateLength = 0;
             buffer->privateInstance = cert.privateInstance;
             return CERTSVC_SUCCESS;
         }
-        std::string output = DPL::ToUTF8String(*result);
+        std::string output = DPL::ToUTF8String(result);
 
         char *cstring = new char[output.size()+1];
         if (cstring == NULL) {