suricata
util-decode-asn1.h File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <limits.h>
#include <ctype.h>
#include <string.h>
Include dependency graph for util-decode-asn1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Asn1Len_
 
struct  Asn1Id_
 
struct  Asn1Data_
 
struct  Asn1Node_
 
struct  Asn1Ctx_
 

Macros

#define ASN1_MAX_FRAMES   256
 
#define ASN1_BER_CLASS_UNIV   0
 
#define ASN1_BER_CLASS_APP   1
 
#define ASN1_BER_CLASS_CTX_SPECIFIC   2
 
#define ASN1_BER_CLASS_PRIV   3
 
#define ASN1_BER_GET_CLASS_TAG(id_octet)   ((id_octet >> 6) & 0x03) /* (8.1.2.2a) */
 
#define ASN1_BER_IS_CONSTRUCTED(id_octet)   ((id_octet >> 5) & 0x01) /* (8.1.2.5) Constructed Tag */
 
#define ASN1_BER_IS_PRIMITIVE(id_octet)   (((id_octet >> 5) & 0x01)?0:1) /* (8.1.2.5) Primitive Tag */
 
#define ASN1_BER_IS_LOW_TAG(id_octet)
 
#define ASN1_BER_GET_LOW_TAG_NUM(id_octet)   (id_octet & 0x1F) /* (8.1.2.2c) Get LowTag Number */
 
#define ASN1_BER_IS_HIGH_TAG(id_octet)
 
#define ASN1_BER_IS_HIGH_TAG_END(id_octet)   ( !((id_octet >> 7) & 0x01)) /* (8.1.2.4) Is End of Tag Num */
 
#define ASN1_BER_GET_HIGH_TAG_NUM(id_octet)
 
#define ASN1_BER_IS_SHORT_LEN(id_octet)   ( !((id_octet >> 7) & 0x01)) /* (8.1.3.3) Is short form */
 
#define ASN1_BER_GET_SHORT_LEN(id_octet)   (id_octet & 0x7F) /* (8.1.3.3) length value */
 
#define ASN1_BER_GET_LONG_LEN_OCTETS(id_octet)
 
#define ASN1_BER_GET_LONG_LEN(id_octet)   (id_octet) /* (8.1.3.5) the byte itself*/
 
#define ASN1_BER_LONG_LEN_HAS_NEXT(id_octet)
 
#define ASN1_BER_IS_INDEFINITE_LEN(id_octet)   (id_octet == 0x80) /* (8.1.3.6) Need end-of-ccontent */
 
#define ASN1_BER_IS_EOC(tmp_iter)   (*tmp_iter == 0 && *(tmp_iter + 1) == 0)
 
#define ASN1CTX_CUR_NODE(ac)   (ac->asn1_stack[ac->cur_frame])
 
#define ASN1CTX_GET_NODE(ac, node)   (ac->asn1_stack[node])
 
#define ASN1_UNITAG_EOC   0 /* EOC */
 
#define ASN1_UNITAG_BOOLEAN   1
 
#define ASN1_UNITAG_INTEGER   2
 
#define ASN1_UNITAG_BIT_STRING   3
 
#define ASN1_UNITAG_OCTET_STRING   4
 
#define ASN1_UNITAG_NULL   5
 
#define ASN1_UNITAG_OID   6
 
#define ASN1_UNITAG_OBJECT_DESCRIPTOR   7
 
#define ASN1_UNITAG_EXTERNAL   8
 
#define ASN1_UNITAG_REAL   9
 
#define ASN1_UNITAG_ENUMERATED   10
 
#define ASN1_UNITAG_EMBEDDED_PDV   11
 
#define ASN1_UNITAG_UTF8_STRING   12
 
#define ASN1_UNITAG_RELATIVE_OID   13
 
#define ASN1_UNITAG_SEQUENCE   16
 
#define ASN1_UNITAG_SET   17
 
#define ASN1_UNITAG_NUMERIC_STRING   18
 
#define ASN1_UNITAG_PRINTABLE_STRING   19
 
#define ASN1_UNITAG_TELETEX_STRING   20
 
#define ASN1_UNITAG_VIDEOTEX_STRING   21
 
#define ASN1_UNITAG_IA5_STRING   22
 
#define ASN1_UNITAG_UTCTIME   23
 
#define ASN1_UNITAG_GENERALIZED_TIME   24
 
#define ASN1_UNITAG_GRAPHIC_STRING   25
 
#define ASN1_UNITAG_VISIBLE_STRING   26
 
#define ASN1_UNITAG_GENERAL_STRING   27
 
#define ASN1_UNITAG_UNIVERSAL_STRING   28
 
#define ASN1_UNITAG_CHARACTER_STRING   29
 
#define ASN1_UNITAG_BMP_STRING   30
 
#define ASN1_BER_LEN_SHORT   0
 
#define ASN1_BER_LEN_LONG   1
 
#define ASN1_BER_LEN_INDEFINITE   2
 
#define ASN1_BER_EVENT_ID_TOO_LONG   0x01
 
#define ASN1_BER_EVENT_INVALID_ID
 
#define ASN1_BER_EVENT_INVALID_LEN
 
#define ASN1_BER_EVENT_LEN_TOO_LONG   0x08
 
#define ASN1_BER_EVENT_EOC_NOT_FOUND   0x10 /* EOC not found */
 
#define ASN1_NODE_IS_EOC   1
 
#define ASN1_TAG_TYPE_PRIMITIVE   0
 
#define ASN1_TAG_TYPE_CONSTRUCTED   1
 
#define ASN1_PARSER_OK   0x01 /* Everything ok */
 
#define ASN1_PARSER_ERR   0x02 /* Internal error, fatal error, we can't continue decoding */
 
#define ASN1_STATUS_OK   0x00 /* On the road */
 
#define ASN1_STATUS_INVALID   0x01 /* We found something weird/invalid by the specification, but we can try to continue parsing */
 
#define ASN1_STATUS_OOB   0x02 /* We don't have enough data or ran out of bounds */
 
#define ASN1_STATUS_DONE   0x04 /* We have finished cleanly */
 

Typedefs

typedef struct Asn1Len_ Asn1Len
 
typedef struct Asn1Id_ Asn1Id
 
typedef struct Asn1Data_ Asn1Data
 
typedef struct Asn1Node_ Asn1Node
 
typedef struct Asn1Ctx_ Asn1Ctx
 

Enumerations

enum  { ASN1_BER_ENC, ASN1_ENC_UNKNOWN }
 

Functions

void SCPrintByteBin (uint8_t)
 Helper function that print the bits of a byte to check encoding internals. More...
 
Asn1CtxSCAsn1CtxNew (void)
 Create a new ASN1 Parsing context. More...
 
void SCAsn1CtxInit (Asn1Ctx *, uint8_t *, uint16_t)
 Initialize the data of the ASN1 parser ctx with the asn1 raw buffer. More...
 
void SCAsn1CtxDestroy (Asn1Ctx *)
 Destroy an ASN1 Parsing context. More...
 
uint8_t SCAsn1Decode (Asn1Ctx *, uint16_t)
 Decode the nodes/frames located at certain position/level. More...
 
uint8_t SCAsn1DecodeIdentifier (Asn1Ctx *)
 Decode and check the identifier information of the current node that we are parsing, also check invalid opts. More...
 
uint8_t SCAsn1DecodeLength (Asn1Ctx *)
 Decode and check the length, of the current node that we are parsing, also check invalid opts. More...
 
uint8_t SCAsn1DecodeContent (Asn1Ctx *)
 Check the content length and perform other inspections and decodings if necessary. More...
 
uint8_t SCAsn1CheckBounds (Asn1Ctx *)
 check if we have remaining data available, otherwise the parser should stop More...
 
void DecodeAsn1RegisterTests (void)
 
void SCAsn1LoadConfig (void)
 

Detailed Description

Author
Pablo Rincon Crespo pablo.nosp@m..rin.nosp@m.con.c.nosp@m.resp.nosp@m.o@gma.nosp@m.il.c.nosp@m.om

Implements ASN1 decoding (needed for the asn1 keyword)

Definition in file util-decode-asn1.h.

Macro Definition Documentation

#define ASN1_BER_CLASS_APP   1

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

#define ASN1_BER_CLASS_CTX_SPECIFIC   2

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

#define ASN1_BER_CLASS_PRIV   3

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

#define ASN1_BER_CLASS_UNIV   0

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

Referenced by DetectAsn1Register().

#define ASN1_BER_EVENT_EOC_NOT_FOUND   0x10 /* EOC not found */

Definition at line 141 of file util-decode-asn1.h.

Referenced by SCAsn1Decode(), and SCAsn1DecodeLength().

#define ASN1_BER_EVENT_ID_TOO_LONG   0x01

Definition at line 133 of file util-decode-asn1.h.

Referenced by SCAsn1LoadConfig().

#define ASN1_BER_EVENT_INVALID_ID
Value:
0x02 /* (8.1.2.4.2c) First subsequent
id val (from bit 7 to 0) Shall
not be 0 */

Definition at line 134 of file util-decode-asn1.h.

Referenced by SCAsn1Decode(), and SCAsn1LoadConfig().

#define ASN1_BER_EVENT_INVALID_LEN
Value:
0x04 /* (8.1.3.2a) we expect a simple
form, or (8.1.3.5c) we got
0xFF, or not enough data */

Definition at line 137 of file util-decode-asn1.h.

Referenced by SCAsn1Decode(), and SCAsn1LoadConfig().

#define ASN1_BER_EVENT_LEN_TOO_LONG   0x08

Definition at line 140 of file util-decode-asn1.h.

Referenced by SCAsn1LoadConfig().

#define ASN1_BER_GET_CLASS_TAG (   id_octet)    ((id_octet >> 6) & 0x03) /* (8.1.2.2a) */

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

Referenced by SCAsn1DecodeIdentifier().

#define ASN1_BER_GET_HIGH_TAG_NUM (   id_octet)
Value:
(id_octet & 0x7F) /* (8.1.2.4) Part of High Tag
Number */

Definition at line 70 of file util-decode-asn1.h.

Referenced by SCAsn1LoadConfig().

#define ASN1_BER_GET_LONG_LEN (   id_octet)    (id_octet) /* (8.1.3.5) the byte itself*/

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

#define ASN1_BER_GET_LONG_LEN_OCTETS (   id_octet)
Value:
(id_octet & 0x7F) /* (8.1.3.5) the number of
bytes */

Definition at line 79 of file util-decode-asn1.h.

Referenced by SCAsn1LoadConfig().

#define ASN1_BER_GET_LOW_TAG_NUM (   id_octet)    (id_octet & 0x1F) /* (8.1.2.2c) Get LowTag Number */

Definition at line 61 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeIdentifier().

#define ASN1_BER_GET_SHORT_LEN (   id_octet)    (id_octet & 0x7F) /* (8.1.3.3) length value */

Definition at line 77 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeLength().

#define ASN1_BER_IS_CONSTRUCTED (   id_octet)    ((id_octet >> 5) & 0x01) /* (8.1.2.5) Constructed Tag */

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

Referenced by SCAsn1DecodeIdentifier().

#define ASN1_BER_IS_EOC (   tmp_iter)    (*tmp_iter == 0 && *(tmp_iter + 1) == 0)

Definition at line 89 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeLength().

#define ASN1_BER_IS_HIGH_TAG (   id_octet)
Value:
((ASN1_BER_GET_LOW_TAG_NUM(id_octet) == 0x1F) && \
ASN1_BER_IS_CONSTRUCTED(id_octet)) /* (8.1.2.4) High Tag Number */
#define ASN1_BER_IS_CONSTRUCTED(id_octet)
#define ASN1_BER_GET_LOW_TAG_NUM(id_octet)

Definition at line 65 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeIdentifier().

#define ASN1_BER_IS_HIGH_TAG_END (   id_octet)    ( !((id_octet >> 7) & 0x01)) /* (8.1.2.4) Is End of Tag Num */

Definition at line 68 of file util-decode-asn1.h.

Referenced by SCAsn1LoadConfig().

#define ASN1_BER_IS_INDEFINITE_LEN (   id_octet)    (id_octet == 0x80) /* (8.1.3.6) Need end-of-ccontent */

Definition at line 87 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeLength().

#define ASN1_BER_IS_LOW_TAG (   id_octet)
Value:
ASN1_BER_IS_PRIMITIVE(id_octet) /* (8.1.2.5) Is Low Tag
Number */
#define ASN1_BER_IS_PRIMITIVE(id_octet)

Definition at line 58 of file util-decode-asn1.h.

#define ASN1_BER_IS_PRIMITIVE (   id_octet)    (((id_octet >> 5) & 0x01)?0:1) /* (8.1.2.5) Primitive Tag */

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

#define ASN1_BER_IS_SHORT_LEN (   id_octet)    ( !((id_octet >> 7) & 0x01)) /* (8.1.3.3) Is short form */

Definition at line 75 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeLength().

#define ASN1_BER_LEN_INDEFINITE   2

Definition at line 129 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeContent(), and SCAsn1DecodeLength().

#define ASN1_BER_LEN_LONG   1

Definition at line 128 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeLength().

#define ASN1_BER_LEN_SHORT   0

Definition at line 127 of file util-decode-asn1.h.

Referenced by SCAsn1DecodeLength().

#define ASN1_BER_LONG_LEN_HAS_NEXT (   id_octet)
Value:
( !((id_octet >> 7) & 0x01)) /* (8.1.3.5) Has next octets
lenght */

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

#define ASN1_MAX_FRAMES   256

Definition at line 37 of file util-decode-asn1.h.

#define ASN1_NODE_IS_EOC   1

Definition at line 145 of file util-decode-asn1.h.

Referenced by SCAsn1Decode(), SCAsn1DecodeContent(), and SCAsn1DecodeLength().

#define ASN1_PARSER_ERR   0x02 /* Internal error, fatal error, we can't continue decoding */
#define ASN1_PARSER_OK   0x01 /* Everything ok */
#define ASN1_STATUS_DONE   0x04 /* We have finished cleanly */

Definition at line 201 of file util-decode-asn1.h.

Referenced by SCAsn1Decode().

#define ASN1_STATUS_INVALID   0x01 /* We found something weird/invalid by the specification, but we can try to continue parsing */
#define ASN1_STATUS_OK   0x00 /* On the road */

Definition at line 198 of file util-decode-asn1.h.

Referenced by SCAsn1CtxInit().

#define ASN1_STATUS_OOB   0x02 /* We don't have enough data or ran out of bounds */
#define ASN1_TAG_TYPE_CONSTRUCTED   1

Definition at line 147 of file util-decode-asn1.h.

Referenced by SCAsn1Decode().

#define ASN1_TAG_TYPE_PRIMITIVE   0

Definition at line 146 of file util-decode-asn1.h.

Referenced by DetectAsn1Register().

#define ASN1_UNITAG_BIT_STRING   3

Definition at line 99 of file util-decode-asn1.h.

Referenced by DetectAsn1Register().

#define ASN1_UNITAG_BMP_STRING   30

Definition at line 124 of file util-decode-asn1.h.

#define ASN1_UNITAG_BOOLEAN   1

Definition at line 97 of file util-decode-asn1.h.

#define ASN1_UNITAG_CHARACTER_STRING   29

Definition at line 123 of file util-decode-asn1.h.

#define ASN1_UNITAG_EMBEDDED_PDV   11

Definition at line 107 of file util-decode-asn1.h.

#define ASN1_UNITAG_ENUMERATED   10

Definition at line 106 of file util-decode-asn1.h.

#define ASN1_UNITAG_EOC   0 /* EOC */

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

#define ASN1_UNITAG_EXTERNAL   8

Definition at line 104 of file util-decode-asn1.h.

#define ASN1_UNITAG_GENERAL_STRING   27

Definition at line 121 of file util-decode-asn1.h.

#define ASN1_UNITAG_GENERALIZED_TIME   24

Definition at line 118 of file util-decode-asn1.h.

#define ASN1_UNITAG_GRAPHIC_STRING   25

Definition at line 119 of file util-decode-asn1.h.

#define ASN1_UNITAG_IA5_STRING   22

Definition at line 116 of file util-decode-asn1.h.

#define ASN1_UNITAG_INTEGER   2

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

#define ASN1_UNITAG_NULL   5

Definition at line 101 of file util-decode-asn1.h.

#define ASN1_UNITAG_NUMERIC_STRING   18

Definition at line 112 of file util-decode-asn1.h.

#define ASN1_UNITAG_OBJECT_DESCRIPTOR   7

Definition at line 103 of file util-decode-asn1.h.

#define ASN1_UNITAG_OCTET_STRING   4

Definition at line 100 of file util-decode-asn1.h.

#define ASN1_UNITAG_OID   6

Definition at line 102 of file util-decode-asn1.h.

#define ASN1_UNITAG_PRINTABLE_STRING   19

Definition at line 113 of file util-decode-asn1.h.

#define ASN1_UNITAG_REAL   9

Definition at line 105 of file util-decode-asn1.h.

Referenced by DetectAsn1Register().

#define ASN1_UNITAG_RELATIVE_OID   13

Definition at line 109 of file util-decode-asn1.h.

#define ASN1_UNITAG_SEQUENCE   16

Definition at line 110 of file util-decode-asn1.h.

#define ASN1_UNITAG_SET   17

Definition at line 111 of file util-decode-asn1.h.

#define ASN1_UNITAG_TELETEX_STRING   20

Definition at line 114 of file util-decode-asn1.h.

#define ASN1_UNITAG_UNIVERSAL_STRING   28

Definition at line 122 of file util-decode-asn1.h.

#define ASN1_UNITAG_UTCTIME   23

Definition at line 117 of file util-decode-asn1.h.

#define ASN1_UNITAG_UTF8_STRING   12

Definition at line 108 of file util-decode-asn1.h.

#define ASN1_UNITAG_VIDEOTEX_STRING   21

Definition at line 115 of file util-decode-asn1.h.

#define ASN1_UNITAG_VISIBLE_STRING   26

Definition at line 120 of file util-decode-asn1.h.

#define ASN1CTX_CUR_NODE (   ac)    (ac->asn1_stack[ac->cur_frame])
#define ASN1CTX_GET_NODE (   ac,
  node 
)    (ac->asn1_stack[node])

Definition at line 93 of file util-decode-asn1.h.

Referenced by DetectAsn1Register(), SCAsn1CtxDestroy(), and SCAsn1Decode().

Typedef Documentation

typedef struct Asn1Ctx_ Asn1Ctx
typedef struct Asn1Data_ Asn1Data
typedef struct Asn1Id_ Asn1Id
typedef struct Asn1Len_ Asn1Len
typedef struct Asn1Node_ Asn1Node

Enumeration Type Documentation

anonymous enum
Enumerator
ASN1_BER_ENC 
ASN1_ENC_UNKNOWN 

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

Function Documentation

void DecodeAsn1RegisterTests ( void  )

Definition at line 888 of file util-decode-asn1.c.

References UtRegisterTest().

Here is the call graph for this function:

uint8_t SCAsn1CheckBounds ( Asn1Ctx ac)

check if we have remaining data available, otherwise the parser should stop

Parameters
acAsn1Ctx pointer initialized
Return values
1if we are out of bounds, 0 if not

Definition at line 335 of file util-decode-asn1.c.

References ASN1_PARSER_ERR, ASN1_PARSER_OK, Asn1Ctx_::data, Asn1Ctx_::end, and Asn1Ctx_::iter.

Referenced by SCAsn1Decode(), SCAsn1DecodeIdentifier(), SCAsn1DecodeLength(), and SCAsn1LoadConfig().

Here is the caller graph for this function:

void SCAsn1CtxDestroy ( Asn1Ctx ac)

Destroy an ASN1 Parsing context.

Parameters
Asn1Ctxpointer to the new ctx

Definition at line 371 of file util-decode-asn1.c.

References asn1_max_frames_config, Asn1Ctx_::asn1_stack, ASN1CTX_GET_NODE, SCFree, and SCMalloc.

Referenced by DetectAsn1Register(), and SCAsn1Decode().

Here is the caller graph for this function:

void SCAsn1CtxInit ( Asn1Ctx ac,
uint8_t *  data,
uint16_t  length 
)

Initialize the data of the ASN1 parser ctx with the asn1 raw buffer.

Parameters
acpointer to the ASN1 ctx
datapointer to the data to process (binary raw of asn1)
lengthlength of the asn1 raw buffer
Return values
void

Definition at line 422 of file util-decode-asn1.c.

References ASN1_STATUS_OK, Asn1Ctx_::data, Asn1Ctx_::end, Asn1Ctx_::iter, Asn1Ctx_::len, length, and Asn1Ctx_::parser_status.

Referenced by DetectAsn1Register(), and SCAsn1Decode().

Here is the caller graph for this function:

Asn1Ctx* SCAsn1CtxNew ( void  )

Create a new ASN1 Parsing context.

Return values
Asn1Ctxpointer to the new ctx

Definition at line 346 of file util-decode-asn1.c.

References asn1_max_frames_config, Asn1Ctx_::asn1_stack, SC_ERR_MEM_ALLOC, SCFree, SCLogError, SCMalloc, and unlikely.

Referenced by DetectAsn1Register(), and SCAsn1Decode().

Here is the caller graph for this function:

uint8_t SCAsn1Decode ( Asn1Ctx ac,
uint16_t  node_id 
)
uint8_t SCAsn1DecodeContent ( Asn1Ctx ac)

Check the content length and perform other inspections and decodings if necessary.

Parameters
acpointer to the ASN1 Context data
Return values
byteof the status of the parser

Definition at line 175 of file util-decode-asn1.c.

References ASN1_BER_LEN_INDEFINITE, ASN1_NODE_IS_EOC, ASN1_PARSER_OK, ASN1CTX_CUR_NODE, Asn1Node_::data, Asn1Ctx_::end, Asn1Node_::flags, Asn1Len_::form, Asn1Ctx_::iter, Asn1Len_::len, Asn1Data_::len, Asn1Node_::len, and Asn1Data_::ptr.

Referenced by SCAsn1Decode().

Here is the caller graph for this function:

uint8_t SCAsn1DecodeIdentifier ( Asn1Ctx ac)

Decode and check the identifier information of the current node that we are parsing, also check invalid opts.

Parameters
acpointer to the ASN1 Context data
Return values
byteof the status of the parser

Definition at line 285 of file util-decode-asn1.c.

References ASN1_BER_GET_CLASS_TAG, ASN1_BER_GET_LOW_TAG_NUM, ASN1_BER_IS_CONSTRUCTED, ASN1_BER_IS_HIGH_TAG, ASN1_PARSER_ERR, ASN1_PARSER_OK, ASN1_STATUS_INVALID, ASN1_STATUS_OOB, ASN1CTX_CUR_NODE, Asn1Id_::class_tag, Asn1Node_::id, Asn1Ctx_::iter, Asn1Ctx_::parser_status, Asn1Id_::ptr, SCAsn1CheckBounds(), Asn1Id_::tag_num, and Asn1Id_::tag_type.

Referenced by SCAsn1Decode().

Here is the call graph for this function:

Here is the caller graph for this function:

uint8_t SCAsn1DecodeLength ( Asn1Ctx ac)

Decode and check the length, of the current node that we are parsing, also check invalid opts.

Parameters
acpointer to the ASN1 Context data
Return values
byteof the status of the parser

Definition at line 215 of file util-decode-asn1.c.

References ASN1_BER_EVENT_EOC_NOT_FOUND, ASN1_BER_GET_SHORT_LEN, ASN1_BER_IS_EOC, ASN1_BER_IS_INDEFINITE_LEN, ASN1_BER_IS_SHORT_LEN, ASN1_BER_LEN_INDEFINITE, ASN1_BER_LEN_LONG, ASN1_BER_LEN_SHORT, ASN1_NODE_IS_EOC, ASN1_PARSER_ERR, ASN1_PARSER_OK, ASN1_STATUS_INVALID, ASN1_STATUS_OOB, ASN1CTX_CUR_NODE, Asn1Node_::data, Asn1Ctx_::end, Asn1Node_::flags, Asn1Len_::form, Asn1Node_::id, Asn1Ctx_::iter, Asn1Len_::len, Asn1Data_::len, Asn1Node_::len, Asn1Ctx_::parser_status, Asn1Len_::ptr, Asn1Id_::ptr, and SCAsn1CheckBounds().

Referenced by SCAsn1Decode().

Here is the call graph for this function:

Here is the caller graph for this function:

void SCPrintByteBin ( uint8_t  byte)

Helper function that print the bits of a byte to check encoding internals.

Parameters
bytevalue of the byte

Definition at line 318 of file util-decode-asn1.c.