micromdm / scep

Go SCEP server
MIT License
310 stars 121 forks source link

Openssl revoke doesn't work with index.txt #199

Closed antwacky closed 1 year ago

antwacky commented 2 years ago

Hello, me again.

When I try to revoke a certificate using the generated index.txt, I get the following:

ERROR:name does not match 0D

Although the named certificate does exist in the index.txt:

V 230609075710Z 0D de7ac2b85f380dd1b3083d44d4b1ebff89033fae37015a2acd9e8a35c41e751e.13.pem

I believe this must be due to the file format, however I'm not sure. Any ideas?

Thanks

antwacky commented 2 years ago

I found that openssl expects the serial hex to be lower case, so when I changed 0D to 0d, the certificate was revoked successfully.

I'll submit a fix if I have time to test it fully. I see a few serial ToUpper() in depot.go, maybe it is relied on elsewhere too.

antwacky commented 2 years ago

I have submitted a pull request for this:

https://github.com/micromdm/scep/pull/200