Conversation
|
@kfox1111 care to have a look? Without this golang fails to validate spec-compliant EKCerts |
kfox1111
left a comment
There was a problem hiding this comment.
Thanks for working on this. Sorry for the delay. Some questions inline
pkg/server/server.go
Outdated
| oidTcgKpEKCertificate := asn1.ObjectIdentifier{2, 23, 133, 8, 1} | ||
| for _, id := range ek.Certificate.UnknownExtKeyUsage { | ||
| if id.Equal(oidTcgKpEKCertificate) { | ||
| } | ||
| } |
There was a problem hiding this comment.
oh no I think we should throw an error here if it's not this key usage. Let me add that.
There was a problem hiding this comment.
To solve this correctly in a way that is forwards and backwards compatible we need golang/go#75325
Otherwise, if golang ever starts accepting this OID in the standard library, this code will break.
Luckily this just landed in Go 1.26
How aggressive is SPIRE with adopting new go versions? If we are fine with requiring Go 1.26,I can make the check. Otherwise I suggest we remove this code completely and file an issue to improve this later
There was a problem hiding this comment.
after further reading the spec; the field is not critical and also not mandatory. it's marked as Extended Key Usage ExtKeyUsageSyntax tcg-kp-EKCertificate MAY non-critical
So I think I'm going to leave it out for now. As there might be EK Certs in the wild that do not have the field.
There was a problem hiding this comment.
Oh look at this: Merged a few days ago: google/go-attestation#471 🥳
|
Hmm any idea why CI is not triggering on my PR? |
hmm... offhand, no. It looks to me like it should work... will try and dig in soon. |
|
Friendly bump 👋. Would be nice to have this upstream! |
|
Thanks for the reminder. will have a look |
|
Looks like the only thing outstanding is a fix for the deadcode/exception handling. |
|
I'll fix this tomorrow. |
fa66b8e to
ed13fbe
Compare
| require ( | ||
| github.com/google/go-attestation v0.4.4-0.20220404204839-8820d49b18d9 | ||
| github.com/google/go-tpm-tools v0.3.8 | ||
| github.com/google/go-attestation v0.6.1-0.20260123045045-5514d09200e7 |
There was a problem hiding this comment.
This is the (unreleased) commit that implements exactly what we want. google/go-attestation@5514d09
ed13fbe to
3660a48
Compare
|
Some testing failures |
|
I've been trying to get the test suite working locally but it seems incompatible with openssl 3 and my distro doesn't ship anything else... |
|
Okay I'll try to get this fixed. :) |
|
Ah seems CI is running in ubuntu 20.04 which is not even supported anymore. Seems there is quite a bit of work to clean this up. I doubt the test suite even passes on master on newer versions at the moment |
|
quite possible. The tests were inherited from ages ago. |
3660a48 to
bd61580
Compare
|
I commited fixes and ran the tests locally on NixOS and they pass. I naively bumped the CI dockerfile to 24.04 in the hope that that fixes it in CI too |
wagdav
left a comment
There was a problem hiding this comment.
I looked into the build errors and I left some suggestions to fix it. Hope it helps to get this merged!
We use (unreleased) new version of go-attestation which implements this for us. So we get it for free Fix EKCert checking We simply use the newly added functionality for this in go-attestation
bd61580 to
a41192f
Compare
|
The whole ci seems to be a mess frankly. Giving another shot to clean it up with your suggestions but I have very little tolerance having to deal with docker so if it doesn't work I'll offer switching to Nix for CI or someone else will have to push this PR over the finish line. I'm fine with just pointing my stuff to this branch. The code is working fine for me and all the tests pass 🤷 |
|
I installed podman and podman-compose now but I just get permission denied errors etc. I give up. Someone else can try and fix this. Though offer to dump all this docker-compose stuff for doing this with nix still stands :) |
|
@arianvp Using Docker Desktop on Mac, I could build the CI image with your latest changes. The GitHub Actions is now waiting for a maintainer's approval to run. 🤞 🍀 |
|
I was never involved in the tests, so I'm shooting a little blind there, but it looks ok to me. |
|
Wooohooo! |
Fixes #19