]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/RAND_DRBG_reseed.pod
Fix a grammar nit in CRYPTO_get_ex_new_index.pod
[thirdparty/openssl.git] / doc / man3 / RAND_DRBG_reseed.pod
CommitLineData
a73d990e
DMSP
1=pod
2
3=head1 NAME
4
5RAND_DRBG_reseed,
6RAND_DRBG_set_reseed_interval,
7RAND_DRBG_set_reseed_time_interval,
8RAND_DRBG_set_reseed_defaults
9- reseed a RAND_DRBG instance
10
11=head1 SYNOPSIS
12
13 #include <openssl/rand_drbg.h>
14
15 int RAND_DRBG_reseed(RAND_DRBG *drbg,
16 const unsigned char *adin, size_t adinlen);
17
18 int RAND_DRBG_set_reseed_interval(RAND_DRBG *drbg,
19 unsigned int interval);
20
21 int RAND_DRBG_set_reseed_time_interval(RAND_DRBG *drbg,
22 time_t interval);
23
24 int RAND_DRBG_set_reseed_defaults(
25 unsigned int master_reseed_interval,
26 unsigned int slave_reseed_interval,
27 time_t master_reseed_time_interval,
28 time_t slave_reseed_time_interval
29 );
30
31
32=head1 DESCRIPTION
33
34RAND_DRBG_reseed()
35reseeds the given B<drbg>, obtaining entropy input from its entropy source
36and mixing in the specified additional data provided in the buffer B<adin>
37of length B<adinlen>.
38The additional data can be omitted by setting B<adin> to NULL and B<adinlen>
39to 0.
40
41RAND_DRBG_set_reseed_interval()
42sets the reseed interval of the B<drbg>, which is the maximum allowed number
43of generate requests between consecutive reseedings.
44If B<interval> > 0, then the B<drbg> will reseed automatically whenever the
45number of generate requests since its last seeding exceeds the given reseed
46interval.
47If B<interval> == 0, then this feature is disabled.
48
49
50RAND_DRBG_set_reseed_time_interval()
51sets the reseed time interval of the B<drbg>, which is the maximum allowed
52number of seconds between consecutive reseedings.
53If B<interval> > 0, then the B<drbg> will reseed automatically whenever the
54elapsed time since its last reseeding exceeds the given reseed time interval.
55If B<interval> == 0, then this feature is disabled.
56
57RAND_DRBG_set_reseed_defaults() sets the default values for the reseed interval
58(B<master_reseed_interval> and B<slave_reseed_interval>)
59and the reseed time interval
60(B<master_reseed_time_interval> and B<slave_reseed_tme_interval>)
61of DRBG instances.
62The default values are set independently for master DRBG instances (which don't
63have a parent) and slave DRBG instances (which are chained to a parent DRBG).
64
65=head1 RETURN VALUES
66
67RAND_DRBG_reseed(),
68RAND_DRBG_set_reseed_interval(), and
69RAND_DRBG_set_reseed_time_interval(),
70return 1 on success, 0 on failure.
71
72
73=head1 NOTES
74
75The default OpenSSL random generator is already set up for automatic reseeding,
76so in general it is not necessary to reseed it explicitly, or to modify
77its reseeding thresholds.
78
79Normally, the entropy input for seeding a DRBG is either obtained from a
80trusted os entropy source or from a parent DRBG instance, which was seeded
81(directly or indirectly) from a trusted os entropy source.
82In exceptional cases it is possible to replace the reseeding mechanism entirely
83by providing application defined callbacks using RAND_DRBG_set_callbacks().
84
85The reseeding default values are applied only during creation of a DRBG instance.
86To ensure that they are applied to the global and thread-local DRBG instances
87(<master>, resp. <public> and <private>), it is necessary to call
88RAND_DRBG_set_reseed_defaults() before creating any thread and before calling any
89 cryptographic routines that obtain random data directly or indirectly.
90
91=head1 HISTORY
92
93The RAND_DRBG functions were added in OpenSSL 1.1.1.
94
95=head1 SEE ALSO
96
97L<RAND_DRBG_generate(3)>,
98L<RAND_DRBG_bytes(3)>,
99L<RAND_DRBG_set_callbacks(3)>.
100L<RAND_DRBG(7)>
101
102=head1 COPYRIGHT
103
104Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
105
4746f25a 106Licensed under the Apache License 2.0 (the "License"). You may not use
a73d990e
DMSP
107this file except in compliance with the License. You can obtain a copy
108in the file LICENSE in the source distribution or at
109L<https://www.openssl.org/source/license.html>.
110
111=cut