gnutls_hash_copy(3)
β¨ gnutls_hash_copy(3) β¨
okay bestie, pull up a chair π this one lives in the gnutls manual (the 3.8.13 era, we'll get to that at the end) and it's genuinely so useful. let's go π«Ά
π NAME π
gnutls_hash_copy β and it is literally an API function, no cap π
πΈ SYNOPSIS πΈ
#include <gnutls/crypto.h>
gnutls_hash_hd_t gnutls_hash_copy(gnutls_hash_hd_t handle);
like... that's it. one include, one function, one lil handle going in and one lil handle coming out π¦
π ARGUMENTS π
gnutls_hash_hd_t handleβ bestie this is agnutls_hash_hd_ttype. that's the whole description. the manpage said what it said and we respect it π
π DESCRIPTION π
okay so here's the vibe: this function creates a copy of a Message Digest context, and the copy contains all its current state. like, the whole snapshot. the energy, the progress, everything. icon status β
but β and this is the important part, don't skip it β copying contexts for Message Digests that were registered using gnutls_crypto_register_digest() is not supported and will always result in an error. periodt. π
and on top of that? some of the Message Digest implementations just... don't support this operation either. so it's giving "it depends". π
so applications should check the return value and provide a proper fallback. fr fr, do not skip the check. that's not a suggestion, that's the whole assignment. π
π₯ RETURNS π₯
a new Message Digest context β¨ β or NULL in case of an error. that's it, that's the return. check it. love it. handle it. π
π SINCE π
3.6.9 β so it's been around a minute, it's a classic, it ate π
π¦ REPORTING BUGS π¦
found something cursed? tell the devs, they wanna know:
- 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.
π 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 π§ mwah π this was the gnutls manual, version 3.8.13, and gnutls_hash_copy(3) says bye ππ
π¦ 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