]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
gnutls_{hash,hmac}_copy: mention the functions do not always work
authorDaiki Ueno <ueno@gnu.org>
Wed, 22 Dec 2021 07:22:04 +0000 (08:22 +0100)
committerDaiki Ueno <ueno@gnu.org>
Wed, 22 Dec 2021 07:25:19 +0000 (08:25 +0100)
It is known that some built-in accelerated implementation, such as
AF_ALG, does not support copying hash/hmac contexts.  This expands the
documentation to suggest checking the return value of those functions.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/crypto-api.c

index bd600ef1667fa322e936f70963f6ce619301ece3..a43aaf9b893c31af5451036ac30c3bd86cc5af48 100644 (file)
@@ -543,7 +543,9 @@ gnutls_hmac_fast(gnutls_mac_algorithm_t algorithm,
  * This function will create a copy of MAC context, containing all its current
  * state. Copying contexts for MACs registered using
  * gnutls_crypto_register_mac() is not supported and will always result in an
- * error.
+ * error. In addition to that, some of the MAC implementations do not support
+ * this operation. Applications should check the return value and provide a
+ * proper fallback.
  *
  * Returns: new MAC context or NULL in case of an error.
  *
@@ -697,7 +699,9 @@ gnutls_hash_fast(gnutls_digest_algorithm_t algorithm,
  * This function will create a copy of Message Digest context, containing all
  * its current state. Copying contexts for Message Digests registered using
  * gnutls_crypto_register_digest() is not supported and will always result in
- * an error.
+ * an error. In addition to that, some of the Message Digest implementations do
+ * not support this operation. Applications should check the return value and
+ * provide a proper fallback.
  *
  * Returns: new Message Digest context or NULL in case of an error.
  *