Skip to content
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

ec.key doesn't correspond to cert.der{,.old} #8

Open
martindorey opened this issue Mar 25, 2022 · 1 comment
Open

ec.key doesn't correspond to cert.der{,.old} #8

martindorey opened this issue Mar 25, 2022 · 1 comment

Comments

@martindorey
Copy link

I was hoping to probe a vulnerable system with a command like this:

$ < /dev/null openssl s_client -cert cert.der.old -certform DER -key ec.key -keyform PEM
error setting private key
140222542737472:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:../crypto/x509/x509_cmp.c:297:
$ 

... but the error message there made me try this (h/t https://security.stackexchange.com/a/73131/276099):

$ openssl pkey -in ec.key -pubout > key.pub
$ openssl x509 -in cert.der.old -inform DER -pubkey -noout >  cert.der.old.pub
$ diff *.pub
7,8c7,8
< //////////+85vqtpxeehPO5ysL8YyVRAgEBAyIAA+/L/l5HQLeGeajfxw/bAjdo
< GFf9xBgV3j34fVhn2EFD
---
> //////////+85vqtpxeehPO5ysL8YyVRAgEBAyIAAjfHIC2Zuu/BE0zc8q9Cw6Ny
> 0rUxh6Ka+ViN7zpL7/89
$ 

Did something go wrong when @catbro666 uploaded the original files in 345bf80?

@catbro666
Copy link
Contributor

I was hoping to probe a vulnerable system with a command like this:

$ < /dev/null openssl s_client -cert cert.der.old -certform DER -key ec.key -keyform PEM
error setting private key
140222542737472:error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch:../crypto/x509/x509_cmp.c:297:
$ 

... but the error message there made me try this (h/t https://security.stackexchange.com/a/73131/276099):

$ openssl pkey -in ec.key -pubout > key.pub
$ openssl x509 -in cert.der.old -inform DER -pubkey -noout >  cert.der.old.pub
$ diff *.pub
7,8c7,8
< //////////+85vqtpxeehPO5ysL8YyVRAgEBAyIAA+/L/l5HQLeGeajfxw/bAjdo
< GFf9xBgV3j34fVhn2EFD
---
> //////////+85vqtpxeehPO5ysL8YyVRAgEBAyIAAjfHIC2Zuu/BE0zc8q9Cw6Ny
> 0rUxh6Ka+ViN7zpL7/89
$ 

Did something go wrong when @catbro666 uploaded the original files in 345bf80?

Oops, It seems like I made a mistake. Maybe the key file was overwritten by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants