Lines Matching refs:sig2

117 	struct vb2_signature *sig2;
124 sig2 = (struct vb2_signature *)buf2;
127 TEST_SUCC(vb2_verify_signature(sig2, size), "verify_sig ok");
128 sig2->c.magic = VB2_MAGIC_PACKED_KEY;
129 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_SIG_MAGIC,
133 sig2->c.total_size += 4;
134 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_COMMON_TOTAL_SIZE,
138 sig2->c.struct_version_minor++;
139 TEST_SUCC(vb2_verify_signature(sig2, size), "verify_sig minor ver");
140 sig2->c.struct_version_major++;
141 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_SIG_VERSION,
145 sig2->c.fixed_size -= 4;
146 sig2->c.desc_size += 4;
147 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_SIG_HEADER_SIZE,
151 sig2->sig_size += 4;
152 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_COMMON_MEMBER_SIZE,
156 sig2->sig_alg = VB2_SIG_INVALID;
157 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_SIG_ALGORITHM,
161 sig2->sig_alg = (sig2->sig_alg == VB2_SIG_NONE ?
163 TEST_EQ(vb2_verify_signature(sig2, size), VB2_ERROR_SIG_SIZE,
177 struct vb2_signature *sig2;
188 sig2 = (struct vb2_signature *)buf2;
192 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
198 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
205 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
211 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
215 sig2->sig_size -= 16;
216 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
220 TEST_EQ(vb2_verify_data(test_data, test_size - 1, sig2, &pubk, &wb),
224 sig2->hash_alg = (sig2->hash_alg == VB2_HASH_SHA1 ?
226 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
232 buf2[sig2->sig_offset] ^= 0x5A;
233 TEST_EQ(vb2_verify_data(test_data, test_size, sig2, &pubk, &wb),
249 struct vb2_signature *sig2 = NULL;
270 TEST_SUCC(vb2_sign_data(&sig2, test_data, test_size, prik, ""),
274 test_verify_data(pubk, sig2);
275 test_verify_signature(sig2);
278 free(sig2);