| | @@ -0,0 +1,117 @@ |
| 1 | +# Signing Check-ins
|
| 2 | +
|
| 3 | +Fossil can sign check-in manifests. A basic concept in public-key
|
| 4 | +cryptography, signing can bring some advantages such as authentication and
|
| 5 | +non-repudiation. In practice, a serious obstacle is the public key
|
| 6 | +infrastructure – that is, the problem of reliably verifying that a given
|
| 7 | +public key belongs to its supposed owner (also known as _"signing is easy,
|
| 8 | +verifying is hard"_).
|
| 9 | +
|
| 10 | +Fossil neither creates nor verifies signatures by itself, instead relying on
|
| 11 | +external tools that have to be installed side-by-side. Historically, the tool
|
| 12 | +most employed for this task was [GnuPG](https://gnupg.org); recently, there has
|
| 13 | +been an increase in the usage of [OpenSSH](https://openssh.com) (the minimum
|
| 14 | +required version is 8.1, released on 2019-10-09).
|
| 15 | +
|
| 16 | +## Signing a check-in
|
| 17 | +
|
| 18 | +The `clearsign` setting must be on; this will cause every check-in to be signed
|
| 19 | +(unless you provide the `--nosign` flag to `fossil commit`). To this end,
|
| 20 | +Fossil calls the command given by the `pgp-command` setting.
|
| 21 | +
|
| 22 | +Fossil needs a non-detached signature that includes the rest of the usual
|
| 23 | +manifest. For GnuPG, this is no problem, but as of 2025 (version 9.9p1) OpenSSH
|
| 24 | +can create **and verify** only detached signatures; Fossil itself must
|
| 25 | +attach this signature to the manifest prior to committing. This makes the
|
| 26 | +verification more complex, as additional steps are needed to extract the
|
| 27 | +signature and feed it into OpenSSH.
|
| 28 | +
|
| 29 | +### GnuPG
|
| 30 | +
|
| 31 | +The `pgp-command` setting defaults to
|
| 32 | +`gpg --clearsign -o`.
|
| 33 | +(A possible interesting option to `gpg --clearsign` is `-u`, to specify the
|
| 34 | +user to be used for signing.)
|
| 35 | +
|
| 36 | +### OpenSSH
|
| 37 | +
|
| 38 | +A reasonable value for `pgp-command` is
|
| 39 | +
|
| 40 | +```
|
| 41 | +ssh-keygen -q -Y sign -n fossilscm -f ~/.ssh/id_ed25519
|
| 42 | +```
|
| 43 | +
|
| 44 | +for Linux, and
|
| 45 | +
|
| 46 | +```
|
| 47 | +ssh-keygen -q -Y sign -n fossilscm -f %USERPROFILE%/.ssh/id_ed25519
|
| 48 | +```
|
| 49 | +
|
| 50 | +for Windows, changing as appropriate `-f` to the path of the private key to be
|
| 51 | +used.
|
| 52 | +
|
| 53 | +The value for `-n` (the _namespace_) can be changed at will, but care has to be
|
| 54 | +taken to use the same value whenbs, not Fossil
|
| 55 | +artifacts.
|
| 56 | +
|
| 57 | +
|
| 58 | +## Verifying a signature
|
| 59 | +
|
| 60 | +Fossil does not provide an internal method for verifying signatures and
|
| 61 | +relies – like it does for sig # Signing Check-ins
|
| 62 | +
|
| 63 | +Fossil can sign check-in manifests. A basic concept in public-key
|
| 64 | +cryptography, signing can bring some advantages such as authentication and
|
| 65 | +non-repudiation. In practice, a serious obstacle is the public key
|
| 66 | +infrastructure – that is, the problem of reliably verifying that a given
|
| 67 | +public key belongs to its supposed owner (also known as _"signing is easy,
|
| 68 | +verifying is hard"_).
|
| 69 | +
|
| 70 | +Fossil neither creates nor verifies signatures by itself, instead relying on
|
| 71 | +external tools that have to be installed side-by-side. Historically, the tool
|
| 72 | +most employed for this task was [GnuPG](https://gnupg.org); recently, there has
|
| 73 | +been an increase in the usage of [OpenSSH](https://openssh.com) (the minimum
|
| 74 | +required version is 8.1, released on 2019-10-09).
|
| 75 | +
|
| 76 | +## Signing a check-in
|
| 77 | +
|
| 78 | +The `clearsign` setting must be on; this will cause every check-in to be signed
|
| 79 | +(unless you provide the `--nosign` flag to `fossil commit`). To this end,
|
| 80 | +Fossil calls the command given by the `pgp-command` setting.
|
| 81 | +
|
| 82 | +Fossil needs a non-detached signature that includes the rest of the usual
|
| 83 | +manifest. For GnuPG, this is no problem, but as of 2025 (version 9.9p1) OpenSSH
|
| 84 | +can create **and verify** only detached signatures; Fossil itself must
|
| 85 | +attach this signature to the manifest prior to committing. This makes the
|
| 86 | +verification more complex, as additional steps are needed to extract the
|
| 87 | +signature and feed it into OpenSSH.
|
| 88 | +
|
| 89 | +### GnuPG
|
| 90 | +
|
| 91 | +The `pgp-command` setting defaults to
|
| 92 | +`gpg --clearsign -o`.
|
| 93 | +(A possible interesting option to `gpg --clearsign` is `-u`, to specify the
|
| 94 | +user to be used for signing.)
|
| 95 | +
|
| 96 | +### OpenSSH
|
| 97 | +
|
| 98 | +A reasonable value for `pgp-command` is
|
| 99 | +
|
| 100 | +```
|
| 101 | +ssh-keygen -q -Y sign -n fossilscm -f ~/.ssh/id_ed25519
|
| 102 | +```
|
| 103 | +
|
| 104 | +for Linux, and
|
| 105 | +
|
| 106 | +```
|
| 107 | +ssh-keygen -q -Y sign -n fossilscm -f %USERPROFILE%/.ssh/id_ed25519
|
| 108 | +```
|
| 109 | +
|
| 110 | +for Windows, changing as appropriate `-f` to the path of the private key to be
|
| 111 | +used.
|
| 112 | +
|
| 113 | +The value for `-n` (the _namespace_) can be changed at will, but care has to be
|
| 114 | +taken to use the same value when verifying the signature.
|
| 115 | +
|
| 116 | +Fossil versions prior to 2.26 do not understand SSH signatures and
|
| 117 | +will treat artifacts signed this l can sign check-in manifes |