/* SPDX-License-Identifier: GPL-2.0-or-later */
/* ASN.1 BER/DER/CER parsing state machine internal definitions
*
* Copyright ( C ) 2012 Red Hat , Inc . All Rights Reserved .
* Written by David Howells ( dhowells @ redhat . com )
*/
#ifndef _LINUX_ASN1_BER_BYTECODE_H
#define _LINUX_ASN1_BER_BYTECODE_H
#ifdef __KERNEL__
#include <linux/types.h>
#endif
#include <linux/asn1.h>
typedef int (*asn1_action_t)(void *context,
size_t hdrlen, /* In case of ANY type */
unsigned char tag, /* In case of ANY type */
const void *value, size_t vlen);
struct asn1_decoder {
const unsigned char *machine;
size_t machlen;
const asn1_action_t *actions;
};
enum asn1_opcode {
/* The tag-matching ops come first and the odd-numbered slots
* are for OR_SKIP ops .
*/
#define ASN1_OP_MATCH__SKIP 0 x01
#define ASN1_OP_MATCH__ACT 0 x02
#define ASN1_OP_MATCH__JUMP 0 x04
#define ASN1_OP_MATCH__ANY 0 x08
#define ASN1_OP_MATCH__COND 0 x10
ASN1_OP_MATCH = 0 x00,
ASN1_OP_MATCH_OR_SKIP = 0 x01,
ASN1_OP_MATCH_ACT = 0 x02,
ASN1_OP_MATCH_ACT_OR_SKIP = 0 x03,
ASN1_OP_MATCH_JUMP = 0 x04,
ASN1_OP_MATCH_JUMP_OR_SKIP = 0 x05,
ASN1_OP_MATCH_ANY = 0 x08,
ASN1_OP_MATCH_ANY_OR_SKIP = 0 x09,
ASN1_OP_MATCH_ANY_ACT = 0 x0a,
ASN1_OP_MATCH_ANY_ACT_OR_SKIP = 0 x0b,
/* Everything before here matches unconditionally */
ASN1_OP_COND_MATCH_OR_SKIP = 0 x11,
ASN1_OP_COND_MATCH_ACT_OR_SKIP = 0 x13,
ASN1_OP_COND_MATCH_JUMP_OR_SKIP = 0 x15,
ASN1_OP_COND_MATCH_ANY = 0 x18,
ASN1_OP_COND_MATCH_ANY_OR_SKIP = 0 x19,
ASN1_OP_COND_MATCH_ANY_ACT = 0 x1a,
ASN1_OP_COND_MATCH_ANY_ACT_OR_SKIP = 0 x1b,
/* Everything before here will want a tag from the data */
#define ASN1_OP__MATCHES_TAG ASN1_OP_COND_MATCH_ANY_ACT_OR_SKIP
/* These are here to help fill up space */
ASN1_OP_COND_FAIL = 0 x1c,
ASN1_OP_COMPLETE = 0 x1d,
ASN1_OP_ACT = 0 x1e,
ASN1_OP_MAYBE_ACT = 0 x1f,
/* The following eight have bit 0 -> SET, 1 -> OF, 2 -> ACT */
ASN1_OP_END_SEQ = 0 x20,
ASN1_OP_END_SET = 0 x21,
ASN1_OP_END_SEQ_OF = 0 x22,
ASN1_OP_END_SET_OF = 0 x23,
ASN1_OP_END_SEQ_ACT = 0 x24,
ASN1_OP_END_SET_ACT = 0 x25,
ASN1_OP_END_SEQ_OF_ACT = 0 x26,
ASN1_OP_END_SET_OF_ACT = 0 x27,
#define ASN1_OP_END__SET 0 x01
#define ASN1_OP_END__OF 0 x02
#define ASN1_OP_END__ACT 0 x04
ASN1_OP_RETURN = 0 x28,
ASN1_OP__NR
};
#define _tag(CLASS , CP, TAG) ((ASN1_## CLASS << 6 ) | (ASN1_## CP << 5 ) | ASN1_## TAG)
#define _tagn(CLASS , CP, TAG) ((ASN1_## CLASS << 6 ) | (ASN1_## CP << 5 ) | TAG)
#define _jump_target(N) (N)
#define _action(N) (N)
#endif /* _LINUX_ASN1_BER_BYTECODE_H */
Messung V0.5 in Prozent C=85 H=100 G=92
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-09-29)
¤
*© Formatika GbR, Deutschland