CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]    2026/05/01 05:22:24

Modified files:
        usr.sbin/rpki-client: Makefile extern.h 
Added files:
        usr.sbin/rpki-client: asn1_bit_string.c 

Log message:
rpki-client: add compat for BIT STRING accessors

ASN.1 bit strings are DER encoded by zero-padding the bit string at the end
to a length divisible by eight. The number of padding bits ("unused bits"),
a number between 0 and 7, is stored in the first value octet, the remainder
of the value octets are formed by the zero-padded bit string.

Since asn1_string_st is opaque in OpenSSL 4, there need to be accessors for
length and unused bits, which is what is added here. The getter assumes the
ASN1_STRING_FLAG_BITS_LEFT flag is set on a bit string, which is always the
case for deserialized bit strings. I prefer not to elaborate on the madness
hiding here at this point in time...

LibreSSL will likely add these accessors to libcrypto in the ongoing cycle,
but we will need this compat code for OpenSSL and older LibreSSL anyway.

The code is not yet used in rpki-client. The conversions will be committed
soon.

ok claudio job

Reply via email to