gnupg - debgsig-verify 失败,gpg : no valid OpenPGP data found while gpg decrypt can verify the detached signature

标签 gnupg sign apt deb

为什么 debsig-verify 在 _gpgorigin 时验证失败分离的签名与组合的 debian-binary control.tar.gz data.tar.gz 相匹配文件?

是因为这个WARNING: This key is not certified with a trusted signature!

关于 debian:7 docker 容器包签名运行良好并且在 debian:9.8它失败了

gpg: no valid OpenPGP data found.
    gpg: processing message failed: Unknown system error
    debsig: subprocess getKeyID returned error exit status 2

签名流程

# Unpack
ar x unsigned.deb

# Generate combine file
cat debian-binary control.tar.gz data.tar.gz > combined

# Create detached signature for combined
gpg -abs -o _gpgorigin combined

# Repack
ar rc signed.deb _gpgorigin debian-binary control.tar.gz data.tar.gz

验证分离的签名(似乎成功)

gpg --output doc --decrypt _gpgorigin
        Detached signature.
        Please enter name of data file: combined
        gpg: Signature made Thu Apr 25 22:43:37 2019 UTC
        gpg:                using RSA key AAAABBBBCCCCDDDD996FCC98FFFFFFFFFFFFFFFF
        gpg: Good signature from "mygroup Testing <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a7d3c2d4d3cec9c0e7cadec0d5c8d2d789c9c2d3" rel="noreferrer noopener nofollow">[email protected]</a>>" [unknown]
        gpg: WARNING: This key is not certified with a trusted signature!
        gpg:          There is no indication that the signature belongs to the owner.
        Primary key fingerprint: AAAA BBBB CCCC DDDD 996F CC98 FFFF FFFF FFFF FFFF

验证签名包(失败)

debsig-verify -v -d signed.deb

    debsig: Starting verification for: signed.deb
    debsig:         getSigKeyID: got FFFFFFFFFFFFFFFF for origin key
    debsig: Using policy directory: /etc/debsig/policies/FFFFFFFFFFFFFFFF
    debsig:   Parsing policy file: /etc/debsig/policies/FFFFFFFFFFFFFFFF/mygroup-test.pol
    debsig:     parsePolicyFile: parsing '/etc/debsig/policies/FFFFFFFFFFFFFFFF/mygroup-test.pol'
    debsig:     parsePolicyFile: completed
    debsig:     Checking Selection group(s).
    debsig:       Processing 'origin' key...
    gpg: no valid OpenPGP data found.
    gpg: processing message failed: Unknown system error
    debsig: subprocess getKeyID returned error exit status 2

警察 key 环的 key 列表

 gpg --no-default-keyring --keyring  /usr/share/debsig/keyrings/FFFFFFFFFFFFFFFF/pubring.gpg --list-sigs
/usr/share/debsig/keyrings/FFFFFFFFFFFFFFFF/pubring.gpg
-------------------------------------------------------
pub   rsa2048 2017-06-19 [SC]
      AAAABBBBCCCCDDDD996FCC98FFFFFFFFFFFFFFFF
uid           [ unknown] MyGroup Testing <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="76021305021f1811361b0f110419030658181302" rel="noreferrer noopener nofollow">[email protected]</a>>
sig 3        FFFFFFFFFFFFFFFF 2017-06-19  MyGroup Testing <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="45312036312c2b2205283c22372a30356b2b2031" rel="noreferrer noopener nofollow">[email protected]</a>>
sub   rsa2048 2017-06-19 [E]
sig          FFFFFFFFFFFFFFFF 2017-06-19  MyGroup Testing <<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="35415046415c5b5275584c52475a40451b5b5041" rel="noreferrer noopener nofollow">[email protected]</a>>


最佳答案

我刚刚遇到了类似的问题,并发现了一些我做错的事情,这些事情在文档/示例中并不明显:

  1. 确保策略文件具有使用 https(而不是少数示例使用的 http)的 XML 命名空间,即 <Policy xmlns="https://www.debian.org/debsig/1.0/">

  2. “ key 环”文件不是 key 环,它只是一个(公共(public)) key 。

  3. “ key 环”文件不得采用 ASCII 防护。

经过上述更改,包验证成功(Ubuntu 18.04)

关于gnupg - debgsig-verify 失败,gpg : no valid OpenPGP data found while gpg decrypt can verify the detached signature,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55858700/

相关文章:

docker - 如何在 Docker 容器中使用 GnuPG,因为它缺少熵?

java - 从 Java 运行时为 Linux 运行命令

shell - GnuPG Shell 脚本 - 拒绝读取密码

java - maven-webstart-plugin 可以对 JNLP 文件本身进行签名吗?

android - 无法找到在 Windows 上执行 "gradle assembleRelease"的位置

php - 包 php5 没有安装候选(Ubuntu 16.04)

Bash 脚本在终端外运行时不起作用

java - 我应该使用哪个小型 Java 库在小程序中签署 PDF 文件?

mongodb - "gpgkeys: key 7F0CEB10 not found on keyserver"尝试在 Ubuntu 上安装 mongodb 时响应

java - 如何使用 APT 工具在类(class) Material 中创建练习