Closed shivakumargurija closed 1 month ago
Please refer to the failing test case in cbor_test.go
> GOARCH=arm GOARM=5 go test -c -o test.arm32 ./cbor
> qemu-arm ./test.arm32
--- FAIL: TestEmbeddedStruct (0.00s)
cbor_test.go:2142: Unexpected B value in embedded struct. Expected: , Received:test
cbor_test.go:2147: Unexpected C value in embedded struct. Expected: [], Received:[12 13 14 15]
FAIL
> go test -c -o test ./cbor
> ./test
PASS
Replaced by #15 (since I can't push to your branch). I made you commit author @shivakumargurija. Thank you for the amazing find!
Fix for Defect https://github.com/fido-device-onboard/go-fdo/issues/6
Marshalling and unmarshalling of CBOR data works as expected for arm32-v5 platform. Saving blob.DeviceCredential to file and reading works as expected with this fix.
Added a test case in cbor_test.go to demonstrate the defect. It marshals & unmarshals only last field of the embedded struct correctly.
Test output on arm32:
Test output on x86: