50 lines
1.7 KiB
Diff
50 lines
1.7 KiB
Diff
From 8391caf4f4aa8fed5167b5e5cf04197a29ba40e8 Mon Sep 17 00:00:00 2001
|
|
From: Andreas Schneider <asn@samba.org>
|
|
Date: Thu, 18 Jul 2019 13:27:57 +0200
|
|
Subject: [PATCH 006/187] lib:crypto: Document gnutls_error_to_werror()
|
|
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
|
(cherry picked from commit e43678b84a3434b977f44b265599f1d9207d3b78)
|
|
---
|
|
lib/crypto/gnutls_helpers.h | 16 ++++++++++++++++
|
|
1 file changed, 16 insertions(+)
|
|
|
|
diff --git a/lib/crypto/gnutls_helpers.h b/lib/crypto/gnutls_helpers.h
|
|
index 8a2a49baf73..debaa701554 100644
|
|
--- a/lib/crypto/gnutls_helpers.h
|
|
+++ b/lib/crypto/gnutls_helpers.h
|
|
@@ -40,6 +40,21 @@ NTSTATUS _gnutls_error_to_ntstatus(int gnutls_rc,
|
|
_gnutls_error_to_ntstatus(gnutls_rc, blocked_status, \
|
|
__FUNCTION__, __location__)
|
|
|
|
+#ifdef DOXYGEN
|
|
+/**
|
|
+ * @brief Convert a gnutls error code to a corresponding WERROR.
|
|
+ *
|
|
+ * @param[in] gnutls_rc The GnuTLS return code.
|
|
+ *
|
|
+ * @param[in] blocked_werr The WERROR code which should be returned if e.g
|
|
+ * the cipher we want to used it not allowed to be
|
|
+ * used because of FIPS mode.
|
|
+ *
|
|
+ * @return A corresponding WERROR code.
|
|
+ */
|
|
+WERROR gnutls_error_to_werror(int gnutls_rc,
|
|
+ WERROR blocked_werr);
|
|
+#else
|
|
WERROR _gnutls_error_to_werror(int gnutls_rc,
|
|
WERROR blocked_werr,
|
|
const char *function,
|
|
@@ -47,6 +62,7 @@ WERROR _gnutls_error_to_werror(int gnutls_rc,
|
|
#define gnutls_error_to_werror(gnutls_rc, blocked_werr) \
|
|
_gnutls_error_to_werror(gnutls_rc, blocked_werr, \
|
|
__FUNCTION__, __location__)
|
|
+#endif
|
|
|
|
enum samba_gnutls_direction {
|
|
SAMBA_GNUTLS_ENCRYPT,
|
|
--
|
|
2.23.0
|
|
|