suricata
util-decode-der.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Asn1ElementType_
 
struct  Asn1Generic_
 

Macros

#define ASN1_CLASS_UNIVERSAL   0
 
#define ASN1_CLASS_APPLICATION   1
 
#define ASN1_CLASS_CONTEXTSPEC   2
 
#define ASN1_CLASS_PRIVATE   3
 
#define ASN1_UNKNOWN   0
 
#define ASN1_BOOLEAN   0x01
 
#define ASN1_INTEGER   0x02
 
#define ASN1_BITSTRING   0x03
 
#define ASN1_OCTETSTRING   0x04
 
#define ASN1_NULL   0x05
 
#define ASN1_OID   0x06
 
#define ASN1_UTF8STRING   0x0c
 
#define ASN1_SEQUENCE   0x10
 
#define ASN1_SET   0x11
 
#define ASN1_PRINTSTRING   0x13
 
#define ASN1_T61STRING   0x14
 
#define ASN1_IA5STRING   0x16
 
#define ASN1_UTCTIME   0x17
 
#define ASN1_GENERALIZEDTIME   0x18
 
#define ERR_DER_GENERIC   0x01
 
#define ERR_DER_UNKNOWN_ELEMENT   0x02
 
#define ERR_DER_ELEMENT_SIZE_TOO_BIG   0x03
 
#define ERR_DER_INVALID_SIZE   0x04
 
#define ERR_DER_UNSUPPORTED_STRING   0x05
 
#define ERR_DER_MISSING_ELEMENT   0x06
 
#define ERR_DER_RECURSION_LIMIT   0x07
 
#define ERR_DER_INVALID_TAG   0x08
 
#define ERR_DER_INVALID_OBJECT   0x09
 

Typedefs

typedef struct Asn1Generic_ Asn1Generic
 

Functions

struct Asn1ElementType_ __attribute__ ((packed)) Asn1ElementType
 DNP3 application object header. More...
 
Asn1GenericDecodeDer (const unsigned char *buffer, uint32_t size, uint32_t *errcode) __attribute__((nonnull))
 
void DerFree (Asn1Generic *a)
 

Variables

uint8_t cls
 
uint8_t pc
 
uint8_t tag
 

Detailed Description

Macro Definition Documentation

#define ASN1_BITSTRING   0x03

Definition at line 46 of file util-decode-der.h.

#define ASN1_BOOLEAN   0x01

Definition at line 44 of file util-decode-der.h.

#define ASN1_CLASS_APPLICATION   1

Definition at line 39 of file util-decode-der.h.

#define ASN1_CLASS_CONTEXTSPEC   2

Definition at line 40 of file util-decode-der.h.

Referenced by Asn1DerGet().

#define ASN1_CLASS_PRIVATE   3

Definition at line 41 of file util-decode-der.h.

#define ASN1_CLASS_UNIVERSAL   0

Definition at line 38 of file util-decode-der.h.

#define ASN1_GENERALIZEDTIME   0x18

Definition at line 57 of file util-decode-der.h.

Referenced by Asn1DerGetValidity().

#define ASN1_IA5STRING   0x16

Definition at line 55 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ASN1_INTEGER   0x02

Definition at line 45 of file util-decode-der.h.

Referenced by Asn1DerGetSerial().

#define ASN1_NULL   0x05

Definition at line 48 of file util-decode-der.h.

#define ASN1_OCTETSTRING   0x04

Definition at line 47 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ASN1_OID   0x06

Definition at line 49 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ASN1_PRINTSTRING   0x13

Definition at line 53 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ASN1_SEQUENCE   0x10

Definition at line 51 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), Asn1DerGetSubjectDN(), and Asn1DerGetValidity().

#define ASN1_SET   0x11

Definition at line 52 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ASN1_T61STRING   0x14

Definition at line 54 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ASN1_UNKNOWN   0

Definition at line 43 of file util-decode-der.h.

#define ASN1_UTCTIME   0x17

Definition at line 56 of file util-decode-der.h.

Referenced by Asn1DerGetValidity().

#define ASN1_UTF8STRING   0x0c

Definition at line 50 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), and Asn1DerGetSubjectDN().

#define ERR_DER_ELEMENT_SIZE_TOO_BIG   0x03

Definition at line 86 of file util-decode-der.h.

Referenced by SSLVersionToString().

#define ERR_DER_GENERIC   0x01

Definition at line 82 of file util-decode-der.h.

Referenced by SSLVersionToString().

#define ERR_DER_INVALID_OBJECT   0x09

Definition at line 98 of file util-decode-der.h.

Referenced by SSLVersionToString().

#define ERR_DER_INVALID_SIZE   0x04

Definition at line 88 of file util-decode-der.h.

Referenced by DecodeDer(), and SSLVersionToString().

#define ERR_DER_INVALID_TAG   0x08

Definition at line 96 of file util-decode-der.h.

Referenced by SSLVersionToString().

#define ERR_DER_MISSING_ELEMENT   0x06
#define ERR_DER_RECURSION_LIMIT   0x07

Definition at line 94 of file util-decode-der.h.

Referenced by SSLVersionToString().

#define ERR_DER_UNKNOWN_ELEMENT   0x02

Definition at line 84 of file util-decode-der.h.

Referenced by DecodeDer(), and SSLVersionToString().

#define ERR_DER_UNSUPPORTED_STRING   0x05

Definition at line 90 of file util-decode-der.h.

Referenced by Asn1DerGetIssuerDN(), Asn1DerGetSubjectDN(), and SSLVersionToString().

Typedef Documentation

typedef struct Asn1Generic_ Asn1Generic

Function Documentation

struct Asn1ElementType_ __attribute__ ( (packed)  )

DNP3 application object header.

Definition at line 53 of file source-erf-file.c.

Asn1Generic* DecodeDer ( const unsigned char *  buffer,
uint32_t  size,
uint32_t *  errcode 
)
Parameters
errcodepointer to error code variable. May not be NULL.

Definition at line 981 of file util-decode-der.c.

References BUG_ON, DEBUG_VALIDATE_BUG_ON, DecodeDer(), DerFree(), ERR_DER_INVALID_SIZE, and ERR_DER_UNKNOWN_ELEMENT.

Referenced by DecodeDer(), and SSLVersionToString().

Here is the call graph for this function:

Here is the caller graph for this function:

void DerFree ( Asn1Generic a)

Definition at line 1057 of file util-decode-der.c.

References Asn1Generic_::data, DerFree(), Asn1Generic_::next, SCFree, and Asn1Generic_::str.

Referenced by DecodeDer(), DerFree(), and SSLVersionToString().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

uint8_t cls

Definition at line 1058 of file util-decode-der.h.

uint8_t pc

Definition at line 1059 of file util-decode-der.h.

Referenced by hashlittle2(), and StatsSetUI64().

uint8_t tag

Definition at line 1060 of file util-decode-der.h.

Referenced by TagHashAddTag(), and TagTimeoutCheck().