12 #define asn1_test_digest_algorithm sha1_algorithm 15 #define ASN1_TEST_DIGEST_SIZE SHA1_DIGEST_SIZE 44 #define ASN1( _name, _type, _file, ... ) \ 45 static const char _name ## __file[] = _file; \ 46 static struct image _name ## __image = { \ 47 .refcnt = REF_INIT ( ref_no_free ), \ 49 .flags = ( IMAGE_STATIC | IMAGE_STATIC_NAME ), \ 50 .data = _name ## __file, \ 51 .len = sizeof ( _name ## __file ), \ 53 static struct asn1_test_digest _name ## _expected[] = { \ 56 static struct asn1_test _name = { \ 58 .image = & _name ## __image, \ 59 .expected = _name ## _expected, \ 60 .count = ( sizeof ( _name ## _expected ) / \ 61 sizeof ( _name ## _expected[0] ) ), \ 72 #define asn1_ok( test ) asn1_okx ( test, __FILE__, __LINE__ ) void asn1_okx(struct asn1_test *test, const char *file, unsigned int line)
Report ASN.1 test result.
An executable image type.
Self-test infrastructure.
struct image * image
Source image.
struct asn1_test_digest * expected
Expected digests of ASN.1 objects.
struct image_type * type
Image type.
#define ASN1_TEST_DIGEST_SIZE
Digest size used for ASN.1 tests.
uint8_t digest[ASN1_TEST_DIGEST_SIZE]
Digest value.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned int count
Number of ASN.1 objects.