asn1_get_length_ber(3)

πŸ“¦
version 4.21.0 Β· 5 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

πŸ’– asn1_get_length_ber(3) πŸ’–

okay bestie, pull up a chair, because we're about to talk about libtasn1's little length-field gremlin, asn1_get_length_ber. yes this is a real manpage from the libtasn1 family and yes it's gonna be cute. let's go πŸ¦‹


✨ NAME ✨

asn1_get_length_ber β€” an API function, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <libtasn1.h>

long asn1_get_length_ber(const unsigned char * ber, int ber_len, int *
len);

literally three args and one long return. she's simple, she's iconic, she slays πŸŽ€


🫢 ARGUMENTS 🫢

  • const unsigned char * ber β€” the BER data you wanna decode. this is the snack, hand it over πŸ“
  • int ber_len β€” how long that BER data is. gotta tell her the size bestie, she's not psychic 😭
  • int * len β€” an output variable, and she's gonna fill it with the length of the BER length field. she writes back, we love a responsive queen ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe: you extract a length field from BER data. simple. gorgeous. main character energy.

but the difference from asn1_get_length_der() is the whole plot twist, so listen up: this function will return a length even if the value has indefinite encoding. that's the whole point. that's her thing. periodt πŸ’…


πŸ”₯ RETURNS πŸ”₯

she returns the decoded length value, bestie. gorgeous. immaculate. 🌈

but β€” and this is the dramatic part β€” she returns a negative value when the value was too big. so check your return value, don't get caught lacking πŸ™ˆ


⭐ SINCE ⭐

2.0 β€” she's been here since 2.0, an OG, a legend, a foundational icon πŸ’œ


Copyright Β© 2006-2025 Free Software Foundation, Inc..

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. (translation: be free, just keep the receipts 🧾✨)


🌈 SEE ALSO 🌈

the full documentation for libtasn1 is maintained as a Texinfo manual. if the info and libtasn1 programs are properly installed at your site, the command

info libtasn1

should give you access to the complete manual. as an alternative you may obtain the manual from:

https://www.gnu.org/software/libtasn1/manual/

like, go read it, iykyk πŸ“–πŸ«Ά


and that's the whole page babes!! πŸ’– this was asn1_get_length_ber(3) from libtasn1, version 4.21.0. mwah, go decode something gorgeous πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from