libksba  1.6.0
About: KSBA is a library to make the tasks of working with X.509 certificates, CMS data and related objects more easy.
  Fossies Dox: libksba-1.6.0.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

der-builder.c File Reference
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "util.h"
#include "asn1-constants.h"
#include "convert.h"
#include "ber-help.h"
#include "der-builder.h"
Include dependency graph for der-builder.c:

Go to the source code of this file.

Data Structures

struct  item_s
 
struct  ksba_der_s
 

Functions

void _ksba_der_release (ksba_der_t d)
 
ksba_der_t _ksba_der_builder_new (unsigned int nitems)
 
void _ksba_der_builder_reset (ksba_der_t d)
 
static int ensure_space (ksba_der_t d)
 
void _ksba_der_add_ptr (ksba_der_t d, int class, int tag, void *value, size_t valuelen)
 
static void add_val_core (ksba_der_t d, int class, int tag, void *value, size_t valuelen, int verbatim)
 
void _ksba_der_add_val (ksba_der_t d, int class, int tag, const void *value, size_t valuelen)
 
void _ksba_der_add_oid (ksba_der_t d, const char *oidstr)
 
void _ksba_der_add_bts (ksba_der_t d, const void *value, size_t valuelen, unsigned int unusedbits)
 
void _ksba_der_add_int (ksba_der_t d, const void *value, size_t valuelen, int force_positive)
 
void _ksba_der_add_der (ksba_der_t d, const void *der, size_t derlen)
 
void _ksba_der_add_tag (ksba_der_t d, int class, int tag)
 
void _ksba_der_add_end (ksba_der_t d)
 
static unsigned int count_tl (int class, int tag, size_t length)
 
static void write_tl (unsigned char *buffer, int class, int tag, int constructed, size_t length)
 
static size_t compute_lengths (ksba_der_t d, int idx)
 
gpg_error_t _ksba_der_builder_get (ksba_der_t d, unsigned char **r_obj, size_t *r_objlen)
 

Function Documentation

◆ _ksba_der_add_bts()

void _ksba_der_add_bts ( ksba_der_t  d,
const void *  value,
size_t  valuelen,
unsigned int  unusedbits 
)

◆ _ksba_der_add_der()

void _ksba_der_add_der ( ksba_der_t  d,
const void *  der,
size_t  derlen 
)

◆ _ksba_der_add_end()

◆ _ksba_der_add_int()

void _ksba_der_add_int ( ksba_der_t  d,
const void *  value,
size_t  valuelen,
int  force_positive 
)

◆ _ksba_der_add_oid()

void _ksba_der_add_oid ( ksba_der_t  d,
const char *  oidstr 
)

◆ _ksba_der_add_ptr()

void _ksba_der_add_ptr ( ksba_der_t  d,
int  class,
int  tag,
void *  value,
size_t  valuelen 
)

◆ _ksba_der_add_tag()

◆ _ksba_der_add_val()

void _ksba_der_add_val ( ksba_der_t  d,
int  class,
int  tag,
const void *  value,
size_t  valuelen 
)

◆ _ksba_der_builder_get()

◆ _ksba_der_builder_new()

ksba_der_t _ksba_der_builder_new ( unsigned int  nitems)

◆ _ksba_der_builder_reset()

◆ _ksba_der_release()

void _ksba_der_release ( ksba_der_t  d)

◆ add_val_core()

static void add_val_core ( ksba_der_t  d,
int  class,
int  tag,
void *  value,
size_t  valuelen,
int  verbatim 
)
static

◆ compute_lengths()

◆ count_tl()

static unsigned int count_tl ( int  class,
int  tag,
size_t  length 
)
static

Definition at line 374 of file der-builder.c.

References item_s::hdrlen, item_s::tag, and TYPE_NULL.

Referenced by compute_lengths().

◆ ensure_space()

◆ write_tl()

static void write_tl ( unsigned char *  buffer,
int  class,
int  tag,
int  constructed,
size_t  length 
)
static

Definition at line 425 of file der-builder.c.

References item_s::buffer, item_s::tag, and TYPE_NULL.

Referenced by _ksba_der_builder_get().