xref: /netbsd-src/crypto/external/cpl/trousers/dist/src/include/imaem.h (revision 2d5f7628c5531eb583b9313ac2fd1cf8582b4479)
1 
2 /*
3  * Licensed Materials - Property of IBM
4  *
5  * trousers - An open source TCG Software Stack
6  *
7  * (C) Copyright International Business Machines Corp. 2004
8  *
9  */
10 
11 #ifndef _IMAEM_H_
12 #define _IMAEM_H_
13 
14 int ima_open(void *, FILE **);
15 TSS_RESULT ima_get_entries_by_pcr(FILE *, UINT32, UINT32, UINT32 *, TSS_PCR_EVENT **);
16 TSS_RESULT ima_get_entry(FILE *, UINT32, UINT32 *, TSS_PCR_EVENT **);
17 int ima_close(FILE *);
18 
19 extern struct ext_log_source ima_source;
20 
21 /*  4  bytes binary         [PCR  value]
22  * 20  bytes binary         [SHA1 value]
23  *  4  bytes binary         [event type]
24  * 255 bytes of ascii (MAX) [event name]
25  * 1   byte -> '\0'         [separator ]
26  */
27 #define IMA_MIN_EVENT_SIZE 29
28 #define IMA_MAX_EVENT_SIZE 284
29 
30 /* this should be large if we're reading out of /proc */
31 #define IMA_READ_SIZE	(4096 + IMA_MAX_EVENT_SIZE)
32 
33 #define EVLOG_SOURCE_IMA	1
34 
35 #endif
36