diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-08-10 19:03:47 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-10 19:03:47 +0000 |
commit | f36a4644b828bd9ad214a42511af91b4a1073eea (patch) | |
tree | 05231ac87adbac430efcb2b53a97c5886df15047 /core | |
parent | 70cca3663a0ea6c290b55c290ba5eb1f1c9db572 (diff) | |
download | pdfium-f36a4644b828bd9ad214a42511af91b4a1073eea.tar.xz |
Remove direct calls to timechromium/3519
Replaces them with calles to the proxy function, FXSYS_time, so that
tests may use a stable time value instead of the wall clock value.
BUG=pdfium:1104
Change-Id: I4743c4634f56d4a6cba1f1130c4562a35cee1887
Reviewed-on: https://pdfium-review.googlesource.com/39853
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdfapi/parser/cpdf_security_handler.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_security_handler.cpp b/core/fpdfapi/parser/cpdf_security_handler.cpp index caa82a9ddd..bc72ad3b33 100644 --- a/core/fpdfapi/parser/cpdf_security_handler.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler.cpp @@ -18,6 +18,7 @@ #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_object.h" #include "core/fpdfapi/parser/cpdf_string.h" +#include "core/fxcrt/fx_extension.h" namespace { @@ -531,7 +532,7 @@ void CPDF_SecurityHandler::OnCreateInternal(CPDF_Dictionary* pEncryptDict, owner_password_copy = user_password; if (m_Revision >= 5) { - int t = (int)time(nullptr); + int t = static_cast<int>(FXSYS_time(nullptr)); CRYPT_sha2_context sha; CRYPT_SHA256Start(&sha); CRYPT_SHA256Update(&sha, (uint8_t*)&t, sizeof t); |