security: support more SHA2 hash functions
Change-Id: Ibbe4f02054ae9028899e8408c331ae8e704df9b8
diff --git a/src/security/tpm/back-end-osx.cpp b/src/security/tpm/back-end-osx.cpp
index 53c2295..145ffeb 100644
--- a/src/security/tpm/back-end-osx.cpp
+++ b/src/security/tpm/back-end-osx.cpp
@@ -1,5 +1,5 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
* Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
@@ -100,7 +100,10 @@
getDigestAlgorithm(DigestAlgorithm digestAlgo)
{
switch (digestAlgo) {
+ case DigestAlgorithm::SHA224:
case DigestAlgorithm::SHA256:
+ case DigestAlgorithm::SHA384:
+ case DigestAlgorithm::SHA512:
return kSecDigestSHA2;
default:
return 0;
@@ -111,15 +114,21 @@
getDigestSize(DigestAlgorithm digestAlgo)
{
switch (digestAlgo) {
+ case DigestAlgorithm::SHA224:
+ return 224;
case DigestAlgorithm::SHA256:
return 256;
+ case DigestAlgorithm::SHA384:
+ return 384;
+ case DigestAlgorithm::SHA512:
+ return 512;
default:
return -1;
}
}
BackEndOsx::BackEndOsx(const std::string&)
- : m_impl(new Impl)
+ : m_impl(make_unique<Impl>())
{
SecKeychainSetUserInteractionAllowed(!m_impl->isTerminalMode);