changed RNG_REAL to RNG_TRUE
This commit is contained in:
@@ -212,7 +212,7 @@ bool test_rng()
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!test_rng_quality(RNG_REAL))
|
if (!test_rng_quality(RNG_TRUE))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -772,7 +772,7 @@ bool build_envelopedData(private_pkcs7_t *this, x509_t *cert,
|
|||||||
{
|
{
|
||||||
rng_t *rng;
|
rng_t *rng;
|
||||||
|
|
||||||
rng = lib->crypto->create_rng(lib->crypto, RNG_REAL);
|
rng = lib->crypto->create_rng(lib->crypto, RNG_TRUE);
|
||||||
rng->allocate_bytes(rng, crypter->get_key_size(crypter), &symmetricKey);
|
rng->allocate_bytes(rng, crypter->get_key_size(crypter), &symmetricKey);
|
||||||
DBG4(" symmetric encryption key: %B", &symmetricKey);
|
DBG4(" symmetric encryption key: %B", &symmetricKey);
|
||||||
rng->destroy(rng);
|
rng->destroy(rng);
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
#include "rng.h"
|
#include "rng.h"
|
||||||
|
|
||||||
ENUM(rng_quality_names, RNG_WEAK, RNG_REAL,
|
ENUM(rng_quality_names, RNG_WEAK, RNG_TRUE,
|
||||||
"RNG_WEAK",
|
"RNG_WEAK",
|
||||||
"RNG_STRONG",
|
"RNG_STRONG",
|
||||||
"RNG_REAL",
|
"RNG_TRUE",
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ enum rng_quality_t {
|
|||||||
RNG_WEAK,
|
RNG_WEAK,
|
||||||
/** stronger randomness, usable for session keys */
|
/** stronger randomness, usable for session keys */
|
||||||
RNG_STRONG,
|
RNG_STRONG,
|
||||||
/** real random, key material */
|
/** true random key material */
|
||||||
RNG_REAL,
|
RNG_TRUE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -141,10 +141,10 @@ static status_t compute_prime(private_gmp_rsa_private_key_t *this,
|
|||||||
rng_t *rng;
|
rng_t *rng;
|
||||||
chunk_t random_bytes;
|
chunk_t random_bytes;
|
||||||
|
|
||||||
rng = lib->crypto->create_rng(lib->crypto, RNG_REAL);
|
rng = lib->crypto->create_rng(lib->crypto, RNG_TRUE);
|
||||||
if (!rng)
|
if (!rng)
|
||||||
{
|
{
|
||||||
DBG1("no RNG of quality %N found", rng_quality_names, RNG_REAL);
|
DBG1("no RNG of quality %N found", rng_quality_names, RNG_TRUE);
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ plugin_t *plugin_create()
|
|||||||
|
|
||||||
if (this->features & PADLOCK_RNG_ENABLED)
|
if (this->features & PADLOCK_RNG_ENABLED)
|
||||||
{
|
{
|
||||||
lib->crypto->add_rng(lib->crypto, RNG_REAL,
|
lib->crypto->add_rng(lib->crypto, RNG_TRUE,
|
||||||
(rng_constructor_t)padlock_rng_create);
|
(rng_constructor_t)padlock_rng_create);
|
||||||
lib->crypto->add_rng(lib->crypto, RNG_STRONG,
|
lib->crypto->add_rng(lib->crypto, RNG_STRONG,
|
||||||
(rng_constructor_t)padlock_rng_create);
|
(rng_constructor_t)padlock_rng_create);
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ padlock_rng_t *padlock_rng_create(rng_quality_t quality)
|
|||||||
case RNG_STRONG:
|
case RNG_STRONG:
|
||||||
this->quality = PADLOCK_QF1;
|
this->quality = PADLOCK_QF1;
|
||||||
break;
|
break;
|
||||||
case RNG_REAL:
|
case RNG_TRUE:
|
||||||
this->quality = PADLOCK_QF3;
|
this->quality = PADLOCK_QF3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ plugin_t *plugin_create()
|
|||||||
|
|
||||||
lib->crypto->add_rng(lib->crypto, RNG_STRONG,
|
lib->crypto->add_rng(lib->crypto, RNG_STRONG,
|
||||||
(rng_constructor_t)random_rng_create);
|
(rng_constructor_t)random_rng_create);
|
||||||
lib->crypto->add_rng(lib->crypto, RNG_REAL,
|
lib->crypto->add_rng(lib->crypto, RNG_TRUE,
|
||||||
(rng_constructor_t)random_rng_create);
|
(rng_constructor_t)random_rng_create);
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ random_rng_t *random_rng_create(rng_quality_t quality)
|
|||||||
this->public.rng.allocate_bytes = (void (*) (rng_t *, size_t, chunk_t*)) allocate_bytes;
|
this->public.rng.allocate_bytes = (void (*) (rng_t *, size_t, chunk_t*)) allocate_bytes;
|
||||||
this->public.rng.destroy = (void (*) (rng_t *))destroy;
|
this->public.rng.destroy = (void (*) (rng_t *))destroy;
|
||||||
|
|
||||||
if (quality == RNG_REAL)
|
if (quality == RNG_TRUE)
|
||||||
{
|
{
|
||||||
this->file = DEV_RANDOM;
|
this->file = DEV_RANDOM;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user