gnutls_fips140_set_mode(3)

πŸ’… gnutls_fips140_set_mode(3) β€” the gnutls girlies' manual

okay bestie, welcome to the gnutls manual, and today's main character is gnutls_fips140_set_mode. yes it's an API function. yes it's gonna be cute. let's go 🫢


✨ NAME ✨

gnutls_fips140_set_mode β€” API function. that's it, that's the name, she's literally just that πŸ’β™€οΈ


🌸 SYNOPSIS 🌸

#include <gnutls/gnutls.h>

void gnutls_fips140_set_mode(gnutls_fips_mode_t mode, unsigned flags);

look at her. returns nothing, takes two things. no notes. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • gnutls_fips_mode_t mode β€” the FIPS140-2 mode you wanna switch to, bestie. pick one.
  • unsigned flags β€” this one should be zero or GNUTLS_FIPS140_SET_MODE_THREAD. that's the whole vibe. don't get creative with it πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

okay so, listen up, this is the important part, don't skip it 🚨

That function is not thread-safe when you're changing the mode with no flags (i.e. globally), and it should be called prior to creating any threads. Its behavior with no flags after threads are created is undefined. like, undefined undefined. we don't do that here. periodt. πŸ’€

When the flag GNUTLS_FIPS140_SET_MODE_THREAD is specified, then this call will change the FIPS140-2 mode for this particular thread and not for the whole process. that's the slay. that way an application can utilize this function to set and reset mode for specific operations. cute, contained, no chaos leaking into other threads. we love a scoped queen πŸ‘‘

This function never fails β€” iconic, no error handling needed, no sad return values β€” but it will be a no-op if you use it when the library is not in FIPS140-2 mode. like, she'll just smile and do nothing. respectfully.

When asked to switch to unknown values for mode, or to GNUTLS_FIPS140_SELFTESTS mode, the library switches to GNUTLS_FIPS140_STRICT mode. so like, if you ask for something weird, she's giving you STRICT. no negotiations. πŸ’…


⭐ SINCE ⭐

3.6.2 β€” she's been here a minute, an OG fr fr πŸ‘‘


πŸ¦‹ REPORTING BUGS πŸ¦‹

found a bug? not me manifesting that but okay. report bugs to <bugs@gnutls.org>.

Home page: https://www.gnutls.org β€” go say hi 🌈


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 bestie, keep the receipts, that's the whole deal 🫢)


πŸ”₯ 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 page, bestie!! πŸŽ€ this was the gnutls 3.8.13 manual page for gnutls_fips140_set_mode, and it ate. go forth, set your modes responsibly, and pls pls pls call it before you spawn any threads, i'm begging πŸ˜­πŸ’–

πŸ“¦ where this page comes from