changed RNG_REAL to RNG_TRUE
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 29 Apr 2009 09:13:20 +0000 (09:13 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 29 Apr 2009 09:13:20 +0000 (09:13 -0000)
src/charon/plugins/unit_tester/tests/test_rng.c
src/libstrongswan/crypto/pkcs7.c
src/libstrongswan/crypto/rngs/rng.c
src/libstrongswan/crypto/rngs/rng.h
src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c
src/libstrongswan/plugins/padlock/padlock_plugin.c
src/libstrongswan/plugins/padlock/padlock_rng.c
src/libstrongswan/plugins/random/random_plugin.c
src/libstrongswan/plugins/random/random_rng.c

index 60cbf2d..855c27f 100644 (file)
@@ -212,7 +212,7 @@ bool test_rng()
        {
                return FALSE;
        }
-       if (!test_rng_quality(RNG_REAL))
+       if (!test_rng_quality(RNG_TRUE))
        {
                return FALSE;
        }
index 01a5f75..61a0270 100644 (file)
@@ -772,7 +772,7 @@ bool build_envelopedData(private_pkcs7_t *this, x509_t *cert,
        {
                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);
                DBG4("  symmetric encryption key: %B", &symmetricKey);
                rng->destroy(rng);
index 435e043..17eea3b 100644 (file)
@@ -17,8 +17,8 @@
 
 #include "rng.h"
 
-ENUM(rng_quality_names, RNG_WEAK, RNG_REAL,
+ENUM(rng_quality_names, RNG_WEAK, RNG_TRUE,
        "RNG_WEAK",
        "RNG_STRONG",
-       "RNG_REAL",
+       "RNG_TRUE",
 );
index 862c7a4..68e08cb 100644 (file)
@@ -36,8 +36,8 @@ enum rng_quality_t {
        RNG_WEAK,
        /** stronger randomness, usable for session keys */
        RNG_STRONG,
-       /** real random, key material */
-       RNG_REAL,
+       /** true random key material */
+       RNG_TRUE,
 };
 
 /**
index 84fbb32..2951847 100644 (file)
@@ -141,10 +141,10 @@ static status_t compute_prime(private_gmp_rsa_private_key_t *this,
        rng_t *rng;
        chunk_t random_bytes;
        
-       rng = lib->crypto->create_rng(lib->crypto, RNG_REAL);
+       rng = lib->crypto->create_rng(lib->crypto, RNG_TRUE);
        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;
        }
        
index d0b55bc..72e9f1d 100644 (file)
@@ -159,7 +159,7 @@ plugin_t *plugin_create()
        
        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);
                lib->crypto->add_rng(lib->crypto, RNG_STRONG,
                                                (rng_constructor_t)padlock_rng_create);
index 50d9f0c..98771fe 100644 (file)
@@ -126,7 +126,7 @@ padlock_rng_t *padlock_rng_create(rng_quality_t quality)
                case RNG_STRONG:
                        this->quality = PADLOCK_QF1;
                        break;
-               case RNG_REAL:
+               case RNG_TRUE:
                        this->quality = PADLOCK_QF3;
                        break;
        }
index 3eff81e..8168bb5 100644 (file)
@@ -54,7 +54,7 @@ plugin_t *plugin_create()
        
        lib->crypto->add_rng(lib->crypto, RNG_STRONG, 
                                                 (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);
        
        return &this->public.plugin;
index 45a1b51..018b497 100644 (file)
@@ -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.destroy = (void (*) (rng_t *))destroy;
 
-       if (quality == RNG_REAL)
+       if (quality == RNG_TRUE)
        {
                this->file = DEV_RANDOM;
        }