gnutls_srp_base64_encode(3)

πŸ’– gnutls_srp_base64_encode(3) β€” the gnutls manual, section 3 πŸŽ€

okay bestie, sit down, we're learning a gnutls API function today and honestly? it's a lil niche but it's iconic. this one's called gnutls_srp_base64_encode, and it lives in the gnutls manual (section 3, the library-calls girlies, iykyk). let's get into it ✨


🌸 NAME 🌸

gnutls_srp_base64_encode β€” it's an API function, bestie. that's the whole vibe.


✨ SYNOPSIS ✨

#include <gnutls/gnutls.h>

int gnutls_srp_base64_encode(const gnutls_datum_t * data, char * result,
       size_t * result_size);

there she is 🫢 look at her go.


πŸŽ€ ARGUMENTS πŸŽ€

  • const gnutls_datum_t * data β€” this is where the raw data lives. the unencoded, unhinged, straight-out-the-gate bytes. πŸ’…
  • char * result β€” the spot where the base64 data is gonna get copied into. like, this is the destination, the main character slot, the place it all goes down. πŸ¦‹
  • size_t * result_size β€” this one holds the size of the result. it's the little number-keeper. it knows things. πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so what does this function do? it takes the data you hand it and converts it into printable data using base64 encoding β€” specifically, the base64 encoding as used in the libsrp. πŸ“

and like, this is the encoding used in SRP password files. that's her whole purpose. that's her lane. no cap.

but β€” and this is the part where you gotta pay attention β€” if the buffer you gave her is not long enough, she's gonna hit you with GNUTLS_E_SHORT_MEMORY_BUFFER and return it right back at you. so like, size your buffer properly, bestie, or she WILL let you know. 😭

⚠️ Warning! This base64 encoding is not the "standard" encoding. do not use it for non-SRP purposes. like, i'm so serious, do not take this girl to a standard-base64 party, she does not belong there. πŸ’€ use the normal base64 for normal things. this one is SRP-only, periodt.

πŸ”₯ RETURNS πŸ”₯

  • GNUTLS_E_SHORT_MEMORY_BUFFER β€” she's throwing this at you if the buffer you gave is not long enough. sad. tragic. fix your buffer. πŸ™ˆ
  • 0 β€” success, bestie!! we ate!! πŸ‘‘

🌈 REPORTING BUGS 🌈

found a bug? don't be shy, report it to <bugs@gnutls.org>. they wanna hear it, fr fr. πŸ’Œ

Home page: https://www.gnutls.org


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. (so like, go off, but keep the receipts. 🧾✨)


πŸ¦‹ 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, visit:

https://www.gnutls.org/manual/

and that's the whole page, bestie!! πŸ’… this lil manual page came to you straight from gnutls, version 3.8.13, and yes, the title up top said gnutls_srp_base64_encode(3) the whole time. slay, go encode some SRP passwords responsibly, and remember: NOT standard base64!! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from