diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/entropy/darwin_secrandom/darwin_secrandom.cpp | 30 | ||||
-rw-r--r-- | src/lib/entropy/darwin_secrandom/darwin_secrandom.h | 28 | ||||
-rw-r--r-- | src/lib/entropy/darwin_secrandom/info.txt | 16 | ||||
-rw-r--r-- | src/lib/entropy/entropy_srcs.cpp | 11 |
4 files changed, 0 insertions, 85 deletions
diff --git a/src/lib/entropy/darwin_secrandom/darwin_secrandom.cpp b/src/lib/entropy/darwin_secrandom/darwin_secrandom.cpp deleted file mode 100644 index 1e3613615..000000000 --- a/src/lib/entropy/darwin_secrandom/darwin_secrandom.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Darwin SecRandomCopyBytes EntropySource -* (C) 2015 Daniel Seither (Kullo GmbH) -* -* Botan is released under the Simplified BSD License (see license.txt) -*/ - -#include <botan/internal/darwin_secrandom.h> -#include <Security/Security.h> -#include <Security/SecRandom.h> - -namespace Botan { - -/** -* Gather entropy from SecRandomCopyBytes -*/ -size_t Darwin_SecRandom::poll(RandomNumberGenerator& rng) - { - secure_vector<uint8_t> buf(BOTAN_SYSTEM_RNG_POLL_REQUEST); - - if(0 == SecRandomCopyBytes(kSecRandomDefault, buf.size(), buf.data())) - { - rng.add_entropy(buf.data(), buf.size()); - return buf.size() * 8; - } - - return 0; - } - -} diff --git a/src/lib/entropy/darwin_secrandom/darwin_secrandom.h b/src/lib/entropy/darwin_secrandom/darwin_secrandom.h deleted file mode 100644 index 83b4da4f5..000000000 --- a/src/lib/entropy/darwin_secrandom/darwin_secrandom.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -* Darwin SecRandomCopyBytes EntropySource -* (C) 2015 Daniel Seither (Kullo GmbH) -* -* Botan is released under the Simplified BSD License (see license.txt) -*/ - -#ifndef BOTAN_ENTROPY_SRC_DARWIN_SECRANDOM_H_ -#define BOTAN_ENTROPY_SRC_DARWIN_SECRANDOM_H_ - -#include <botan/entropy_src.h> - -namespace Botan { - -/** -* Entropy source using SecRandomCopyBytes from Darwin's Security.framework -*/ -class Darwin_SecRandom final : public Entropy_Source - { - public: - std::string name() const override { return "darwin_secrandom"; } - - size_t poll(RandomNumberGenerator& rng) override; - }; - -} - -#endif diff --git a/src/lib/entropy/darwin_secrandom/info.txt b/src/lib/entropy/darwin_secrandom/info.txt deleted file mode 100644 index c1943a04a..000000000 --- a/src/lib/entropy/darwin_secrandom/info.txt +++ /dev/null @@ -1,16 +0,0 @@ -<defines> -ENTROPY_SRC_DARWIN_SECRANDOM -> 20150925 -</defines> - -<header:internal> -darwin_secrandom.h -</header:internal> - -<os_features> -security_framework -</os_features> - -<frameworks> -darwin -> Security -ios -> Security -</frameworks> diff --git a/src/lib/entropy/entropy_srcs.cpp b/src/lib/entropy/entropy_srcs.cpp index c04b3b5b2..9141db366 100644 --- a/src/lib/entropy/entropy_srcs.cpp +++ b/src/lib/entropy/entropy_srcs.cpp @@ -32,10 +32,6 @@ #include <botan/internal/proc_walk.h> #endif -#if defined(BOTAN_HAS_ENTROPY_SRC_DARWIN_SECRANDOM) - #include <botan/internal/darwin_secrandom.h> -#endif - #if defined(BOTAN_HAS_ENTROPY_SRC_GETENTROPY) #include <botan/internal/getentropy.h> #endif @@ -86,13 +82,6 @@ std::unique_ptr<Entropy_Source> Entropy_Source::create(const std::string& name) } #endif -#if defined(BOTAN_HAS_ENTROPY_SRC_DARWIN_SECRANDOM) - if(name == "darwin_secrandom") - { - return std::unique_ptr<Entropy_Source>(new Darwin_SecRandom); - } -#endif - #if defined(BOTAN_HAS_ENTROPY_SRC_GETENTROPY) if(name == "getentropy") { |