OpenCore
1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
libDER.h
Go to the documentation of this file.
1
/* Copyright (c) 2005-2007 Apple Inc. All Rights Reserved. */
2
3
/*
4
* libDER.h - main header for libDER, a ROM-capable DER decoding library.
5
*
6
* Created Nov. 4 2005 by dmitch
7
*/
8
9
#ifndef _LIB_DER_H_
10
#define _LIB_DER_H_
11
12
#ifdef __cplusplus
13
extern
"C"
{
14
#endif
15
16
#include "
libDER_config.h
"
17
/*
18
* Error returns generated by this library.
19
*/
20
typedef
enum
{
21
DR_Success
,
22
DR_EndOfSequence
,
/* end of sequence or set */
23
DR_UnexpectedTag
,
/* unexpected tag found while decoding */
24
DR_DecodeError
,
/* misc. decoding error (badly formatted DER) */
25
DR_Unimplemented
,
/* function not implemented in this configuration */
26
DR_IncompleteSeq
,
/* incomplete sequence */
27
DR_ParamErr
,
/* incoming parameter error */
28
DR_BufOverflow
/* buffer overflow */
29
/* etc. */
30
}
DERReturn
;
31
32
/*
33
* Primary representation of a block of memory.
34
*/
35
typedef
struct
{
36
DERByte
*
data
;
37
DERSize
length
;
38
}
DERItem
;
39
40
/*
41
* The structure of a sequence during decode or encode is expressed as
42
* an array of DERItemSpecs. While decoding or encoding a sequence,
43
* each item in the sequence corresponds to one DERItemSpec.
44
*/
45
typedef
struct
{
46
DERSize
offset
;
/* offset of destination DERItem */
47
DERTag
tag
;
/* DER tag */
48
DERShort
options
;
/* DER_DEC_xxx or DER_ENC_xxx */
49
}
DERItemSpec
;
50
51
/*
52
* Macro to obtain offset of a DERDecodedInfo within a struct.
53
* FIXME this is going to need reworking to avoid compiler warnings
54
* on 64-bit compiles. It'll work OK as long as an offset can't be larger
55
* than a DERSize, but the cast from a pointer to a DERSize may
56
* provoke compiler warnings.
57
*/
58
#define DER_OFFSET(type, field) ((DERSize)(&((type *)0)->field))
59
60
#ifdef __cplusplus
61
}
62
#endif
63
64
#endif
/* _LIB_DER_H_ */
65
DERReturn
DERReturn
Definition
libDER.h:20
DR_Success
@ DR_Success
Definition
libDER.h:21
DR_ParamErr
@ DR_ParamErr
Definition
libDER.h:27
DR_Unimplemented
@ DR_Unimplemented
Definition
libDER.h:25
DR_BufOverflow
@ DR_BufOverflow
Definition
libDER.h:28
DR_EndOfSequence
@ DR_EndOfSequence
Definition
libDER.h:22
DR_UnexpectedTag
@ DR_UnexpectedTag
Definition
libDER.h:23
DR_DecodeError
@ DR_DecodeError
Definition
libDER.h:24
DR_IncompleteSeq
@ DR_IncompleteSeq
Definition
libDER.h:26
libDER_config.h
DERSize
size_t DERSize
Definition
libDER_config.h:62
DERShort
uint16_t DERShort
Definition
libDER_config.h:61
DERTag
uint64_t DERTag
Definition
libDER_config.h:122
DERByte
uint8_t DERByte
Definition
libDER_config.h:60
DERItem
Definition
libDER.h:35
DERItem::data
DERByte * data
Definition
libDER.h:36
DERItem::length
DERSize length
Definition
libDER.h:37
DERItemSpec
Definition
libDER.h:45
DERItemSpec::tag
DERTag tag
Definition
libDER.h:47
DERItemSpec::options
DERShort options
Definition
libDER.h:48
DERItemSpec::offset
DERSize offset
Definition
libDER.h:46
Library
OcAppleImg4Lib
libDER
libDER.h
Generated by
1.12.0