RAND_DRBG_reseed.pod 3.9 KB

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