Skip to content

Commit a362e65

Browse files
committed
security+tools: remove deprecated TPM unlock functionality
Refs: #4754 Change-Id: I3c2ae4013064e757b66358a47866c38252a0eef1
1 parent 832ea91 commit a362e65

File tree

9 files changed

+7
-243
lines changed

9 files changed

+7
-243
lines changed

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def addExtensionIfExists(extension: str):
101101
('manpages/ndnsec-list', 'ndnsec-list', 'list all known NDN identities, keys, and certificates', [], 1),
102102
('manpages/ndnsec-set-default', 'ndnsec-set-default', 'change the default NDN identity, key, or certificate for the current user', [], 1),
103103
('manpages/ndnsec-sign-req', 'ndnsec-sign-req', 'generate an NDN certificate signing request', [], 1),
104-
('manpages/ndnsec-unlock-tpm', 'ndnsec-unlock-tpm', 'unlock the TPM', [], 1),
105104
('manpages/ndn-client.conf', 'ndn-client.conf', 'configuration file for NDN applications', [], 5),
106105
('manpages/ndn-log', 'ndn-log', 'ndn-cxx logging', [], 7),
107106
]

docs/manpages/ndnsec-unlock-tpm.rst

Lines changed: 0 additions & 15 deletions
This file was deleted.

ndn-cxx/security/tpm/back-end.hpp

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2013-2024 Regents of the University of California.
3+
* Copyright (c) 2013-2025 Regents of the University of California.
44
*
55
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
66
*
@@ -114,62 +114,6 @@ class BackEnd : noncopyable
114114
void
115115
importKey(const Name& keyName, shared_ptr<transform::PrivateKey> key);
116116

117-
/**
118-
* @brief Check if the TPM is in terminal mode.
119-
* @deprecated
120-
*
121-
* The default implementation always returns true.
122-
*/
123-
[[deprecated]]
124-
virtual bool
125-
isTerminalMode() const
126-
{
127-
return true;
128-
}
129-
130-
/**
131-
* @brief Set the terminal mode of the TPM.
132-
* @deprecated
133-
*
134-
* In terminal mode, the TPM will not ask for a password from the GUI.
135-
* The default implementation does nothing.
136-
*/
137-
[[deprecated]]
138-
virtual void
139-
setTerminalMode(bool isTerminal) const
140-
{
141-
}
142-
143-
/**
144-
* @brief Check if the TPM is locked.
145-
* @deprecated
146-
*
147-
* The default implementation always returns false.
148-
*/
149-
[[deprecated]]
150-
virtual bool
151-
isTpmLocked() const
152-
{
153-
return false;
154-
}
155-
156-
/**
157-
* @brief Unlock the TPM.
158-
* @deprecated
159-
*
160-
* The default implementation does nothing and always returns true.
161-
*
162-
* @param pw The password to unlock the TPM.
163-
* @param pwLen The length of the password.
164-
* @return True if the TPM was unlocked.
165-
*/
166-
[[deprecated]]
167-
[[nodiscard]] virtual bool
168-
unlockTpm(const char* pw, size_t pwLen) const
169-
{
170-
return true;
171-
}
172-
173117
protected: // helper methods
174118
/**
175119
* @brief Construct and return the name of a RSA or EC key, based on @p identity and @p params.

ndn-cxx/security/tpm/tpm.cpp

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2013-2024 Regents of the University of California.
3+
* Copyright (c) 2013-2025 Regents of the University of California.
44
*
55
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
66
*
@@ -91,35 +91,6 @@ Tpm::decrypt(span<const uint8_t> buf, const Name& keyName) const
9191
return key ? key->decrypt(buf) : nullptr;
9292
}
9393

94-
#pragma GCC diagnostic push
95-
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
96-
97-
bool
98-
Tpm::isTerminalMode() const
99-
{
100-
return m_backEnd->isTerminalMode();
101-
}
102-
103-
void
104-
Tpm::setTerminalMode(bool isTerminal) const
105-
{
106-
m_backEnd->setTerminalMode(isTerminal);
107-
}
108-
109-
bool
110-
Tpm::isTpmLocked() const
111-
{
112-
return m_backEnd->isTpmLocked();
113-
}
114-
115-
bool
116-
Tpm::unlockTpm(const char* password, size_t passwordLength) const
117-
{
118-
return m_backEnd->unlockTpm(password, passwordLength);
119-
}
120-
121-
#pragma GCC diagnostic pop
122-
12394
ConstBufferPtr
12495
Tpm::exportPrivateKey(const Name& keyName, const char* pw, size_t pwLen) const
12596
{

ndn-cxx/security/tpm/tpm.hpp

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2013-2024 Regents of the University of California.
3+
* Copyright (c) 2013-2025 Regents of the University of California.
44
*
55
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
66
*
@@ -126,44 +126,6 @@ class Tpm : noncopyable
126126
ConstBufferPtr
127127
decrypt(span<const uint8_t> buf, const Name& keyName) const;
128128

129-
public: // Management
130-
/**
131-
* @brief Check if the TPM is in terminal mode.
132-
* @deprecated
133-
*/
134-
[[deprecated]]
135-
bool
136-
isTerminalMode() const;
137-
138-
/**
139-
* @brief Set the terminal mode of the TPM.
140-
* @deprecated
141-
*
142-
* When in terminal mode, the TPM will not ask user permission from GUI.
143-
*/
144-
[[deprecated]]
145-
void
146-
setTerminalMode(bool isTerminal) const;
147-
148-
/**
149-
* @return true if the TPM is locked, otherwise false.
150-
* @deprecated
151-
*/
152-
[[deprecated]]
153-
bool
154-
isTpmLocked() const;
155-
156-
/**
157-
* @brief Unlock the TPM.
158-
* @deprecated
159-
*
160-
* @param password The password to unlock the TPM.
161-
* @param passwordLength The password size.
162-
*/
163-
[[deprecated]]
164-
[[nodiscard]] bool
165-
unlockTpm(const char* password, size_t passwordLength) const;
166-
167129
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE: // operations accessible only by KeyChain
168130
/**
169131
* @brief Create a Tpm instance.

tools/ndnsec/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2013-2024 Regents of the University of California.
3+
* Copyright (c) 2013-2025 Regents of the University of California.
44
*
55
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
66
*
@@ -86,7 +86,6 @@ main(int argc, char* argv[])
8686
else if (command == "cert-install") { return ndnsec_cert_install(argc, argv); }
8787
else if (command == "export") { return ndnsec_export(argc, argv); }
8888
else if (command == "import") { return ndnsec_import(argc, argv); }
89-
else if (command == "unlock-tpm") { return ndnsec_unlock_tpm(argc, argv); }
9089
else {
9190
std::cerr << "ERROR: Unknown command '" << command << "'\n\n" << NDNSEC_HELP_TEXT;
9291
return 2;

tools/ndnsec/ndnsec.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2013-2023 Regents of the University of California.
3+
* Copyright (c) 2013-2025 Regents of the University of California.
44
*
55
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
66
*
@@ -59,9 +59,6 @@ ndnsec_export(int argc, char** argv);
5959
int
6060
ndnsec_import(int argc, char** argv);
6161

62-
int
63-
ndnsec_unlock_tpm(int argc, char** argv);
64-
6562
} // namespace ndn::ndnsec
6663

6764
#endif // NDN_CXX_TOOLS_NDNSEC_NDNSEC_HPP

tools/ndnsec/unlock-tpm.cpp

Lines changed: 0 additions & 93 deletions
This file was deleted.

tools/ndnsec/wscript

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ def build(bld):
1616

1717
# create convenience symlinks
1818
for cmd in ('list', 'get-default', 'set-default', 'delete',
19-
'key-gen', 'sign-req', 'cert-gen', 'cert-install',
20-
'cert-dump', 'export', 'import', 'unlock-tpm'):
19+
'key-gen', 'sign-req', 'cert-gen', 'cert-dump',
20+
'cert-install', 'export', 'import'):
2121
bld.symlink_as('${BINDIR}/ndnsec-%s' % cmd, 'ndnsec')

0 commit comments

Comments
 (0)