-
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
cgo windows to syscall #93
base: main
Are you sure you want to change the base?
Conversation
Thanks for the updated PR! I'm not sure when we'll have time to re-evaluate |
@tg123 Thanks a lot for this, it's very helpful! |
take a look how to use it as a https://github.com/tg123/phabrik/blob/main/examples/cert.go#L11
then you have a regular tlsconfig |
@tg123 thanks, and this is what i did, but i get: "tls: failed to sign handshake: bad private key" (( Here's my further code to the request, that works if i load the PrivateKey from file:
|
i believe it is due to your private, please check the This should be discuss in a separate thread BTW |
I was using this until I ran into #116 failing to prompt for smart card PIN. |
after using syscall? |
Thanks for following up! This patch works great if the certificate is not on a smart card. However, now that I'm trying to use a certificate on a smart card, nCryptSignHash fails as explained in #116, returning NTE_SILENT_CONTEXT as per the very end of the Parameters documentation, even though dwFlags = BCRYPT_PAD_PKCS1 (2) and the referenced NCRYPT_SILENT_FLAG = 0x40 (64). It's also worth noting that the expected error text is "Provider could not perform the action since the context was acquired as silent." but the output is "The operation completed successfully.", though the hash is 0's. I went back to v0.2.0-rc1 and it's working fine. The only thing I could think of would be a need for a parent HWND for the PIN prompt¹, but I haven't found any change removing something like that yet. |
@jspraul
|
[X] replace cgo with sys call. gcc is not widely used on windows
[X] force use cng. cng is recommend after vista
[X] PSS supported. this is for go app to use keys in cert store to do tls1.3 (https)
[X] add OpenStoreWindows which takes store name and store location.
github/certstore#20