From 23380a3d31c73cc3d6aec40cc681708c81b89a9e Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Wed, 4 Jan 2023 17:00:23 +0100 Subject: [PATCH] Fix missing `ECDSA` curve when signing on Windows --- attest/key_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attest/key_windows.go b/attest/key_windows.go index 21489c32..d7b62c0a 100644 --- a/attest/key_windows.go +++ b/attest/key_windows.go @@ -268,9 +268,9 @@ func (k *windowsAK20) sign(tb tpmBase, digest []byte, pub crypto.PublicKey, opts return nil, fmt.Errorf("TPMKeyHandle() failed: %v", err) } - switch pub.(type) { + switch p := pub.(type) { case *ecdsa.PublicKey: - return signECDSA(rw, hnd, digest) + return signECDSA(rw, hnd, digest, p.Curve) case *rsa.PublicKey: return signRSA(rw, hnd, digest, opts) }