Lines Matching refs:sig
48 VbSignature *sig; in VerifyDataTest() local
51 sig = CalculateSignature(test_data, test_size, private_key); in VerifyDataTest()
52 TEST_PTR_NEQ(sig, 0, "VerifyData() calculate signature"); in VerifyDataTest()
57 if (!sig || !rsa) in VerifyDataTest()
60 TEST_EQ(VerifyData(test_data, test_size, sig, rsa), 0, in VerifyDataTest()
63 sig->sig_size -= 16; in VerifyDataTest()
64 TEST_EQ(VerifyData(test_data, test_size, sig, rsa), 1, in VerifyDataTest()
66 sig->sig_size += 16; in VerifyDataTest()
68 TEST_EQ(VerifyData(test_data, test_size - 1, sig, rsa), 1, in VerifyDataTest()
71 GetSignatureData(sig)[0] ^= 0x5A; in VerifyDataTest() local
72 TEST_EQ(VerifyData(test_data, test_size, sig, rsa), 1, in VerifyDataTest()
76 free(sig); in VerifyDataTest()
83 VbSignature *sig; in VerifyDigestTest() local
87 sig = CalculateSignature(test_data, sizeof(test_data), private_key); in VerifyDigestTest()
91 TEST_NEQ(sig && rsa && digest, 0, "VerifyData() prerequisites"); in VerifyDigestTest()
92 if (!sig || !rsa || !digest) in VerifyDigestTest()
95 TEST_EQ(VerifyDigest(digest, sig, rsa), 0, "VerifyDigest() ok"); in VerifyDigestTest()
97 GetSignatureData(sig)[0] ^= 0x5A; in VerifyDigestTest() local
98 TEST_EQ(VerifyDigest(digest, sig, rsa), 1, "VerifyDigest() wrong sig"); in VerifyDigestTest()
100 sig->sig_size = 1; in VerifyDigestTest()
101 TEST_EQ(VerifyDigest(digest, sig, rsa), 1, "VerifyDigest() sig size"); in VerifyDigestTest()
104 free(sig); in VerifyDigestTest()
111 VbSignature *sig = CalculateSignature((const uint8_t *)h, in ReSignKernelPreamble() local
114 SignatureCopy(&h->preamble_signature, sig); in ReSignKernelPreamble()
115 free(sig); in ReSignKernelPreamble()