summaryrefslogtreecommitdiffstats
path: root/core/io/file_access_encrypted.h
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-11-07 12:32:02 +0200
committerPāvels Nadtočajevs <7645683+bruvzg@users.noreply.github.com>2024-11-13 08:16:12 +0200
commit45593d45b3873810792170906ba4d1b299d08bea (patch)
treeaecc17c021f87becf7a71e632a1d3ee81a702788 /core/io/file_access_encrypted.h
parentcb411fa960f0b7fdbd97dcdb4c90f9346360ee0e (diff)
downloadredot-engine-45593d45b3873810792170906ba4d1b299d08bea.tar.gz
Allow setting custom initialization vector for FileAccessEncrypted. Add export setting to set static seed for PCK encryption initialization vectors.
Diffstat (limited to 'core/io/file_access_encrypted.h')
-rw-r--r--core/io/file_access_encrypted.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h
index 5f8c803d60..63a8cab145 100644
--- a/core/io/file_access_encrypted.h
+++ b/core/io/file_access_encrypted.h
@@ -44,6 +44,7 @@ public:
};
private:
+ Vector<uint8_t> iv;
Vector<uint8_t> key;
bool writing = false;
Ref<FileAccess> file;
@@ -57,9 +58,11 @@ private:
void _close();
public:
- Error open_and_parse(Ref<FileAccess> p_base, const Vector<uint8_t> &p_key, Mode p_mode, bool p_with_magic = true);
+ Error open_and_parse(Ref<FileAccess> p_base, const Vector<uint8_t> &p_key, Mode p_mode, bool p_with_magic = true, const Vector<uint8_t> &p_iv = Vector<uint8_t>());
Error open_and_parse_password(Ref<FileAccess> p_base, const String &p_key, Mode p_mode);
+ Vector<uint8_t> get_iv() const { return iv; }
+
virtual Error open_internal(const String &p_path, int p_mode_flags) override; ///< open a file
virtual bool is_open() const override; ///< true when file is open