aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/test/firebase/firestore/util
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-01-19 12:20:46 -0800
committerGravatar GitHub <noreply@github.com>2018-01-19 12:20:46 -0800
commit9f7c094f9f00a6efc0107071f109ef1bc4d7357d (patch)
tree98326bf2f1190338ddc451ea5418bbc4b3348008 /Firestore/core/test/firebase/firestore/util
parent6a6e14822fc8c4ec16e9045b23b515b4baad14fd (diff)
Add platform detection logic for SecureRandom (#676)
* Add CMake platform detection logic for SecureRandom Now only builds secure_random_arc4random.cc if available. Remove firebase/firestore/base/port.h. Nothing else was in that directory. * Add a SecureRandom implementation that uses OpenSSL This is usable on Linux, Windows, and Android * Properly check return from RAND_bytes
Diffstat (limited to 'Firestore/core/test/firebase/firestore/util')
-rw-r--r--Firestore/core/test/firebase/firestore/util/CMakeLists.txt21
1 files changed, 20 insertions, 1 deletions
diff --git a/Firestore/core/test/firebase/firestore/util/CMakeLists.txt b/Firestore/core/test/firebase/firestore/util/CMakeLists.txt
index 7f0539c..468c62e 100644
--- a/Firestore/core/test/firebase/firestore/util/CMakeLists.txt
+++ b/Firestore/core/test/firebase/firestore/util/CMakeLists.txt
@@ -12,11 +12,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+if(HAVE_ARC4RANDOM)
+ cc_test(
+ firebase_firestore_util_arc4random_test
+ SOURCES
+ secure_random_test.cc
+ DEPENDS
+ firebase_firestore_util_arc4random
+ )
+endif()
+
+if(HAVE_OPENSSL_RAND_H)
+ cc_test(
+ firebase_firestore_util_openssl_test
+ SOURCES
+ secure_random_test.cc
+ DEPENDS
+ firebase_firestore_util_openssl
+ )
+endif()
+
cc_test(
firebase_firestore_util_test
SOURCES
autoid_test.cc
- secure_random_test.cc
string_printf_test.cc
DEPENDS
firebase_firestore_util