diff options
| author | Jason Carey <jcarey@argv.me> | 2017-07-18 16:13:32 -0400 |
|---|---|---|
| committer | Jason Carey <jcarey@argv.me> | 2017-07-25 10:48:44 -0400 |
| commit | ffe9014101f7bd53ed9674b770e9371324fcdf34 (patch) | |
| tree | 7f1051ee8d382d41cc56cf61ce39949b50ea8133 /src/mongo/crypto/SConscript | |
| parent | 4e27af1e980a5f5479fc26a3d616a5b56245261a (diff) | |
| download | mongo-ffe9014101f7bd53ed9674b770e9371324fcdf34.tar.gz | |
SERVER-30218 Add SHA256 Support
The addition of a SHA256Block will give us the flexibility to handle new
workloads that aren't appropriate for SHA1.
As part of this change, let's make the current code templatized so we
can limit as strongly as possible the duplication of code between sha1
and sha256.
Diffstat (limited to 'src/mongo/crypto/SConscript')
| -rw-r--r-- | src/mongo/crypto/SConscript | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/src/mongo/crypto/SConscript b/src/mongo/crypto/SConscript index b7f06827201..ecf857b1217 100644 --- a/src/mongo/crypto/SConscript +++ b/src/mongo/crypto/SConscript @@ -4,15 +4,6 @@ Import("env") env = env.Clone() -env.SConscript( - dirs=[ - 'tom', - ], - exports=[ - 'env', - ], -) - env.Library('sha1_block', source=[ 'sha1_block.cpp' @@ -22,24 +13,42 @@ env.Library('sha1_block', '$BUILD_DIR/mongo/util/secure_compare_memory', ]) -env.Library( - target='sha1_block_tom', +env.Library('sha256_block', source=[ - 'sha1_block_tom.cpp' + 'sha256_block.cpp' ], LIBDEPS=[ + '$BUILD_DIR/mongo/base', + '$BUILD_DIR/mongo/util/secure_compare_memory', + ]) + +if "tom" in env["MONGO_CRYPTO"]: + tomEnv = env.Clone(); + tomEnv.InjectThirdPartyIncludePaths(libraries=['tomcrypt']) + + tomEnv.Library( + target='sha_block_tom', + source=[ + 'sha_block_tom.cpp' + ], + LIBDEPS=[ '$BUILD_DIR/mongo/base', 'sha1_block', - 'tom/tomcrypt' - ]) + 'sha256_block', + ], + LIBDEPS_PRIVATE=[ + '$BUILD_DIR/third_party/shim_tomcrypt', + ] + ) -env.Library('sha1_block_openssl', +env.Library('sha_block_openssl', source=[ - 'sha1_block_openssl.cpp' + 'sha_block_openssl.cpp' ], LIBDEPS=[ '$BUILD_DIR/mongo/base', 'sha1_block', + 'sha256_block', ]) env.Library('scramauth', @@ -48,8 +57,12 @@ env.Library('scramauth', '$BUILD_DIR/mongo/base/secure_allocator', '$BUILD_DIR/mongo/util/secure_compare_memory', '$BUILD_DIR/mongo/util/secure_zero_memory', - 'sha1_block_${MONGO_CRYPTO}']) + 'sha_block_${MONGO_CRYPTO}']) env.CppUnitTest('sha1_block_test', ['sha1_block_test.cpp'], - LIBDEPS=['sha1_block_${MONGO_CRYPTO}']) + LIBDEPS=['sha_block_${MONGO_CRYPTO}']) + +env.CppUnitTest('sha256_block_test', + ['sha256_block_test.cpp'], + LIBDEPS=['sha_block_${MONGO_CRYPTO}']) |
