From f36a4644b828bd9ad214a42511af91b4a1073eea Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 10 Aug 2018 19:03:47 +0000 Subject: Remove direct calls to time 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 Commit-Queue: Ryan Harrison --- core/fpdfapi/parser/cpdf_security_handler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core') 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(FXSYS_time(nullptr)); CRYPT_sha2_context sha; CRYPT_SHA256Start(&sha); CRYPT_SHA256Update(&sha, (uint8_t*)&t, sizeof t); -- cgit v1.2.3