mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge remote-tracking branch 'origin/maint-0.2.6'
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
o Minor bugfixes (testing):
|
||||
- Avoid a side-effect in a tor_assert() in the unit tests. Fixes bug
|
||||
15188; bugfix on 0.1.2.3-alpha. Patch from Tom van der Woerdt.
|
||||
@@ -165,18 +165,21 @@ static crypto_pk_t *pregen_keys[5] = {NULL, NULL, NULL, NULL, NULL};
|
||||
crypto_pk_t *
|
||||
pk_generate(int idx)
|
||||
{
|
||||
int res;
|
||||
#ifdef CACHE_GENERATED_KEYS
|
||||
tor_assert(idx < N_PREGEN_KEYS);
|
||||
if (! pregen_keys[idx]) {
|
||||
pregen_keys[idx] = crypto_pk_new();
|
||||
tor_assert(!crypto_pk_generate_key(pregen_keys[idx]));
|
||||
res = crypto_pk_generate_key(pregen_keys[idx]);
|
||||
tor_assert(!res);
|
||||
}
|
||||
return crypto_pk_dup_key(pregen_keys[idx]);
|
||||
#else
|
||||
crypto_pk_t *result;
|
||||
(void) idx;
|
||||
result = crypto_pk_new();
|
||||
tor_assert(!crypto_pk_generate_key(result));
|
||||
res = crypto_pk_generate_key(result);
|
||||
tor_assert(!res);
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user