HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

src/sbsign/authenticode.h

1,937 bytesGit mode 100644Download original fileLGPL-2.1-or-later

Git blob: 88897cae7aa5a52e7861cdb35f912d2a25084cf2

Lines 1–81 of 81

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
 
#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
#  error "missing libopenssl_cflags in meson dependency."
#endif
 
#include <openssl/asn1.h>
 
#include "forward.h"
 
#define SPC_INDIRECT_DATA_OBJID "1.3.6.1.4.1.311.2.1.4"
#define SPC_PE_IMAGE_DATA_OBJID "1.3.6.1.4.1.311.2.1.15"
 
typedef struct {
        ASN1_OBJECT *type;
        ASN1_TYPE *value;
} SpcAttributeTypeAndOptionalValue;
 
DECLARE_ASN1_FUNCTIONS(SpcAttributeTypeAndOptionalValue);
 
typedef struct {
        ASN1_OBJECT *algorithm;
        ASN1_TYPE *parameters;
} AlgorithmIdentifier;
 
DECLARE_ASN1_FUNCTIONS(AlgorithmIdentifier);
 
typedef struct {
        AlgorithmIdentifier *digestAlgorithm;
        ASN1_OCTET_STRING *digest;
} DigestInfo;
 
DECLARE_ASN1_FUNCTIONS(DigestInfo);
 
typedef struct {
        SpcAttributeTypeAndOptionalValue *data;
        DigestInfo *messageDigest;
} SpcIndirectDataContent;
 
DECLARE_ASN1_FUNCTIONS(SpcIndirectDataContent);
 
typedef struct {
        int type;
        union {
                ASN1_BMPSTRING *unicode;
                ASN1_IA5STRING *ascii;
        } value;
} SpcString;
 
DECLARE_ASN1_FUNCTIONS(SpcString);
 
typedef struct {
        ASN1_OCTET_STRING *classId;
        ASN1_OCTET_STRING *serializedData;
} SpcSerializedObject;
 
DECLARE_ASN1_FUNCTIONS(SpcSerializedObject);
 
typedef struct {
        int type;
        union {
                ASN1_IA5STRING *url;
                SpcSerializedObject *moniker;
                SpcString *file;
        } value;
} SpcLink;
 
DECLARE_ASN1_FUNCTIONS(SpcLink);
 
typedef struct {
        ASN1_BIT_STRING *flags;
        SpcLink *file;
} SpcPeImageData;
 
DECLARE_ASN1_FUNCTIONS(SpcPeImageData);
 
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SpcIndirectDataContent*, SpcIndirectDataContent_free, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SpcLink*, SpcLink_free, NULL);
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(SpcPeImageData*, SpcPeImageData_free, NULL);