diff options
| author | Andrew Tropin <andrew@trop.in> | 2024-09-05 10:24:08 +0400 |
|---|---|---|
| committer | Andrew Tropin <andrew@trop.in> | 2024-09-05 10:28:45 +0400 |
| commit | b0e224566f2ca6b8d375c89f8d023e1b836f31e4 (patch) | |
| tree | 20ebf8bab344b9a17dc0f81ade015edf5f0cc9c2 | |
| parent | 0b95de9b3bad19da20cb034ca2bc245c2b48cf00 (diff) | |
gnu: libcamera: Disable signature verification.
Signature verification breaks, when libcamera is grafted. Running built-in
libcamera modules via proxy is not recommended by upstream and not always
work. We control the build process of all libcamera modules, so to workaround
the issue we disable signature verification. For more information see:
<https://issues.guix.gnu.org/72828>
* gnu/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/networking.scm (libcamera): Disable signature verification.
[inputs]: Remove gnutls and openssl.
[arguments]: Remove re-sign-binaries phase.
[source]: Add disable-signature patch.
Change-Id: Icf422553c0f49b28d7997a1e818a4b8d9a6b5732
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/networking.scm | 20 | ||||
| -rw-r--r-- | gnu/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch | 55 |
3 files changed, 59 insertions, 17 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 8d8c552a4df..656d61e7600 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -1589,6 +1589,7 @@ dist_patch_DATA = \ | |||
| 1589 | %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ | 1589 | %D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \ |
| 1590 | %D%/packages/patches/julia-Use-MPFR-4.2.patch \ | 1590 | %D%/packages/patches/julia-Use-MPFR-4.2.patch \ |
| 1591 | %D%/packages/patches/libcall-ui-make-it-installable.patch \ | 1591 | %D%/packages/patches/libcall-ui-make-it-installable.patch \ |
| 1592 | %D%/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch \ | ||
| 1592 | %D%/packages/patches/libcss-check-format.patch \ | 1593 | %D%/packages/patches/libcss-check-format.patch \ |
| 1593 | %D%/packages/patches/libextractor-tidy-support.patch \ | 1594 | %D%/packages/patches/libextractor-tidy-support.patch \ |
| 1594 | %D%/packages/patches/libftdi-fix-paths-when-FTDIPP-set.patch \ | 1595 | %D%/packages/patches/libftdi-fix-paths-when-FTDIPP-set.patch \ |
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index 9facbae82d7..11e92b919fe 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm | |||
| @@ -382,6 +382,8 @@ them in order to efficiently transfer a minimal amount of data.") | |||
| 382 | (git-reference | 382 | (git-reference |
| 383 | (url "https://git.libcamera.org/libcamera/libcamera.git") | 383 | (url "https://git.libcamera.org/libcamera/libcamera.git") |
| 384 | (commit (string-append "v" version)))) | 384 | (commit (string-append "v" version)))) |
| 385 | (patches (search-patches | ||
| 386 | "libcamera-ipa_manager-disable-signature-verification.patch")) | ||
| 385 | (file-name | 387 | (file-name |
| 386 | (git-file-name name version)) | 388 | (git-file-name name version)) |
| 387 | (sha256 | 389 | (sha256 |
| @@ -431,21 +433,7 @@ them in order to efficiently transfer a minimal amount of data.") | |||
| 431 | (mkdir-p (string-append gst "/lib")) | 433 | (mkdir-p (string-append gst "/lib")) |
| 432 | (rename-file | 434 | (rename-file |
| 433 | (string-append out "/lib/gstreamer-1.0") | 435 | (string-append out "/lib/gstreamer-1.0") |
| 434 | (string-append gst "/lib/gstreamer-1.0"))))) | 436 | (string-append gst "/lib/gstreamer-1.0")))))))) |
| 435 | (add-after 'shrink-runpath 're-sign-binaries | ||
| 436 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 437 | "Update signatures of all ipa libraries. | ||
| 438 | |||
| 439 | After stipping phases signatures are not valid anymore, so it's necessary to | ||
| 440 | re-sign." | ||
| 441 | (let* ((out (assoc-ref outputs "out"))) | ||
| 442 | (for-each | ||
| 443 | (lambda (file) | ||
| 444 | (invoke | ||
| 445 | "source/src/ipa/ipa-sign.sh" "src/ipa-priv-key.pem" | ||
| 446 | file (string-append file ".sign"))) | ||
| 447 | (find-files | ||
| 448 | (string-append out "/lib/libcamera") "\\.so$")))))))) | ||
| 449 | (native-inputs | 437 | (native-inputs |
| 450 | (list googletest | 438 | (list googletest |
| 451 | graphviz ;for 'dot' | 439 | graphviz ;for 'dot' |
| @@ -458,11 +446,9 @@ re-sign." | |||
| 458 | (list eudev | 446 | (list eudev |
| 459 | glib | 447 | glib |
| 460 | gst-plugins-base | 448 | gst-plugins-base |
| 461 | gnutls | ||
| 462 | libevent | 449 | libevent |
| 463 | libtiff | 450 | libtiff |
| 464 | libyaml | 451 | libyaml |
| 465 | openssl | ||
| 466 | python-jinja2 | 452 | python-jinja2 |
| 467 | python-ply | 453 | python-ply |
| 468 | qtbase)) | 454 | qtbase)) |
diff --git a/gnu/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch b/gnu/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch new file mode 100644 index 00000000000..aa4dff3fe3b --- /dev/null +++ b/gnu/packages/patches/libcamera-ipa_manager-disable-signature-verification.patch | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | From c99706475cde3d963a17f4f8871149711ce6c467 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrew Tropin <andrew@trop.in> | ||
| 3 | Date: Wed, 4 Sep 2024 21:36:16 +0400 | ||
| 4 | Subject: [PATCH] libcamera: ipa_manager: Disable signature verification | ||
| 5 | |||
| 6 | --- | ||
| 7 | src/libcamera/ipa_manager.cpp | 28 +++++----------------------- | ||
| 8 | 1 file changed, 5 insertions(+), 23 deletions(-) | ||
| 9 | |||
| 10 | diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp | ||
| 11 | index cfc24d38..4fd3cf3e 100644 | ||
| 12 | --- a/src/libcamera/ipa_manager.cpp | ||
| 13 | +++ b/src/libcamera/ipa_manager.cpp | ||
| 14 | @@ -284,33 +284,15 @@ IPAModule *IPAManager::module(PipelineHandler *pipe, uint32_t minVersion, | ||
| 15 | |||
| 16 | bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const | ||
| 17 | { | ||
| 18 | -#if HAVE_IPA_PUBKEY | ||
| 19 | - char *force = utils::secure_getenv("LIBCAMERA_IPA_FORCE_ISOLATION"); | ||
| 20 | - if (force && force[0] != '\0') { | ||
| 21 | - LOG(IPAManager, Debug) | ||
| 22 | - << "Isolation of IPA module " << ipa->path() | ||
| 23 | - << " forced through environment variable"; | ||
| 24 | - return false; | ||
| 25 | - } | ||
| 26 | - | ||
| 27 | - File file{ ipa->path() }; | ||
| 28 | - if (!file.open(File::OpenModeFlag::ReadOnly)) | ||
| 29 | - return false; | ||
| 30 | - | ||
| 31 | - Span<uint8_t> data = file.map(); | ||
| 32 | - if (data.empty()) | ||
| 33 | - return false; | ||
| 34 | - | ||
| 35 | - bool valid = pubKey_.verify(data, ipa->signature()); | ||
| 36 | + LOG(IPAManager, Debug) | ||
| 37 | + << "Signature verification is disabled by Guix. " | ||
| 38 | + << "See https://issues.guix.gnu.org/72828 for more details."; | ||
| 39 | |||
| 40 | LOG(IPAManager, Debug) | ||
| 41 | << "IPA module " << ipa->path() << " signature is " | ||
| 42 | - << (valid ? "valid" : "not valid"); | ||
| 43 | + << "not verified (verification skipped)."; | ||
| 44 | |||
| 45 | - return valid; | ||
| 46 | -#else | ||
| 47 | - return false; | ||
| 48 | -#endif | ||
| 49 | + return true; | ||
| 50 | } | ||
| 51 | |||
| 52 | } /* namespace libcamera */ | ||
| 53 | -- | ||
| 54 | 2.45.2 | ||
| 55 | |||
