Change-Id: Iab602ca7fe596976ae8bade4703db0dbd8170473
const Password &oldPass,
const Password &newPass)
{
- if (domainKEKInWrapForm.size() != sizeof(WrappedKeyAndInfo)) {
+ if (domainKEKInWrapForm.size() != sizeof(WrappedKeyAndInfoDKEK)) {
LogError("input size:" << domainKEKInWrapForm.size()
- << " Expected: " << sizeof(WrappedKeyAndInfo));
+ << " Expected: " << sizeof(WrappedKeyAndInfoDKEK));
ThrowErr(Exc::InternalError,
"buffer doesn't have proper size to store "
"WrappedKeyAndInfo in KeyProvider::reencrypt");
FileSystem fs(UID);
auto wrappedDKEK = fs.getDKEK();
auto keyProvider = KeyProvider(wrappedDKEK, DBPASS);
+ if (!keyProvider.isInitialized()) {
+ keyProvider.migrateDKEK(wrappedDKEK, DBPASS);
+ fs.saveDKEK(keyProvider.getWrappedDomainKEK(DBPASS));
+ }
auto wrappedDatabaseDEK = fs.getDBDEK();
RawBuffer key = keyProvider.getPureDEK(wrappedDatabaseDEK);