mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-12 22:08:52 +00:00
Merge fix/ci-bundle-L-qf1008: CI fix for Bundle L QF1008 staticcheck hits
This commit is contained in:
@@ -102,8 +102,8 @@ func aesKeyWrap(t *testing.T, kek, plaintext []byte) []byte {
|
|||||||
func buildJWE(t *testing.T, password string, key *ecdsa.PrivateKey, kid string) []byte {
|
func buildJWE(t *testing.T, password string, key *ecdsa.PrivateKey, kid string) []byte {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
// 1. Build the JWK and serialize to JSON (this is the "plaintext" of the JWE)
|
// 1. Build the JWK and serialize to JSON (this is the "plaintext" of the JWE)
|
||||||
xBytes := key.PublicKey.X.Bytes()
|
xBytes := key.X.Bytes()
|
||||||
yBytes := key.PublicKey.Y.Bytes()
|
yBytes := key.Y.Bytes()
|
||||||
dBytes := key.D.Bytes()
|
dBytes := key.D.Bytes()
|
||||||
// Pad to fixed-size for P-256 (32 bytes)
|
// Pad to fixed-size for P-256 (32 bytes)
|
||||||
pad := func(b []byte, size int) []byte {
|
pad := func(b []byte, size int) []byte {
|
||||||
@@ -238,10 +238,10 @@ func TestDecryptProvisionerKey_RoundTrip(t *testing.T) {
|
|||||||
if got.D.Cmp(key.D) != 0 {
|
if got.D.Cmp(key.D) != 0 {
|
||||||
t.Errorf("private scalar D mismatch")
|
t.Errorf("private scalar D mismatch")
|
||||||
}
|
}
|
||||||
if got.PublicKey.X.Cmp(key.PublicKey.X) != 0 {
|
if got.X.Cmp(key.X) != 0 {
|
||||||
t.Errorf("public X mismatch")
|
t.Errorf("public X mismatch")
|
||||||
}
|
}
|
||||||
if got.PublicKey.Y.Cmp(key.PublicKey.Y) != 0 {
|
if got.Y.Cmp(key.Y) != 0 {
|
||||||
t.Errorf("public Y mismatch")
|
t.Errorf("public Y mismatch")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user