| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include <openssl/asn1.h> |
| 5 |
|
| 6 |
#include "shared-forward.h" |
| 7 |
|
| 8 |
#define SPC_INDIRECT_DATA_OBJID "1.3.6.1.4.1.311.2.1.4" |
| 9 |
#define SPC_PE_IMAGE_DATA_OBJID "1.3.6.1.4.1.311.2.1.15" |
| 10 |
|
| 11 |
typedef struct { |
| 12 |
ASN1_OBJECT *type; |
| 13 |
ASN1_TYPE *value; |
| 14 |
} SpcAttributeTypeAndOptionalValue; |
| 15 |
|
| 16 |
DECLARE_ASN1_FUNCTIONS(SpcAttributeTypeAndOptionalValue); |
| 17 |
|
| 18 |
typedef struct { |
| 19 |
ASN1_OBJECT *algorithm; |
| 20 |
ASN1_TYPE *parameters; |
| 21 |
} AlgorithmIdentifier; |
| 22 |
|
| 23 |
DECLARE_ASN1_FUNCTIONS(AlgorithmIdentifier); |
| 24 |
|
| 25 |
typedef struct { |
| 26 |
AlgorithmIdentifier *digestAlgorithm; |
| 27 |
ASN1_OCTET_STRING *digest; |
| 28 |
} DigestInfo; |
| 29 |
|
| 30 |
DECLARE_ASN1_FUNCTIONS(DigestInfo); |
| 31 |
|
| 32 |
typedef struct { |
| 33 |
SpcAttributeTypeAndOptionalValue *data; |
| 34 |
DigestInfo *messageDigest; |
| 35 |
} SpcIndirectDataContent; |
| 36 |
|
| 37 |
DECLARE_ASN1_FUNCTIONS(SpcIndirectDataContent); |
| 38 |
|
| 39 |
typedef struct { |
| 40 |
int type; |
| 41 |
union { |
| 42 |
ASN1_BMPSTRING *unicode; |
| 43 |
ASN1_IA5STRING *ascii; |
| 44 |
} value; |
| 45 |
} SpcString; |
| 46 |
|
| 47 |
DECLARE_ASN1_FUNCTIONS(SpcString); |
| 48 |
|
| 49 |
typedef struct { |
| 50 |
ASN1_OCTET_STRING *classId; |
| 51 |
ASN1_OCTET_STRING *serializedData; |
| 52 |
} SpcSerializedObject; |
| 53 |
|
| 54 |
DECLARE_ASN1_FUNCTIONS(SpcSerializedObject); |
| 55 |
|
| 56 |
typedef struct { |
| 57 |
int type; |
| 58 |
union { |
| 59 |
ASN1_IA5STRING *url; |
| 60 |
SpcSerializedObject *moniker; |
| 61 |
SpcString *file; |
| 62 |
} value; |
| 63 |
} SpcLink; |
| 64 |
|
| 65 |
DECLARE_ASN1_FUNCTIONS(SpcLink); |
| 66 |
|
| 67 |
typedef struct { |
| 68 |
ASN1_BIT_STRING *flags; |
| 69 |
SpcLink *file; |
| 70 |
} SpcPeImageData; |
| 71 |
|
| 72 |
DECLARE_ASN1_FUNCTIONS(SpcPeImageData); |
| 73 |
|
| 74 |
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SpcIndirectDataContent*, SpcIndirectDataContent_free, NULL); |
| 75 |
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SpcLink*, SpcLink_free, NULL); |
| 76 |
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SpcPeImageData*, SpcPeImageData_free, NULL); |