Disable Mars448 test cases when Mars448 is not available and fix Travis CI. (#92)
This commit is contained in:
parent
378e259eee
commit
d00151af37
@ -29,7 +29,7 @@ install:
|
||||
- echo Using $NUMCORES cores
|
||||
# Install dependencies
|
||||
- if [ "${TRAVIS_OS_NAME}" == "linux" ]; then ./travis.install_boost.sh; fi
|
||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then brew upgrade boost && brew install cryptopp osxfuse; fi
|
||||
- if [ "${TRAVIS_OS_NAME}" == "osx" ]; then brew upgrade boost && brew cask install osxfuse && brew install cryptopp; fi
|
||||
# Install run_with_fuse.sh
|
||||
- mkdir cmake
|
||||
- cd cmake
|
||||
|
@ -244,9 +244,11 @@ INSTANTIATE_TYPED_TEST_CASE_P(Cast256_CFB, CipherTest, Cast256_CFB); //CFB mode
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Cast256_GCM, CipherTest, Cast256_GCM);
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Cast256_GCM, AuthenticatedCipherTest, Cast256_GCM);
|
||||
|
||||
#if CRYPTOPP_VERSION != 564
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Mars448_CFB, CipherTest, Mars448_CFB); //CFB mode is not authenticated
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Mars448_GCM, CipherTest, Mars448_GCM);
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Mars448_GCM, AuthenticatedCipherTest, Mars448_GCM);
|
||||
#endif
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Mars256_CFB, CipherTest, Mars256_CFB); //CFB mode is not authenticated
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Mars256_GCM, CipherTest, Mars256_GCM);
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(Mars256_GCM, AuthenticatedCipherTest, Mars256_GCM);
|
||||
@ -275,8 +277,10 @@ TEST(CipherNameTest, TestCipherNames) {
|
||||
EXPECT_EQ("cast-256-gcm", string(Cast256_GCM::NAME));
|
||||
EXPECT_EQ("cast-256-cfb", string(Cast256_CFB::NAME));
|
||||
|
||||
#if CRYPTOPP_VERSION != 564
|
||||
EXPECT_EQ("mars-448-gcm", string(Mars448_GCM::NAME));
|
||||
EXPECT_EQ("mars-448-cfb", string(Mars448_CFB::NAME));
|
||||
#endif
|
||||
EXPECT_EQ("mars-256-gcm", string(Mars256_GCM::NAME));
|
||||
EXPECT_EQ("mars-256-cfb", string(Mars256_CFB::NAME));
|
||||
EXPECT_EQ("mars-128-gcm", string(Mars128_GCM::NAME));
|
||||
|
@ -100,8 +100,10 @@ TEST_F(CryCipherTest, CreatesCorrectEncryptedBlockStore) {
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Serpent128_CFB>("serpent-128-cfb");
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Cast256_GCM>("cast-256-gcm");
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Cast256_CFB>("cast-256-cfb");
|
||||
#if CRYPTOPP_VERSION != 564
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Mars448_GCM>("mars-448-gcm");
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Mars448_CFB>("mars-448-cfb");
|
||||
#endif
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Mars256_GCM>("mars-256-gcm");
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Mars256_CFB>("mars-256-cfb");
|
||||
EXPECT_CREATES_CORRECT_ENCRYPTED_BLOCKSTORE<Mars128_GCM>("mars-128-gcm");
|
||||
@ -121,9 +123,11 @@ TEST_F(CryCipherTest, ThereIsACipherWithIntegrityWarning) {
|
||||
EXPECT_THAT(CryCiphers::find("aes-256-cfb").warning().get(), MatchesRegex(".*integrity.*"));
|
||||
}
|
||||
|
||||
#if CRYPTOPP_VERSION != 564
|
||||
TEST_F(CryCipherTest, EncryptionKeyHasCorrectSize_448) {
|
||||
EXPECT_EQ(Mars448_GCM::EncryptionKey::STRING_LENGTH, CryCiphers::find("mars-448-gcm").createKey(Random::PseudoRandom()).size());
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_F(CryCipherTest, EncryptionKeyHasCorrectSize_256) {
|
||||
EXPECT_EQ(AES256_GCM::EncryptionKey::STRING_LENGTH, CryCiphers::find("aes-256-gcm").createKey(Random::PseudoRandom()).size());
|
||||
|
@ -114,12 +114,14 @@ TEST_F(CryConfigCreatorTest, ChoosesEmptyRootBlobId) {
|
||||
EXPECT_EQ("", config.RootBlob()); // This tells CryFS to create a new root blob
|
||||
}
|
||||
|
||||
#if CRYPTOPP_VERSION != 564
|
||||
TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_448) {
|
||||
AnswerNoToDefaultSettings();
|
||||
EXPECT_ASK_FOR_CIPHER().WillOnce(ChooseCipher("mars-448-gcm"));
|
||||
CryConfig config = creator.create(none, none);
|
||||
cpputils::Mars448_GCM::EncryptionKey::FromString(config.EncryptionKey()); // This crashes if invalid
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST_F(CryConfigCreatorTest, ChoosesValidEncryptionKey_256) {
|
||||
AnswerNoToDefaultSettings();
|
||||
|
Loading…
Reference in New Issue
Block a user