-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify a timestamp server #47
Comments
There is no way to tell Git what arguments to pass to smimesign. You have two options for making smimesign use a timestamp server when used with Git. The first would be to create a shell script that wraps smimesign and adds additional arguments. You would then tell Git to use this wrapper script for signing instead of having it call smimesign directly. The second option is to specify a default timestamp server when compiling smimesign. Lines 20 to 22 in 6eb0038
In the long run, I'd like to add a |
Would it be possible to have the tool check an environment variable? I'd really like to avoid having to build the tool bespoke to hard-code it. |
That could be added if it were useful. Is there a way to get Git to set an environment variable based on the Git config, or would the idea be to have a variable that you set in your bash profile? |
Given that timestamp servers don't generally care about the user or the signing cert, I'd be okay with having it set for my profile all-up. It could also use a Like that config file could have a mapping of email addresses to thumbprints in case there's multiple email addresses with each having multiple matching certs available. |
I'd like to avoid going down the path of a separate config file for this tool, though maybe that isn't reasonable. What are your thoughts on installing a wrapper script on the PATH that adds arguments? |
Where would that wrapper script go; would that directory be easily user-editable? |
Also, does git ignore extra sections? You could potentially piggyback on the user's profile-wide |
I'm not sure. Maybe running #!/bin/sh
smimesign --include-certs=-3 --timestamp-authority= http://timestamp.digicert.com "$@" and then run
Git should ignore extra sections. I can ask around to see how terrible this would be. |
I think this is also relevant for gpg signed commits. |
Definitely an issue for gpgsm too. It would be nice to be able to specify |
... sounds like something to fix upstream, not with wrappers... |
Yeah. I agree that adding another Git config entry to specifying additional signing tool arguments would be ideal. I don't have time to work on this right now and have forgotten the Git syntax for emailing patches, unfortunately. |
Let us stick to the topic. I think that git does not actually support RFC3161 timestamps, hence there will not be an argument to the The second thing |
@henning-schild For gpgsm, do they ignore certificate validity periods? How do they assess valid signatures (or do they accept anything)? Is it worth having a discussion around having gpgsm support timestamps? |
For verification whether a signature is valid, that should not matter at all. For signing you have to tell git which key to use. And if we are talking about trust, that is outside the scope of verification and could potentially be relevant for smimesign. Or it should be offloaded to the Windows/Mac key/cert store. |
I do not know, and i guess the following: Signature made with the cert within its period, should be valid forever, unless the cert gets revoked ... which might shorten the time or make all invalid. And gpgsm probably just takes the current time of the machine, so i guess one could create a valid signature with an expired ... revoked cert. |
The inability to verify old signatures from expired GPG key or X.509 certificates is a huge deficiency of signing Git commits/tags currently. Adding RFC3161 timestamps, especially since they are supported by S/MIME, is a big usability improvement.
Gpgsm includes the entire certificate chain (except for the root) in each signature. This is about 5KB for my DigiCert certificate, but could easily be ten times that size when dealing with the US federal government's CAs. My understanding is that this added bloat is likely to cause significant performance issues for large repositories. If it can be assumed that verifiers know how to reconstruct the chain, it would be very beneficial to not include it in every signature. More generally though, my point here was that user's might want to customize other aspects of Git signing by passing additional arguments to the signing tool. |
Yes. This is a big problem for gpg and gpgsm. |
I guess the whole timestamp story is again a story of trust and not of authenticity. You would not want to distrust a whole repo because the key of the maintainer got revoked some day, you would need to trust the (new) maintainer to not merge commits signed with the revoked key anymore. |
I would argue that it's about authenticity and that timestamps help verify that the key was used before it was expired or revoked. That should not need to be a manual process, relying on a maintainer to check that. Without a timestamp, how can you be sure of authenticity? IMO, timestamps have nothing to do with trust. I agree though that this should be involving git upstream. |
Smimesign isn't exactly reinventing the wheel. Timestamps are explicitly designed to work with CMS. See Appendix A of RFC3161. |
@mastahyeti Agreed. I'm suggesting that the Git ecosystem needs to embrace timestamps all-up. |
Bump, any movement here? There's two issues:
|
No movement. Sorry. My current thinking is to have smimesign use the Git config for storing some options. That will take some effort to implement though. I can't make promises about when I'll get around to it. In the meantime, I'd recommend using a script that wraps smimesign as discussed above. |
My attempts at that failed (to work correctly on Windows). If you could maybe provide that, it'd help. You can see my failed attempts here: https://github.com/onovotny/MSBuildSdkExtras/commits/test The last one is when I finally built smimesign from source and specified the defaultTSA (which was painful since it also required GCC in the path, something to add to the readme...). I couldn't figure out how to display the full signature with timestamp though; the GitHub UI doesn't show the timestamp either. |
I just created a @echo off
smimesign.exe --timestamp-authority http://timestamp.digicert.com %* I put this file in a directory on my
Unfortunately, github.com support for timestamp verification is currently blocked on ruby/openssl#204 😦 |
@mastahyeti Great to see the TSA functionality landed within ruby openssl! I was thinking about the config ui for this, I think it should be My ~/.gitconfig looks then like this:
@henning-schild Is there a best practice for optional configs or should e.g. tsa be added to the allowed configs with doc somehow? |
As far as i know gpg(sm) does not support tsa and git does not either. So it would be a config key for smimesign, maybe better kept in a separate configfile. |
The use of the config key |
I would go for |
@mastahyeti Simplify developers life by providing such an option recognized by smimesign would be cool. What do you think? |
Yes. I'm definitely in favor of adding the ability to read a TSA option from the git config. I'd like to work on this as well as adding support to GitHub.com. Given other, competing priorities though, I haven't had a chance yet and I'm not sure when I will. |
The utility supports a timestamp parameter, but it's not clear how to specify it in the git configuration so that it's used.
How do we specify the timestamp server to use?
The text was updated successfully, but these errors were encountered: