From 3e5d0599b410f942fe74669bfdd812d0c605c56c Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Mon, 30 Mar 2026 22:18:41 +0800 Subject: [PATCH] Edit Snippets --- docs/tech/Snippets.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/tech/Snippets.md b/docs/tech/Snippets.md index 3813808..4421764 100644 --- a/docs/tech/Snippets.md +++ b/docs/tech/Snippets.md @@ -177,7 +177,7 @@ services: 5. 最后,重启你的电脑。 -## 修复 macOS Tahoe 26.4 git 提交时调用 ed25519-sk SSH 密钥报错 +## 修复 macOS Tahoe 26.4 git 提交时调用 ed25519-sk SSH 密钥错误 ### 环境 @@ -186,7 +186,7 @@ services: ### 报错 -``` +``` title="Output" > git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - error: Signing file /var/folders/71/0cg33245411cnc0d7zfrkgqm0000gn/T//.git_signing_buffer_tmpLjPKBL Confirm user presence for key ED25519-SK SHA256:11zuoQXlgOuWaSqwMjnI0RJvlDEj+ZdgnlKZd8xJNC0 @@ -199,7 +199,7 @@ fatal: failed to write commit object ### 解决办法 -``` +``` bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew uninstall --force openssh libfido2 @@ -217,5 +217,11 @@ git config --global gpg.ssh.program "/opt/homebrew/bin/ssh-keygen" git config --global gpg.ssh.ssh-keygen-extra-args "-P /opt/homebrew/Cellar/libfido2/1.16.0_1/lib/libfido2.1.16.0.dylib" # 此处需指向 FIDO 驱动文件 git config --global user.signingkey "~/.ssh/git-signing-for-mac.pub" # 新生成的公钥记得在 GitHub 注册 -code . # 通过终端启动 Visual Studio Code -``` \ No newline at end of file +code Documents/Code/VSCODE.code-workspace # 通过终端启动 Visual Studio Code +``` + +### 不解之谜 + +按照 Gemini 的分析,报错的根源已经超出了 macOS 和 Git 的范畴,这是 PicoKey 固件(针对 RP2350 芯片)在生成底层密码学签名时的一个 Bug。 + +OpenSSH 的安全校验极其严苛(通常基于 OpenSSL 库)。如果 PicoKey 发回的签名在长度、字节对齐或格式规范上哪怕有 1 bit 不符合严格的 FIDO2 SSH 规范,OpenSSH 就会拒绝解析这串数据,直接抛出 invalid format?(格式无效),以防范中间人攻击。 \ No newline at end of file