Deleted Added
full compact
rand_lib.c (1.1.1.18) rand_lib.c (1.1.1.19)
1/*
2 * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */

--- 106 unchanged lines hidden (view full) ---

115 * RAND_poll() reseeds the default RNG using random input
116 *
117 * The random input is obtained from polling various entropy
118 * sources which depend on the operating system and are
119 * configurable via the --with-rand-seed configure option.
120 */
121int RAND_poll(void)
122{
1/*
2 * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */

--- 106 unchanged lines hidden (view full) ---

115 * RAND_poll() reseeds the default RNG using random input
116 *
117 * The random input is obtained from polling various entropy
118 * sources which depend on the operating system and are
119 * configurable via the --with-rand-seed configure option.
120 */
121int RAND_poll(void)
122{
123 static const char salt[] = "polling";
124
123# ifndef OPENSSL_NO_DEPRECATED_3_0
124 const RAND_METHOD *meth = RAND_get_rand_method();
125 int ret = meth == RAND_OpenSSL();
126
127 if (meth == NULL)
128 return 0;
129
130 if (!ret) {

--- 12 unchanged lines hidden (view full) ---

143 || meth->add(ossl_rand_pool_buffer(pool),
144 ossl_rand_pool_length(pool),
145 (ossl_rand_pool_entropy(pool) / 8.0)) == 0)
146 goto err;
147
148 ret = 1;
149 err:
150 ossl_rand_pool_free(pool);
125# ifndef OPENSSL_NO_DEPRECATED_3_0
126 const RAND_METHOD *meth = RAND_get_rand_method();
127 int ret = meth == RAND_OpenSSL();
128
129 if (meth == NULL)
130 return 0;
131
132 if (!ret) {

--- 12 unchanged lines hidden (view full) ---

145 || meth->add(ossl_rand_pool_buffer(pool),
146 ossl_rand_pool_length(pool),
147 (ossl_rand_pool_entropy(pool) / 8.0)) == 0)
148 goto err;
149
150 ret = 1;
151 err:
152 ossl_rand_pool_free(pool);
153 return ret;
151 }
154 }
152 return ret;
153# else
154 static const char salt[] = "polling";
155# endif
155
156 RAND_seed(salt, sizeof(salt));
157 return 1;
156
157 RAND_seed(salt, sizeof(salt));
158 return 1;
158# endif
159}
160
161# ifndef OPENSSL_NO_DEPRECATED_3_0
162static int rand_set_rand_method_internal(const RAND_METHOD *meth,
163 ossl_unused ENGINE *e)
164{
165 if (!RUN_ONCE(&rand_init, do_rand_init))
166 return 0;

--- 684 unchanged lines hidden ---
159}
160
161# ifndef OPENSSL_NO_DEPRECATED_3_0
162static int rand_set_rand_method_internal(const RAND_METHOD *meth,
163 ossl_unused ENGINE *e)
164{
165 if (!RUN_ONCE(&rand_init, do_rand_init))
166 return 0;

--- 684 unchanged lines hidden ---