aboutsummaryrefslogtreecommitdiff
path: root/secure/lib/libcrypto/man/man3/OSSL_INDICATOR_set_callback.3
diff options
context:
space:
mode:
Diffstat (limited to 'secure/lib/libcrypto/man/man3/OSSL_INDICATOR_set_callback.3')
-rw-r--r--secure/lib/libcrypto/man/man3/OSSL_INDICATOR_set_callback.3136
1 files changed, 136 insertions, 0 deletions
diff --git a/secure/lib/libcrypto/man/man3/OSSL_INDICATOR_set_callback.3 b/secure/lib/libcrypto/man/man3/OSSL_INDICATOR_set_callback.3
new file mode 100644
index 000000000000..e6af4de3ced3
--- /dev/null
+++ b/secure/lib/libcrypto/man/man3/OSSL_INDICATOR_set_callback.3
@@ -0,0 +1,136 @@
+.\" -*- mode: troff; coding: utf-8 -*-
+.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
+.ie n \{\
+. ds C` ""
+. ds C' ""
+'br\}
+.el\{\
+. ds C`
+. ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el .ds Aq '
+.\"
+.\" If the F register is >0, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD. Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{\
+. if \nF \{\
+. de IX
+. tm Index:\\$1\t\\n%\t"\\$2"
+..
+. if !\nF==2 \{\
+. nr % 0
+. nr F 2
+. \}
+. \}
+.\}
+.rr rF
+.\" ========================================================================
+.\"
+.IX Title "OSSL_INDICATOR_SET_CALLBACK 3ossl"
+.TH OSSL_INDICATOR_SET_CALLBACK 3ossl 2025-09-30 3.5.4 OpenSSL
+.\" For nroff, turn off justification. Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH NAME
+OSSL_INDICATOR_set_callback,
+OSSL_INDICATOR_get_callback \- specify a callback for FIPS indicators
+.SH SYNOPSIS
+.IX Header "SYNOPSIS"
+.Vb 1
+\& #include <openssl/indicator.h>
+.Ve
+.PP
+typedef int (OSSL_INDICATOR_CALLBACK)(const char *type, const char *desc,
+ const OSSL_PARAM params[]);
+.PP
+.Vb 4
+\& void OSSL_INDICATOR_set_callback(OSSL_LIB_CTX *libctx,
+\& OSSL_INDICATOR_CALLBACK *cb);
+\& void OSSL_INDICATOR_get_callback(OSSL_LIB_CTX *libctx,
+\& OSSL_INDICATOR_CALLBACK **cb);
+.Ve
+.SH DESCRIPTION
+.IX Header "DESCRIPTION"
+\&\fBOSSL_INDICATOR_set_callback()\fR sets a user callback \fIcb\fR associated with a
+\&\fIlibctx\fR that will be called when a non approved FIPS operation is detected.
+.PP
+The user's callback may be triggered multiple times during an algorithm operation
+to indicate different approved mode checks have failed.
+.PP
+Non approved operations may only occur if the user has deliberately chosen to do
+so (either by setting a global FIPS configuration option or via an option in an
+algorithm's operation context).
+.PP
+The user's callback \fBOSSL_INDICATOR_CALLBACK\fR \fItype\fR and \fIdesc\fR
+contain the algorithm type and operation that is not approved.
+\&\fIparams\fR is not currently used.
+.PP
+If the user callback returns 0, an error will occur in the caller. This can be
+used for testing purposes.
+.SH "RETURN VALUES"
+.IX Header "RETURN VALUES"
+\&\fBOSSL_INDICATOR_get_callback()\fR returns the callback that has been set via
+\&\fBOSSL_INDICATOR_set_callback()\fR for the given library context \fIlibctx\fR, or NULL
+if no callback is currently set.
+.SH EXAMPLES
+.IX Header "EXAMPLES"
+A simple indicator callback to log non approved FIPS operations
+.PP
+.Vb 9
+\& static int indicator_cb(const char *type, const char *desc,
+\& const OSSL_PARAM params[])
+\& {
+\& if (type != NULL && desc != NULL)
+\& fprintf(stdout, "%s %s is not approved\en", type, desc);
+\&end:
+\& /* For Testing purposes you could return 0 here to cause an error */
+\& return 1;
+\& }
+\&
+\& OSSL_INDICATOR_set_callback(libctx, indicator_cb);
+.Ve
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+\&\fBopenssl\-core.h\fR\|(7),
+\&\fBOSSL_PROVIDER\-FIPS\fR\|(7)
+\&\fBOSSL_LIB_CTX\fR\|(3)
+.SH HISTORY
+.IX Header "HISTORY"
+The functions described here were added in OpenSSL 3.4.
+.SH COPYRIGHT
+.IX Header "COPYRIGHT"
+Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
+.PP
+Licensed under the Apache License 2.0 (the "License"). You may not use
+this file except in compliance with the License. You can obtain a copy
+in the file LICENSE in the source distribution or at
+<https://www.openssl.org/source/license.html>.