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)  

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

Go to the source code of this file.

Functions

static int read_byte (ksba_reader_t reader)
 
static int premature_eof (struct tag_info *ti)
 
static gpg_error_t eof_or_error (ksba_reader_t reader, struct tag_info *ti, int premature)
 
gpg_error_t _ksba_ber_read_tl (ksba_reader_t reader, struct tag_info *ti)
 
gpg_error_t _ksba_ber_parse_tl (unsigned char const **buffer, size_t *size, struct tag_info *ti)
 
gpg_error_t _ksba_ber_write_tl (ksba_writer_t writer, unsigned long tag, enum tag_class class, int constructed, unsigned long length)
 
size_t _ksba_ber_encode_tl (unsigned char *buffer, unsigned long tag, enum tag_class class, int constructed, unsigned long length)
 
size_t _ksba_ber_count_tl (unsigned long tag, enum tag_class class, int constructed, unsigned long length)
 
gpg_error_t _ksba_parse_sequence (unsigned char const **buf, size_t *len, struct tag_info *ti)
 
gpg_error_t _ksba_parse_context_tag (unsigned char const **buf, size_t *len, struct tag_info *ti, int tag)
 
gpg_error_t _ksba_parse_enumerated (unsigned char const **buf, size_t *len, struct tag_info *ti, size_t maxlen)
 
gpg_error_t _ksba_parse_integer (unsigned char const **buf, size_t *len, struct tag_info *ti)
 
gpg_error_t _ksba_parse_octet_string (unsigned char const **buf, size_t *len, struct tag_info *ti)
 
gpg_error_t _ksba_parse_optional_boolean (unsigned char const **buf, size_t *len, int *r_bool)
 
gpg_error_t _ksba_parse_optional_null (unsigned char const **buf, size_t *len, int *r_seen)
 
gpg_error_t _ksba_parse_object_id_into_str (unsigned char const **buf, size_t *len, char **oid)
 
gpg_error_t _ksba_parse_asntime_into_isotime (unsigned char const **buf, size_t *len, ksba_isotime_t isotime)
 

Function Documentation

◆ _ksba_ber_count_tl()

size_t _ksba_ber_count_tl ( unsigned long  tag,
enum tag_class  class,
int  constructed,
unsigned long  length 
)

◆ _ksba_ber_encode_tl()

size_t _ksba_ber_encode_tl ( unsigned char *  buffer,
unsigned long  tag,
enum tag_class  class,
int  constructed,
unsigned long  length 
)

◆ _ksba_ber_parse_tl()

◆ _ksba_ber_read_tl()

◆ _ksba_ber_write_tl()

◆ _ksba_parse_asntime_into_isotime()

gpg_error_t _ksba_parse_asntime_into_isotime ( unsigned char const **  buf,
size_t *  len,
ksba_isotime_t  isotime 
)

◆ _ksba_parse_context_tag()

gpg_error_t _ksba_parse_context_tag ( unsigned char const **  buf,
size_t *  len,
struct tag_info ti,
int  tag 
)

◆ _ksba_parse_enumerated()

gpg_error_t _ksba_parse_enumerated ( unsigned char const **  buf,
size_t *  len,
struct tag_info ti,
size_t  maxlen 
)

◆ _ksba_parse_integer()

gpg_error_t _ksba_parse_integer ( unsigned char const **  buf,
size_t *  len,
struct tag_info ti 
)

◆ _ksba_parse_object_id_into_str()

gpg_error_t _ksba_parse_object_id_into_str ( unsigned char const **  buf,
size_t *  len,
char **  oid 
)

◆ _ksba_parse_octet_string()

gpg_error_t _ksba_parse_octet_string ( unsigned char const **  buf,
size_t *  len,
struct tag_info ti 
)

◆ _ksba_parse_optional_boolean()

gpg_error_t _ksba_parse_optional_boolean ( unsigned char const **  buf,
size_t *  len,
int *  r_bool 
)

◆ _ksba_parse_optional_null()

gpg_error_t _ksba_parse_optional_null ( unsigned char const **  buf,
size_t *  len,
int *  r_seen 
)

◆ _ksba_parse_sequence()

gpg_error_t _ksba_parse_sequence ( unsigned char const **  buf,
size_t *  len,
struct tag_info ti 
)

◆ eof_or_error()

static gpg_error_t eof_or_error ( ksba_reader_t  reader,
struct tag_info ti,
int  premature 
)
static

Definition at line 71 of file ber-help.c.

References tag_info::err_string, gpg_error, ksba_reader_error(), and premature_eof().

Referenced by _ksba_ber_read_tl().

◆ premature_eof()

static int premature_eof ( struct tag_info ti)
static

Definition at line 61 of file ber-help.c.

References tag_info::err_string, and gpg_error.

Referenced by _ksba_ber_parse_tl(), and eof_or_error().

◆ read_byte()

static int read_byte ( ksba_reader_t  reader)
static

Definition at line 47 of file ber-help.c.

References ksba_reader_read().

Referenced by _ksba_ber_read_tl().