gnutls_pkcs12_bag_enc_info(3)
π gnutls_pkcs12_bag_enc_info(3) β the gnutls girlies' guide π
okay bestie, sit down, hydrate, because we're diving into gnutls's PKCS#12 corner and honestly? it's giving β¨forensicsβ¨.
πΈ NAME πΈ
gnutls_pkcs12_bag_enc_info β literally the API function that spills the tea on how your encrypted bag was encrypted π
π SYNOPSIS π
#include <gnutls/pkcs12.h>
int gnutls_pkcs12_bag_enc_info(gnutls_pkcs12_bag_t bag, unsigned int *
schema, unsigned int * cipher, void * salt, unsigned int * salt_size,
unsigned int * iter_count, char ** oid);
π¦ ARGUMENTS π¦
gnutls_pkcs12_bag_t bagβ the bag. the main character. the whole point. πunsigned int * schemaβ this one tells you the schema, and it's one ofgnutls_pkcs_encrypt_flags_t. pick your fighter.unsigned int * cipherβ the cipher that got used, expressed as agnutls_cipher_algorithm_t.void * saltβ the PBKDF2 salt, bestie. and listen: if this is non-NULL, thensalt_sizeis initially holding its size. read that twice. πunsigned int * salt_sizeβ the PBKDF2 salt size. yes it's a whole separate thing, yes it matters.unsigned int * iter_countβ the PBKDF2 iteration count. the grind never stops, and neither does this number. πͺchar ** oidβ if this isn't NULL, it's gonna hold an allocated null-terminated variable with the OID. allocated. as in yours to free. remember that. π«Ά
β¨ DESCRIPTION β¨
so this function right here? it hands you the info about which encryption algorithms were used in an encrypted bag. that's the whole job. that's the assignment.
but here's the plot twist π β if the structure's algorithms are unknown, you get GNUTLS_E_UNKNOWN_CIPHER_TYPE back, and only oid gets set. just oid. everyone else stays quiet.
and likeβ¦ oid will be set on encrypted bags whether supported or not. supported? oid's there. unsupported? oid's still there. iconic behavior honestly. but you HAVE to deinitialize it with gnutls_free(), no cap, or that's a leak and we don't do leaks in this house π«π§
the other variables? they only get set on supported structures. sorry to the unsupported ones. vibe check failed. π
π RETURNS π
GNUTLS_E_INVALID_REQUESTβ if the bag you handed over isn't even encrypted. bestie. it's giving "you brought me a plain bag and asked about its encryption."GNUTLS_E_UNKNOWN_CIPHER_TYPEβ if the structure's encryption isn't supported. it's real, it's encrypted, we just don't speak that language. π- another negative error code β if something else went wrong, as failures do.
- Zero β on success. slay. π
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the people:
- Report bugs to <bugs@gnutls.org> π§
- Home page: https://www.gnutls.org
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
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. (yes, that's the whole license vibe β keep the notice, keep the freedom, no royalty, periodt. π )
π SEE ALSO π
the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, then bestie, just go here:
https://www.gnutls.org/manual/
and that's the whole page, my love β gnutls 3.8.13, gnutls_pkcs12_bag_enc_info(3), straight from the gnutls manual, rewritten with love and a concerning amount of emoji. now go free that oid π«Άβ¨
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms