]>
Commit | Line | Data |
---|---|---|
30fdf114 LG |
1 | /** @file\r |
2 | This file declares GUIDed section extraction protocol.\r | |
3 | \r | |
f7496d71 | 4 | This interface provides a means of decoding a GUID defined encapsulation\r |
30fdf114 LG |
5 | section. There may be multiple different GUIDs associated with the GUIDed\r |
6 | section extraction protocol. That is, all instances of the GUIDed section\r | |
7 | extraction protocol must have the same interface structure.\r | |
f7496d71 | 8 | \r |
97fa0ee9 YL |
9 | @par Revision Reference: PI\r |
10 | Version 1.00.\r | |
f7496d71 LG |
11 | \r |
12 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
30fdf114 LG |
13 | \r |
14 | This program and the accompanying materials are licensed and made available\r | |
15 | under the terms and conditions of the BSD License which accompanies this\r | |
97fa0ee9 YL |
16 | distribution. The full text of the license may be found at\r |
17 | http://opensource.org/licenses/bsd-license.php\r | |
30fdf114 LG |
18 | \r |
19 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
20 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
21 | \r | |
30fdf114 LG |
22 | **/\r |
23 | \r | |
24 | #ifndef __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__\r | |
25 | #define __EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__\r | |
26 | \r | |
27 | //\r | |
28 | // Forward reference for pure ANSI compatability\r | |
29 | \r | |
30 | typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;\r | |
31 | \r | |
32 | \r | |
33 | /**\r | |
34 | The ExtractSection() function processes the input section and\r | |
35 | allocates a buffer from the pool in which it returns the section\r | |
36 | contents. If the section being extracted contains\r | |
37 | authentication information (the section's\r | |
38 | GuidedSectionHeader.Attributes field has the\r | |
39 | EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values\r | |
40 | returned in AuthenticationStatus must reflect the results of\r | |
41 | the authentication operation. Depending on the algorithm and\r | |
42 | size of the encapsulated data, the time that is required to do\r | |
43 | a full authentication may be prohibitively long for some\r | |
44 | classes of systems. To indicate this, use\r | |
45 | EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by\r | |
46 | the security policy driver (see the Platform Initialization\r | |
47 | Driver Execution Environment Core Interface Specification for\r | |
48 | more details and the GUID definition). If the\r | |
49 | EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle\r | |
50 | database, then, if possible, full authentication should be\r | |
51 | skipped and the section contents simply returned in the\r | |
52 | OutputBuffer. In this case, the\r | |
53 | EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus\r | |
54 | must be set on return. ExtractSection() is callable only from\r | |
55 | TPL_NOTIFY and below. Behavior of ExtractSection() at any\r | |
56 | EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is\r | |
57 | defined in RaiseTPL() in the UEFI 2.0 specification.\r | |
58 | \r | |
f7496d71 | 59 | \r |
30fdf114 LG |
60 | @param This Indicates the\r |
61 | EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.\r | |
f7496d71 | 62 | \r |
30fdf114 LG |
63 | @param InputSection Buffer containing the input GUIDed section\r |
64 | to be processed. OutputBuffer OutputBuffer\r | |
65 | is allocated from boot services pool\r | |
66 | memory and contains the new section\r | |
67 | stream. The caller is responsible for\r | |
68 | freeing this buffer.\r | |
69 | \r | |
70 | @param OutputSize A pointer to a caller-allocated UINTN in\r | |
71 | which the size of OutputBuffer allocation\r | |
72 | is stored. If the function returns\r | |
73 | anything other than EFI_SUCCESS, the value\r | |
74 | of OutputSize is undefined.\r | |
75 | \r | |
76 | @param AuthenticationStatus A pointer to a caller-allocated\r | |
77 | UINT32 that indicates the\r | |
78 | authentication status of the\r | |
79 | output buffer. If the input\r | |
80 | section's\r | |
81 | GuidedSectionHeader.Attributes\r | |
82 | field has the\r | |
83 | EFI_GUIDED_SECTION_AUTH_STATUS_VAL\r | |
84 | bit as clear, AuthenticationStatus\r | |
85 | must return zero. Both local bits\r | |
86 | (19:16) and aggregate bits (3:0)\r | |
87 | in AuthenticationStatus are\r | |
88 | returned by ExtractSection().\r | |
89 | These bits reflect the status of\r | |
90 | the extraction operation. The bit\r | |
91 | pattern in both regions must be\r | |
92 | the same, as the local and\r | |
93 | aggregate authentication statuses\r | |
94 | have equivalent meaning at this\r | |
95 | level. If the function returns\r | |
96 | anything other than EFI_SUCCESS,\r | |
97 | the value of AuthenticationStatus\r | |
98 | is undefined.\r | |
99 | \r | |
100 | \r | |
101 | @retval EFI_SUCCESS The InputSection was successfully\r | |
102 | processed and the section contents were\r | |
103 | returned.\r | |
104 | \r | |
105 | @retval EFI_OUT_OF_RESOURCES The system has insufficient\r | |
106 | resources to process the\r | |
107 | request.\r | |
108 | \r | |
109 | @retval EFI_INVALID_PARAMETER The GUID in InputSection does\r | |
110 | not match this instance of the\r | |
111 | GUIDed Section Extraction\r | |
112 | Protocol.\r | |
113 | \r | |
114 | **/\r | |
115 | typedef\r | |
116 | EFI_STATUS\r | |
117 | (EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(\r | |
118 | IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,\r | |
119 | IN CONST VOID *InputSection,\r | |
120 | OUT VOID **OutputBuffer,\r | |
121 | OUT UINTN *OutputSize,\r | |
122 | OUT UINT32 *AuthenticationStatus\r | |
123 | );\r | |
124 | \r | |
125 | \r | |
126 | /**\r | |
f7496d71 | 127 | \r |
30fdf114 LG |
128 | Takes the GUIDed section as input and produces the section\r |
129 | stream data. See the ExtractSection() function description.\r | |
130 | \r | |
131 | **/\r | |
132 | struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {\r | |
133 | EFI_EXTRACT_GUIDED_SECTION ExtractSection;\r | |
134 | };\r | |
135 | \r | |
136 | //\r | |
137 | // Protocol GUID definition. Each GUIDed section extraction protocol has the\r | |
138 | // same interface but with different GUID. All the GUIDs is defined here.\r | |
139 | // May add multiple GUIDs here.\r | |
140 | //\r | |
141 | #define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \\r | |
142 | { \\r | |
143 | 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \\r | |
144 | }\r | |
145 | \r | |
146 | //\r | |
147 | // may add other GUID here\r | |
148 | //\r | |
149 | extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;\r | |
150 | \r | |
151 | #endif\r |