Classes | Typedefs | Functions | Variables
asn1_test.cc File Reference
#include <limits.h>
#include <stdio.h>
#include <string>
#include <vector>
#include <gtest/gtest.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/bytestring.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include <openssl/obj.h>
#include <openssl/span.h>
#include <openssl/x509v3.h>
#include "../test/test_util.h"
#include "internal.h"
Include dependency graph for asn1_test.cc:

Go to the source code of this file.

Classes

struct  asn1_linked_list_st
 

Typedefs

typedef struct asn1_linked_list_st ASN1_LINKED_LIST
 

Functions

 ASN1_SEQUENCE (ASN1_LINKED_LIST)
 
 ASN1_SEQUENCE (IMPLICIT_CHOICE)
 
static std::string ASN1StringToStdString (const ASN1_STRING *str)
 
static std::vector< uint8_tStringToVector (const std::string &str)
 
 TEST (ASN1, GetObject)
 
 TEST (ASN1Test, ASN1Type)
 
 TEST (ASN1Test, BitString)
 
 TEST (ASN1Test, Boolean)
 
 TEST (ASN1Test, IntegerSetting)
 
 TEST (ASN1Test, InvalidASN1Type)
 
 TEST (ASN1Test, InvalidChoice)
 
 TEST (ASN1Test, InvalidMSTRING)
 
 TEST (ASN1Test, InvalidObject)
 
 TEST (ASN1Test, LargeTags)
 
 TEST (ASN1Test, MBString)
 
 TEST (ASN1Test, NegativeEnumeratedMultistring)
 
 TEST (ASN1Test, Null)
 
 TEST (ASN1Test, Pack)
 
 TEST (ASN1Test, ParseASN1Object)
 
 TEST (ASN1Test, PrintableType)
 
 TEST (ASN1Test, PrintASN1Object)
 
 TEST (ASN1Test, SerializeEmbeddedBoolean)
 
 TEST (ASN1Test, SerializeObject)
 
 TEST (ASN1Test, SetBit)
 
 TEST (ASN1Test, SetTime)
 
 TEST (ASN1Test, StringByCustomNID)
 
 TEST (ASN1Test, StringByNID)
 
 TEST (ASN1Test, StringCmp)
 
 TEST (ASN1Test, StringPrintEx)
 
 TEST (ASN1Test, StringTableSorted)
 
 TEST (ASN1Test, StringToUTF8)
 
 TEST (ASN1Test, Unpack)
 
 TEST (ASN1Test, UnusedBooleanBits)
 
template<typename T , typename U >
void TestSerialize (T obj, int(*i2d_func)(U a, uint8_t **pp), bssl::Span< const uint8_t > expected)
 

Variables

static const uint8_t kTag128 []
 
static const uint8_t kTag258 []
 
static const uint8_t kTagOverflow []
 

Typedef Documentation

◆ ASN1_LINKED_LIST

Function Documentation

◆ ASN1_SEQUENCE() [1/2]

ASN1_SEQUENCE ( ASN1_LINKED_LIST  )

◆ ASN1_SEQUENCE() [2/2]

ASN1_SEQUENCE ( IMPLICIT_CHOICE  )

◆ ASN1StringToStdString()

static std::string ASN1StringToStdString ( const ASN1_STRING str)
static

Definition at line 538 of file asn1_test.cc.

◆ StringToVector()

static std::vector<uint8_t> StringToVector ( const std::string &  str)
static

Definition at line 611 of file asn1_test.cc.

◆ TEST() [1/29]

TEST ( ASN1  ,
GetObject   
)

Definition at line 1703 of file asn1_test.cc.

◆ TEST() [2/29]

TEST ( ASN1Test  ,
ASN1Type   
)

Definition at line 207 of file asn1_test.cc.

◆ TEST() [3/29]

TEST ( ASN1Test  ,
BitString   
)

Definition at line 324 of file asn1_test.cc.

◆ TEST() [4/29]

TEST ( ASN1Test  ,
Boolean   
)

Definition at line 141 of file asn1_test.cc.

◆ TEST() [5/29]

TEST ( ASN1Test  ,
IntegerSetting   
)

Definition at line 79 of file asn1_test.cc.

◆ TEST() [6/29]

TEST ( ASN1Test  ,
InvalidASN1Type   
)

Definition at line 1387 of file asn1_test.cc.

◆ TEST() [7/29]

TEST ( ASN1Test  ,
InvalidChoice   
)

Definition at line 1359 of file asn1_test.cc.

◆ TEST() [8/29]

TEST ( ASN1Test  ,
InvalidMSTRING   
)

Definition at line 1396 of file asn1_test.cc.

◆ TEST() [9/29]

TEST ( ASN1Test  ,
InvalidObject   
)

Definition at line 1375 of file asn1_test.cc.

◆ TEST() [10/29]

TEST ( ASN1Test  ,
LargeTags   
)

Definition at line 59 of file asn1_test.cc.

◆ TEST() [11/29]

TEST ( ASN1Test  ,
MBString   
)

Definition at line 898 of file asn1_test.cc.

◆ TEST() [12/29]

TEST ( ASN1Test  ,
NegativeEnumeratedMultistring   
)

Definition at line 1327 of file asn1_test.cc.

◆ TEST() [13/29]

TEST ( ASN1Test  ,
Null   
)

Definition at line 1417 of file asn1_test.cc.

◆ TEST() [14/29]

TEST ( ASN1Test  ,
Pack   
)

Definition at line 1452 of file asn1_test.cc.

◆ TEST() [15/29]

TEST ( ASN1Test  ,
ParseASN1Object   
)

Definition at line 269 of file asn1_test.cc.

◆ TEST() [16/29]

TEST ( ASN1Test  ,
PrintableType   
)

Definition at line 1337 of file asn1_test.cc.

◆ TEST() [17/29]

TEST ( ASN1Test  ,
PrintASN1Object   
)

Definition at line 1621 of file asn1_test.cc.

◆ TEST() [18/29]

TEST ( ASN1Test  ,
SerializeEmbeddedBoolean   
)

Definition at line 187 of file asn1_test.cc.

◆ TEST() [19/29]

TEST ( ASN1Test  ,
SerializeObject   
)

Definition at line 134 of file asn1_test.cc.

◆ TEST() [20/29]

TEST ( ASN1Test  ,
SetBit   
)

Definition at line 386 of file asn1_test.cc.

◆ TEST() [21/29]

TEST ( ASN1Test  ,
SetTime   
)

Definition at line 543 of file asn1_test.cc.

◆ TEST() [22/29]

TEST ( ASN1Test  ,
StringByCustomNID   
)

Definition at line 1235 of file asn1_test.cc.

◆ TEST() [23/29]

TEST ( ASN1Test  ,
StringByNID   
)

Definition at line 1115 of file asn1_test.cc.

◆ TEST() [24/29]

TEST ( ASN1Test  ,
StringCmp   
)

Definition at line 1512 of file asn1_test.cc.

◆ TEST() [25/29]

TEST ( ASN1Test  ,
StringPrintEx   
)

Definition at line 615 of file asn1_test.cc.

◆ TEST() [26/29]

TEST ( ASN1Test  ,
StringTableSorted   
)

Definition at line 1408 of file asn1_test.cc.

◆ TEST() [27/29]

TEST ( ASN1Test  ,
StringToUTF8   
)

Definition at line 480 of file asn1_test.cc.

◆ TEST() [28/29]

TEST ( ASN1Test  ,
Unpack   
)

Definition at line 1485 of file asn1_test.cc.

◆ TEST() [29/29]

TEST ( ASN1Test  ,
UnusedBooleanBits   
)

Definition at line 254 of file asn1_test.cc.

◆ TestSerialize()

template<typename T , typename U >
void TestSerialize ( T  obj,
int(*)(U a, uint8_t **pp i2d_func,
bssl::Span< const uint8_t expected 
)

Definition at line 111 of file asn1_test.cc.

Variable Documentation

◆ kTag128

const uint8_t kTag128[]
static
Initial value:
= {
0x1f, 0x81, 0x00, 0x01, 0x00,
}

Definition at line 41 of file asn1_test.cc.

◆ kTag258

const uint8_t kTag258[]
static
Initial value:
= {
0x1f, 0x82, 0x02, 0x01, 0x00,
}

Definition at line 46 of file asn1_test.cc.

◆ kTagOverflow

const uint8_t kTagOverflow[]
static
Initial value:
= {
0x1f, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x01, 0x00,
}

Definition at line 55 of file asn1_test.cc.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:03