summaryrefslogtreecommitdiff
path: root/src/components/security_manager/src/crypto_manager_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/security_manager/src/crypto_manager_impl.cc')
-rw-r--r--src/components/security_manager/src/crypto_manager_impl.cc49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc
index 4adb21646b..84c5db7c0e 100644
--- a/src/components/security_manager/src/crypto_manager_impl.cc
+++ b/src/components/security_manager/src/crypto_manager_impl.cc
@@ -386,8 +386,6 @@ bool CryptoManagerImpl::SaveCertificateData(
utils::ScopeGuard cert_guard = utils::MakeGuard(X509_free, cert);
UNUSED(cert_guard);
- asn1_time_to_tm(X509_get_notAfter(cert));
-
if (1 != BIO_reset(bio_cert)) {
LOG4CXX_WARN(logger_,
"Unabled to reset BIO in order to read private key, "
@@ -406,53 +404,6 @@ bool CryptoManagerImpl::SaveCertificateData(
return SaveModuleCertificateToFile(cert) && SaveModuleKeyToFile(pkey);
}
-int CryptoManagerImpl::pull_number_from_buf(char* buf, int* idx) const {
- if (!idx) {
- return 0;
- }
- const int val = ((buf[*idx] - '0') * 10) + buf[(*idx) + 1] - '0';
- *idx = *idx + 2;
- return val;
-}
-
-void CryptoManagerImpl::asn1_time_to_tm(ASN1_TIME* time) const {
- char* buf = (char*)time->data;
- int index = 0;
- const int year = pull_number_from_buf(buf, &index);
- if (V_ASN1_GENERALIZEDTIME == time->type) {
- expiration_time_.tm_year =
- (year * 100 - 1900) + pull_number_from_buf(buf, &index);
- } else {
- expiration_time_.tm_year = year < 50 ? year + 100 : year;
- }
-
- const int mon = pull_number_from_buf(buf, &index);
- const int day = pull_number_from_buf(buf, &index);
- const int hour = pull_number_from_buf(buf, &index);
- const int mn = pull_number_from_buf(buf, &index);
-
- expiration_time_.tm_mon = mon - 1;
- expiration_time_.tm_mday = day;
- expiration_time_.tm_hour = hour;
- expiration_time_.tm_min = mn;
-
- if (buf[index] == 'Z') {
- expiration_time_.tm_sec = 0;
- }
- if ((buf[index] == '+') || (buf[index] == '-')) {
- const int mn = pull_number_from_buf(buf, &index);
- const int mn1 = pull_number_from_buf(buf, &index);
- expiration_time_.tm_sec = (mn * 3600) + (mn1 * 60);
- } else {
- const int sec = pull_number_from_buf(buf, &index);
- expiration_time_.tm_sec = sec;
- }
-}
-
-void CryptoManagerImpl::InitCertExpTime() {
- strptime("1 Jan 1970 00:00:00", "%d %b %Y %H:%M:%S", &expiration_time_);
-}
-
bool CryptoManagerImpl::UpdateModuleCertificateData(X509* certificate,
EVP_PKEY* key) {
LOG4CXX_AUTO_TRACE(logger_);