Home | History | Annotate | Line # | Download | only in man3
      1  1.1  christos =pod
      2  1.1  christos 
      3  1.1  christos =head1 NAME
      4  1.1  christos 
      5  1.1  christos OSSL_CALLBACK, OSSL_PASSPHRASE_CALLBACK - OpenSSL Core type to define callbacks
      6  1.1  christos 
      7  1.1  christos =head1 SYNOPSIS
      8  1.1  christos 
      9  1.1  christos  #include <openssl/core.h>
     10  1.1  christos  typedef int (OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
     11  1.1  christos  typedef int (OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size,
     12  1.1  christos                                         size_t *pass_len,
     13  1.1  christos                                         const OSSL_PARAM params[],
     14  1.1  christos                                         void *arg);
     15  1.1  christos 
     16  1.1  christos =head1 DESCRIPTION
     17  1.1  christos 
     18  1.1  christos For certain events or activities, provider functionality may need help from
     19  1.1  christos the application or the calling OpenSSL libraries themselves.  For example,
     20  1.1  christos user input or direct (possibly optional) user output could be implemented
     21  1.1  christos this way.
     22  1.1  christos 
     23  1.1  christos Callback functions themselves are always provided by or through the calling
     24  1.1  christos OpenSSL libraries, along with a generic pointer to data I<arg>.  As far as
     25  1.1  christos the function receiving the pointer to the function pointer and I<arg> is
     26  1.1  christos concerned, the data that I<arg> points at is opaque, and the pointer should
     27  1.1  christos simply be passed back to the callback function when it's called.
     28  1.1  christos 
     29  1.1  christos =over 4
     30  1.1  christos 
     31  1.1  christos =item B<OSSL_CALLBACK>
     32  1.1  christos 
     33  1.1  christos This is a generic callback function.  When calling this callback function,
     34  1.1  christos the caller is expected to build an L<OSSL_PARAM(3)> array of data it wants or
     35  1.1  christos is expected to pass back, and pass that as I<params>, as well as the opaque
     36  1.1  christos data pointer it received, as I<arg>.
     37  1.1  christos 
     38  1.1  christos =item B<OSSL_PASSPHRASE_CALLBACK>
     39  1.1  christos 
     40  1.1  christos This is a specialised callback function, used specifically to prompt the
     41  1.1  christos user for a passphrase.  When calling this callback function, a buffer to
     42  1.1  christos store the pass phrase needs to be given with I<pass>, and its size with
     43  1.1  christos I<pass_size>.  The length of the prompted pass phrase will be given back in
     44  1.1  christos I<*pass_len>.
     45  1.1  christos 
     46  1.1  christos Additional parameters can be passed with the L<OSSL_PARAM(3)> array I<params>,
     47  1.1  christos 
     48  1.1  christos =back
     49  1.1  christos 
     50  1.1  christos =begin comment RETURN VALUES doesn't make sense for a manual that only
     51  1.1  christos describes a type, but document checkers still want that section, and
     52  1.1  christos to have more than just the section title.
     53  1.1  christos 
     54  1.1  christos =head1 RETURN VALUES
     55  1.1  christos 
     56  1.1  christos txt
     57  1.1  christos 
     58  1.1  christos =end comment
     59  1.1  christos 
     60  1.1  christos =head1 SEE ALSO
     61  1.1  christos 
     62  1.1  christos L<openssl-core.h(7)>
     63  1.1  christos 
     64  1.1  christos =head1 HISTORY
     65  1.1  christos 
     66  1.1  christos The types described here were added in OpenSSL 3.0.
     67  1.1  christos 
     68  1.1  christos =head1 COPYRIGHT
     69  1.1  christos 
     70  1.1  christos Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
     71  1.1  christos 
     72  1.1  christos Licensed under the Apache License 2.0 (the "License").  You may not use
     73  1.1  christos this file except in compliance with the License.  You can obtain a copy
     74  1.1  christos in the file LICENSE in the source distribution or at
     75  1.1  christos L<https://www.openssl.org/source/license.html>.
     76  1.1  christos 
     77  1.1  christos =cut
     78