summaryrefslogtreecommitdiff
path: root/src/libcamera/ipa_manager.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-05-05 18:03:00 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-07-05 15:38:59 +0300
commit52579639ce1b17de251fc69619d95d18b93fb377 (patch)
tree0adc631fe0de62ba474295c54007d4be22199da7 /src/libcamera/ipa_manager.cpp
parent1d5a072c5e9efd04fd081e6215fa800690058575 (diff)
apps: Add ipa-verify application
When packaging libcamera, distributions may break IPA module signatures if the packaging process strips binaries. This can be fixed by resigning the modules, but the process is error-prone. Add a command line ipa-verify utility that tests the signature on an IPA module to help packagers. The tool takes a single argument, the path to an IPA module shared object, and expects the signature file (.sign) to be in the same directory. In order to access the public key needed for signature verification, add a static function to the IPAManager class. As the class is internal to libcamera, this doesn't affect the public API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Tested-by: Javier Martinez Canillas <javierm@redhat.com>
Diffstat (limited to 'src/libcamera/ipa_manager.cpp')
-rw-r--r--src/libcamera/ipa_manager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
index ac539700..7a4515d9 100644
--- a/src/libcamera/ipa_manager.cpp
+++ b/src/libcamera/ipa_manager.cpp
@@ -279,6 +279,19 @@ IPAModule *IPAManager::module(PipelineHandler *pipe, uint32_t minVersion,
* found or if the IPA proxy fails to initialize
*/
+#if HAVE_IPA_PUBKEY
+/**
+ * \fn IPAManager::pubKey()
+ * \brief Retrieve the IPA module signing public key
+ *
+ * IPA module signature verification is normally handled internally by the
+ * IPAManager class. This function is meant to be used by utilities that need to
+ * verify signatures externally.
+ *
+ * \return The IPA module signing public key
+ */
+#endif
+
bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const
{
#if HAVE_IPA_PUBKEY