Make FileEncryptionKey fields private.

GitOrigin-RevId: 06ec5e24b9154e1830fd3d37b833df60609c675a
This commit is contained in:
levlam 2019-10-24 20:17:37 +03:00
parent 0d375251a4
commit a0fa744735
2 changed files with 6 additions and 5 deletions

View File

@ -86,14 +86,15 @@ struct FileEncryptionKey {
}
}
friend bool operator==(const FileEncryptionKey &lhs, const FileEncryptionKey &rhs) {
return lhs.key_iv_ == rhs.key_iv_;
}
private:
string key_iv_; // TODO wrong alignment is possible
Type type_ = Type::None;
};
inline bool operator==(const FileEncryptionKey &lhs, const FileEncryptionKey &rhs) {
return lhs.key_iv_ == rhs.key_iv_;
}
inline bool operator!=(const FileEncryptionKey &lhs, const FileEncryptionKey &rhs) {
return !(lhs == rhs);
}

View File

@ -1278,7 +1278,7 @@ static int merge_choose_encryption_key(const FileEncryptionKey &a, const FileEnc
if (a.empty() != b.empty()) {
return a.empty() > b.empty();
}
if (a.key_iv_ != b.key_iv_) {
if (a != b) {
return -1;
}
return 2;