{"action":"created","issue":{"url":"https://api.github.com/repos/QubesOS/qubes-issues/issues/4378","repository_url":"https://api.github.com/repos/QubesOS/qubes-issues","labels_url":"https://api.github.com/repos/QubesOS/qubes-issues/issues/4378/labels{/name}","comments_url":"https://api.github.com/repos/QubesOS/qubes-issues/issues/4378/comments","events_url":"https://api.github.com/repos/QubesOS/qubes-issues/issues/4378/events","html_url":"https://github.com/QubesOS/qubes-issues/issues/4378","id":367498088,"node_id":"MDU6SXNzdWUzNjc0OTgwODg=","number":4378,"title":"Is Qubes master signing key SHA1?","user":{"login":"19hundreds","id":43415338,"node_id":"MDQ6VXNlcjQzNDE1MzM4","avatar_url":"https://avatars1.githubusercontent.com/u/43415338?v=4","gravatar_id":"","url":"https://api.github.com/users/19hundreds","html_url":"https://github.com/19hundreds","followers_url":"https://api.github.com/users/19hundreds/followers","following_url":"https://api.github.com/users/19hundreds/following{/other_user}","gists_url":"https://api.github.com/users/19hundreds/gists{/gist_id}","starred_url":"https://api.github.com/users/19hundreds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/19hundreds/subscriptions","organizations_url":"https://api.github.com/users/19hundreds/orgs","repos_url":"https://api.github.com/users/19hundreds/repos","events_url":"https://api.github.com/users/19hundreds/events{/privacy}","received_events_url":"https://api.github.com/users/19hundreds/received_events","type":"User","site_admin":false},"labels":[{"id":183969432,"node_id":"MDU6TGFiZWwxODM5Njk0MzI=","url":"https://api.github.com/repos/QubesOS/qubes-issues/labels/duplicate","name":"duplicate","color":"bfe5bf","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-06T21:37:25Z","updated_at":"2018-10-06T22:50:21Z","closed_at":"2018-10-06T22:05:50Z","author_association":"NONE","body":"Hello, \r\n\r\nthis is not a bug report but a heads up. I've read the guideline and I couldn't find a better fitting way to report this case. Somehow mailing list felt wrong.\r\n\r\nI'm definitely a newbie in everything therefore, hopefully, what I'm reporting here is totally irrelevant if not wrong. \r\n\r\nI'm studying GPG and I was playing around with GPG conf.\r\n\r\nSome guides I've stumbled upon are advising to add this GPG line to gpg.conf\r\n\r\n```\r\nweak-digest SHA1\r\n```\r\n\r\nbecause of [this](https://www.computerworld.com/article/3173616/security/the-sha1-hash-function-is-now-completely-unsafe.html) reported SHA1 collision.\r\n\r\nAfter adding this like I noticed that I was unable to import Qubes signing key\r\n\r\n```\r\nuser@x-vault:~\r\n> gpg --batch --gen-key foo\r\ngpg: keybox '/home/user/.gnupg/pubring.kbx' created\r\ngpg: Generating a default key\r\ngpg: /home/user/.gnupg/trustdb.gpg: trustdb created\r\ngpg: key 0x05E61DD6D9F8311C marked as ultimately trusted\r\ngpg: revocation certificate stored as '/home/user/.gnupg/openpgp-revocs.d/80F8CC94DC3432176C8FCE7705E61DD6D9F8311C.rev'\r\ngpg: done\r\n\r\nuser@x-vault:~\r\n> gpg --import qubes-master-signing-key.asc \r\ngpg: Note: signatures using the SHA1 algorithm are rejected\r\ngpg: key 0xDDFA1A3E36879494: no valid user IDs\r\ngpg: this may be caused by a missing self-signature\r\ngpg: Total number processed: 1\r\ngpg:           w/o user IDs: 1\r\n```\r\n\r\nNotice the: **gpg: Note: signatures using the SHA1 algorithm are rejected**. \r\n\r\nThe key was not imported.\r\n\r\n```\r\nuser@x-vault:~\r\n> gpg -k\r\ngpg: checking the trustdb\r\ngpg: marginals needed: 3  completes needed: 1  trust model: pgp\r\ngpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u\r\n/home/user/.gnupg/pubring.kbx\r\n-----------------------------\r\npub   rsa4096/0x05E61DD6D9F8311C 2018-10-06 [SC]\r\n      Key fingerprint = 80F8 CC94 DC34 3217 6C8F  CE77 05E6 1DD6 D9F8 311C\r\nuid                   [ultimate] Joe Tester <joe@foo.bar>\r\n```\r\n\r\nThe only way I have found to import it was to use the `--allow-non-selfsigned-uid` option:\r\n\r\n```\r\nuser@x-vault:~\r\n> gpg --allow-non-selfsigned-uid --import qubes-master-signing-key.asc \r\ngpg: Note: signatures using the SHA1 algorithm are rejected\r\ngpg: key 0xDDFA1A3E36879494: accepted non self-signed user ID \"Qubes Master Signing Key\"\r\ngpg: key 0xDDFA1A3E36879494: public key \"Qubes Master Signing Key\" imported\r\ngpg: Total number processed: 1\r\ngpg:               imported: 1\r\n\r\nuser@x-vault:~\r\n> gpg -k\r\n/home/user/.gnupg/pubring.kbx\r\n-----------------------------\r\npub   rsa4096/0x05E61DD6D9F8311C 2018-10-06 [SC]\r\n      Key fingerprint = 80F8 CC94 DC34 3217 6C8F  CE77 05E6 1DD6 D9F8 311C\r\nuid                   [ultimate] Joe Tester <joe@foo.bar>\r\n\r\ngpg: Note: signatures using the SHA1 algorithm are rejected\r\npub   rsa4096/0xDDFA1A3E36879494 2010-04-01 [SCEA]\r\n      Key fingerprint = 427F 11FD 0FAA 4B08 0123  F01C DDFA 1A3E 3687 9494\r\nuid                   [ unknown] Qubes Master Signing Key\r\n```\r\n\r\nSo I commented the `weak-digest SHA1` line from my GPG conf and repeated the operation. It worked without problems.\r\n\r\nThen I checked your key with this command:\r\n\r\n```\r\nuser@x-vault:~\r\n> gpg --list-packets qubes-master-signing-key.asc \r\n# off=0 ctb=99 tag=6 hlen=3 plen=525\r\n:public key packet:\r\n\tversion 4, algo 1, created 1270124793, expires 0\r\n\tpkey[0]: [4096 bits]\r\n\tpkey[1]: [17 bits]\r\n\tkeyid: DDFA1A3E36879494\r\n# off=528 ctb=b4 tag=13 hlen=2 plen=24\r\n:user ID packet: \"Qubes Master Signing Key\"\r\n# off=554 ctb=89 tag=2 hlen=3 plen=568\r\n:signature packet: algo 1, keyid DDFA1A3E36879494\r\n\tversion 4, created 1270124793, md5len 0, sigclass 0x13\r\n\tdigest algo 2, begin of digest d7 b9\r\n\thashed subpkt 2 len 4 (sig created 2010-04-01)\r\n\thashed subpkt 27 len 1 (key flags: 03)\r\n\thashed subpkt 11 len 5 (pref-sym-algos: 9 8 7 3 2)\r\n\thashed subpkt 21 len 5 (pref-hash-algos: 8 2 9 10 11)\r\n\thashed subpkt 22 len 3 (pref-zip-algos: 2 3 1)\r\n\thashed subpkt 30 len 1 (features: 01)\r\n\thashed subpkt 23 len 1 (keyserver preferences: 80)\r\n\tsubpkt 16 len 8 (issuer key ID DDFA1A3E36879494)\r\n\tdata: [4095 bits]\r\n```\r\n\r\nAccordingly to [RFC 4880](https://tools.ietf.org/html/rfc4880#section-9.4) SHA1 is ID 2\r\n\r\n```\r\nHash Algorithms\r\nID           Algorithm                        Text Name\r\n1          - MD5 [HAC]                      \"MD5\"\r\n2          - SHA-1 [FIPS180]             \"SHA1\"\r\n```\r\n\r\nwhich matches the line:\r\n\r\n`digest algo 2, begin of digest d7 b9`\r\n\r\nMy limited knowledge doesn't help here, however I interpret the above output in this way:\r\n\r\n> you signed your public key (MD5 hashed) using a SHA1 hashed signature\r\n\r\n```\r\n:public key packet:\r\n\tversion 4, algo 1, created 1270124793, expires 0\r\n\r\n:signature packet: algo 1, keyid DDFA1A3E36879494\r\n\tversion 4, created 1270124793, md5len 0, sigclass 0x13\r\n\tdigest algo 2, begin of digest d7 b9\r\n```\r\n\r\nDo I get it right?\r\n\r\nDo you think this can be an issue?\r\n\r\nI hope I'm not wasting your precious and already limited time. Thank you very much for your exceptional work: words can't describe my appreciation."},"comment":{"url":"https://api.github.com/repos/QubesOS/qubes-issues/issues/comments/427611767","html_url":"https://github.com/QubesOS/qubes-issues/issues/4378#issuecomment-427611767","issue_url":"https://api.github.com/repos/QubesOS/qubes-issues/issues/4378","id":427611767,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzYxMTc2Nw==","user":{"login":"andrewdavidwong","id":10417133,"node_id":"MDQ6VXNlcjEwNDE3MTMz","avatar_url":"https://avatars1.githubusercontent.com/u/10417133?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewdavidwong","html_url":"https://github.com/andrewdavidwong","followers_url":"https://api.github.com/users/andrewdavidwong/followers","following_url":"https://api.github.com/users/andrewdavidwong/following{/other_user}","gists_url":"https://api.github.com/users/andrewdavidwong/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewdavidwong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewdavidwong/subscriptions","organizations_url":"https://api.github.com/users/andrewdavidwong/orgs","repos_url":"https://api.github.com/users/andrewdavidwong/repos","events_url":"https://api.github.com/users/andrewdavidwong/events{/privacy}","received_events_url":"https://api.github.com/users/andrewdavidwong/received_events","type":"User","site_admin":false},"created_at":"2018-10-06T22:50:21Z","updated_at":"2018-10-06T22:50:21Z","author_association":"MEMBER","body":"> yes the two tickets are related to this one. The difference is that, to my understanding, there is a potential security risk.\r\n\r\nThat is not a difference, since the other two issues also entail security risks. There is a security risk to using SHA-1 instead of SHA-256 or SHA-512 for PGP signatures (#1116), and there is a security risk to not generating a new QMSK, given the limitations of the current one (#2818)."}}
{"actor":{"display_login":"andrewdavidwong"}}