diff options
Diffstat (limited to 'src/manager/client/client-manager-impl.cpp')
-rw-r--r-- | src/manager/client/client-manager-impl.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/manager/client/client-manager-impl.cpp b/src/manager/client/client-manager-impl.cpp index f1b68bb1..fa4f5a9f 100644 --- a/src/manager/client/client-manager-impl.cpp +++ b/src/manager/client/client-manager-impl.cpp @@ -143,7 +143,7 @@ int Manager::Impl::saveBinaryData( int Manager::Impl::saveKey(const Alias &alias, const KeyShPtr &key, const Policy &policy) { - if (key.get() == NULL) + if (key.get() == NULL || key->empty()) return CKM_API_ERROR_INPUT_PARAM; try { @@ -159,7 +159,7 @@ int Manager::Impl::saveCertificate( const CertificateShPtr &cert, const Policy &policy) { - if (cert.get() == NULL) + if (cert.get() == NULL || cert->empty()) return CKM_API_ERROR_INPUT_PARAM; return saveBinaryData(alias, DataType::CERTIFICATE, cert->getDER(), policy); @@ -626,11 +626,17 @@ int Manager::Impl::getCertificateChain( if (!certificate || certificate->empty()) return CKM_API_ERROR_INPUT_PARAM; - for (auto &e : untrustedCertificates) + for (auto &e : untrustedCertificates) { + if (!e || e->empty()) + return CKM_API_ERROR_INPUT_PARAM; untrustedVector.push_back(e->getDER()); + } - for (auto &e : trustedCertificates) + for (auto &e : trustedCertificates) { + if (!e || e->empty()) + return CKM_API_ERROR_INPUT_PARAM; trustedVector.push_back(e->getDER()); + } return getCertChain( m_storageConnection, |