scan_asn1dertag(3)

scan_asn1dertag3

Decode an unsigned integer from asn.1 der length encoding

Usage

#include <libowfat/scan.h>

size_t scan_asn1dertag(const char *src,size_t len,unsigned long long *dest);

Overview

scan_asn1dertag decodes an unsigned integer in ASN.1 DER tag encoding from a memory area holding binary data. It writes the decode value in dest and returns the number of bytes it read from src.

scan_asn1dertag never reads more than len bytes from src. If the sequence is longer than that, or the memory area contains an invalid sequence, scan_asn1dertag returns 0 and does not touch dest.

The length of the longest ASN.1 DER length sequence is 128 bytes. In practice the largest sequence is sizeof(*dest)+1.

Releases

6 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8–11
  2. 12–13

From libowfat-dev 0.32-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.