gsasl_hmac_sha1(3)

πŸ“¦ version 1.10.0, in ubuntu jammy

πŸ’– gsasl_hmac_sha1(3) πŸ’–

okay bestie, so this is a page from the gsasl manual β€” like, the actual manual manual, the one you get when you type man and pray πŸ™ β€” and today's main character is gsasl_hmac_sha1. it's an API function. yes, an API function. we're in the library section, the coding girlies' section. let's go 🫢


✨ NAME ✨

gsasl_hmac_sha1 β€” API function

like. that's literally it. that's the name. it's a function. it lives in the API. iconic behavior honestly πŸ’…


✨ SYNOPSIS ✨

the way that you gotta include this first, no cap:

#include <gsasl.h>

int gsasl_hmac_sha1(const char * key, size_t keylen, const char * in,
size_t inlen, char * [] outhash);

five arguments, one int coming back at you. she's a whole vibe 🌸


✨ ARGUMENTS ✨

okay so here's the tea on every single one of these, bestie. no skipping, we're doing all five πŸŽ€

  • const char * key β€” this is your input character array, and it holds the key you're gonna use. the key!! the secret!! the whole point!! πŸ”‘
  • size_t keylen β€” the length of that input character array with the key you're gonna use. yes, you have to tell her how long the key is. she's not psychic. she's a C function. πŸ’€
  • const char * in β€” this is the input character array of the actual data you wanna hash. the stuff. the payload. the content. 🌈
  • size_t inlen β€” the length of that input character array of data you wanna hash. same deal, length girlies, always report your length. πŸ“
  • char * [] outhash β€” a newly allocated 20-byte character array that holds the keyed hash of your data. twenty bytes. exactly. it's fresh out the allocator, she's new here, be nice to her ✨

✨ DESCRIPTION ✨

so what does she actually do? she computes a keyed checksum of your data using HMAC-SHA1. that's it. that's the job. 🧚

🚨 IMPORTANT, DON'T SKIP THIS ONE: the outhash buffer must be deallocated by the caller. that's you. you are the caller. you have to free it. if you don't, that's a memory leak and she will haunt you. free your buffers bestie, fr fr 😭

Return value: Returns GSASL_OK iff successful. that's the only happy ending she acknowledges. anything else is not GSASL_OK and therefore not a slay πŸ™ˆ


✨ SINCE ✨

1.3

she's been around since 1.3, so she's lowkey a legacy icon πŸ‘‘


✨ DEPRECATED ✨

πŸ’€ okay so this is the part where I have to be straight with you: use a crypto library. that's it, that's the whole note. she's deprecated. she still works, but the maintainers are telling you to go use a real crypto library instead. not me being dramatic, that's literally what it says. πŸ₯²

✨ REPORTING BUGS ✨

found a bug? okay don't just scream into the group chat, actually tell the people who can fix it:


Copyright Β© 2002-2021 Simon Josefsson.

and the license tea, verbatim vibes: 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. keep the receipts, bestie 🧾✨


✨ SEE ALSO ✨

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

info gsasl

should give you access to the complete manual. πŸ“–

as an alternative you may obtain the manual from:

http://www.gnu.org/software/gsasl/manual/

and that's the whole page, babe. go forth, hash responsibly, and free your buffers. 🫢

this has been page gsasl_hmac_sha1(3) from the gsasl manual, version 1.10.0. mwah. πŸ’–πŸ’…πŸŽ€

πŸ“¦ where this page comes from