-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting custom initialization vector for FileAccessEncrypted. Add export setting to set static seed for PCK encryption initialization vectors. #98918
Conversation
8289472
to
7a31bb3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the compat method name, seems good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested but looks good
4306c06
to
839351d
Compare
Needs to be rebased before this can be merged |
core/io/file_access_encrypted.cpp
Outdated
if (p_iv.is_empty()) { | ||
iv.resize(16); | ||
for (int i = 0; i < 16; i++) { | ||
iv.write[i] = Math::rand() % 256; | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the full context here, but does the init-vector not need to be securely random? As repeated invocations of Math::rand()
probably have rather low entropy...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think it matters in this case, but changed it to CryptoCore::RandomGenerator
just in case.
…dd export setting to set static seed for PCK encryption initialization vectors.
Thanks! |
FileAccessEncrypted
.seed + file hash
are used to generate IV, if zero IV is fully random (old behavior).Fixes #98904