ANSSI-FR / ultrablue

User-friendly Lightweight TPM Remote Attestation over Bluetooth
Apache License 2.0
163 stars 10 forks source link

Server crash with latest client (in testbed) #10

Open kerneis-anssi opened 2 years ago

kerneis-anssi commented 2 years ago

When testing PR #7, I get the following error in the testbed, running the server in --enroll mode and the latest client on a Pixel 4a:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5dbce7]

goroutine 16 [running]:
main.parseAttestEK(0xc000136c30)
    /root/src/protocol.go:98 +0x1a7
main.registration(0xc000013860?, 0xc0000495d0)
    /root/src/protocol.go:115 +0x113
main.ultrablueProtocol(0xc0000a0480?)
    /root/src/protocol.go:250 +0xde
created by main.getConnectionState
    /root/src/state.go:95 +0x185

The last message I see on the Android side is Getting EkPub and EkCert.

This does not happen when running the server outside of the testbed. My guess is that this comes from the fact that I don't have clean build of the testbed, so my server and client are out-of-sync.

However, the server should not crash, even if the client sends garbage data. We should investigate this crash and makes sure the server handles the situation properly.

ghost commented 2 years ago

This is due to the fact that virtual TPMs does not ships EK certificate, and I din't checked for it.

nbouchinet-anssi commented 2 years ago

Please keep your mkosi.output somewhere so we can investigate this, is there a way you can send it to me ?

kerneis-anssi commented 2 years ago

Confirmed that it crashes even with a clean build.