GPG signing doesn't seem to work with the GPG SQLite DB format

Đang mở
#269 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
git, java
Lĩnh vực
backend, security

Hướng nghiên cứu

Start with BouncyCastleGpgKeyLocator.java, especially the referenced lines 430–431, and trace how it locates public keys and reports gpgNoPublicKeyFound. Then investigate how GnuPG's keyboxd exposes keys when use-keyboxd is set in common.conf; the issue does not identify a test. Done means signing can find the configured public key with the SQLite key database, without requiring a filesystem keybox.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Version

7.6.0.202603022253-r

Operating System

Windows

Bug description

I use gpg4win on a Windows device, which seems to default to storing GPG keys in the newer SQLite database format in $env:APPDATA/gnupg/public-keys.d/pubring.db.

Trying to commit with a signature throws in https://github.com/eclipse-jgit/jgit/blob/b302b8737d6e2976d9926be8b04338339dc1ea30/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgKeyLocator.java#L430-L431 because the signing key I have configured in Git can't be found, because jgit+bc can't find the public key.

The very quick and dirty solution I had was to run

gpg-disable-keyboxd
gpg-enable-keyboxd

(those are not gpg sub-commands, they are individual binaries). If I've understood the problem properly disabling keyboxd wrote out a copy of all the keys in the .db file to $env:APPDATA/gnupg/pubring.kbx, which jgit+bc does find when trying to sign a commit.

Actual behavior

No stack trace, just an error message containing the text in gpgNoPublicKeyFound (Unable to find a public-key with key or user id: {0}) and searching the code shows this is the only place where the message text is used.

Expected behavior

jgit+bc should check and see if the use-keyboxd is in common.conf (https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration.html), and if it is it should query keyboxd (no idea how, sorry) for the keys, instead of rummaging around in the filesystem itself.

Relevant log output

Other information

No response

Ngôn ngữ chính
Java
Star
427
Fork
116
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-jgit/jgit

Tất cả issue của eclipse-jgit/jgit

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.