mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
common: Add an easy to use DER builder.
* common/tlv-builder.c: New. * common/tlv.c: Remove stuff only used by GnuPG 1. (put_tlv_to_membuf, get_tlv_length): Move to ... * common/tlv-builder.c: here. * common/tlv.h (tlv_builder_t): New. -- Such code should actually go into libksba and we will eventually do that. However, for now it is easier to keep it here. Signed-off-by: Werner Koch <wk@gnupg.org> (cherry picked from commit5ea878274e
) - Add coverity meta comment from commita95ddffdcd
This commit is contained in:
parent
7b1db7192e
commit
d21ced1e35
4 changed files with 417 additions and 12 deletions
12
common/tlv.c
12
common/tlv.c
|
@ -32,21 +32,13 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#if GNUPG_MAJOR_VERSION == 1
|
||||
#define GPG_ERR_EOF (-1)
|
||||
#define GPG_ERR_BAD_BER (1) /*G10ERR_GENERAL*/
|
||||
#define GPG_ERR_INV_SEXP (45) /*G10ERR_INV_ARG*/
|
||||
typedef int gpg_error_t;
|
||||
#define gpg_make_err(x,n) (n)
|
||||
#else
|
||||
#include <gpg-error.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "util.h"
|
||||
#include "tlv.h"
|
||||
|
||||
|
||||
static const unsigned char *
|
||||
do_find_tlv (const unsigned char *buffer, size_t length,
|
||||
int tag, size_t *nbytes, int nestlevel)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue