From b1469a2c89d338c7fc3e9029405c8bc7e1018b84 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 10:00:05 -0700 Subject: Move core/fdrm/crypto/include to core/fdrm/crypto BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2374413002 --- BUILD.gn | 2 +- core/fdrm/crypto/fx_crypt.cpp | 2 +- core/fdrm/crypto/fx_crypt.h | 71 ++++++++++++++++++++++ core/fdrm/crypto/fx_crypt_aes.cpp | 2 +- core/fdrm/crypto/fx_crypt_sha.cpp | 2 +- core/fdrm/crypto/include/fx_crypt.h | 71 ---------------------- core/fpdfapi/fpdf_page/fpdf_page_doc.cpp | 2 +- core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp | 2 +- core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp | 2 +- fpdfsdk/javascript/DEPS | 2 +- fpdfsdk/javascript/JS_GlobalData.cpp | 2 +- xfa/fxfa/app/DEPS | 2 +- xfa/fxfa/app/xfa_checksum.cpp | 2 +- 13 files changed, 82 insertions(+), 82 deletions(-) create mode 100644 core/fdrm/crypto/fx_crypt.h delete mode 100644 core/fdrm/crypto/include/fx_crypt.h diff --git a/BUILD.gn b/BUILD.gn index 22135300ac..a9c9d59a9d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -222,9 +222,9 @@ visibility = [ static_library("fdrm") { sources = [ "core/fdrm/crypto/fx_crypt.cpp", + "core/fdrm/crypto/fx_crypt.h", "core/fdrm/crypto/fx_crypt_aes.cpp", "core/fdrm/crypto/fx_crypt_sha.cpp", - "core/fdrm/crypto/include/fx_crypt.h", ] configs += [ ":pdfium_core_config" ] deps = [ diff --git a/core/fdrm/crypto/fx_crypt.cpp b/core/fdrm/crypto/fx_crypt.cpp index ed7ede0b5a..885b468839 100644 --- a/core/fdrm/crypto/fx_crypt.cpp +++ b/core/fdrm/crypto/fx_crypt.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #ifdef __cplusplus extern "C" { diff --git a/core/fdrm/crypto/fx_crypt.h b/core/fdrm/crypto/fx_crypt.h new file mode 100644 index 0000000000..bb9f4a9730 --- /dev/null +++ b/core/fdrm/crypto/fx_crypt.h @@ -0,0 +1,71 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_FDRM_CRYPTO_FX_CRYPT_H_ +#define CORE_FDRM_CRYPTO_FX_CRYPT_H_ + +#include "core/fxcrt/include/fx_system.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void CRYPT_ArcFourCryptBlock(uint8_t* data, + uint32_t size, + const uint8_t* key, + uint32_t keylen); +void CRYPT_ArcFourSetup(void* context, const uint8_t* key, uint32_t length); +void CRYPT_ArcFourCrypt(void* context, uint8_t* data, uint32_t size); +void CRYPT_AESSetKey(void* context, + uint32_t blocklen, + const uint8_t* key, + uint32_t keylen, + FX_BOOL bEncrypt); +void CRYPT_AESSetIV(void* context, const uint8_t* iv); +void CRYPT_AESDecrypt(void* context, + uint8_t* dest, + const uint8_t* src, + uint32_t size); +void CRYPT_AESEncrypt(void* context, + uint8_t* dest, + const uint8_t* src, + uint32_t size); +void CRYPT_MD5Generate(const uint8_t* data, uint32_t size, uint8_t digest[16]); +void CRYPT_MD5Start(void* context); +void CRYPT_MD5Update(void* context, const uint8_t* data, uint32_t size); +void CRYPT_MD5Finish(void* context, uint8_t digest[16]); +void CRYPT_SHA1Generate(const uint8_t* data, uint32_t size, uint8_t digest[20]); +void CRYPT_SHA1Start(void* context); +void CRYPT_SHA1Update(void* context, const uint8_t* data, uint32_t size); +void CRYPT_SHA1Finish(void* context, uint8_t digest[20]); +void CRYPT_SHA256Generate(const uint8_t* data, + uint32_t size, + uint8_t digest[32]); +void CRYPT_SHA256Start(void* context); +void CRYPT_SHA256Update(void* context, const uint8_t* data, uint32_t size); +void CRYPT_SHA256Finish(void* context, uint8_t digest[32]); +void CRYPT_SHA384Start(void* context); +void CRYPT_SHA384Update(void* context, const uint8_t* data, uint32_t size); +void CRYPT_SHA384Finish(void* context, uint8_t digest[48]); +void CRYPT_SHA384Generate(const uint8_t* data, + uint32_t size, + uint8_t digest[48]); +void CRYPT_SHA512Start(void* context); +void CRYPT_SHA512Update(void* context, const uint8_t* data, uint32_t size); +void CRYPT_SHA512Finish(void* context, uint8_t digest[64]); +void CRYPT_SHA512Generate(const uint8_t* data, + uint32_t size, + uint8_t digest[64]); +void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, + uint32_t size, + uint8_t* data_buf, + uint32_t& data_len)); + +#ifdef __cplusplus +}; +#endif + +#endif // CORE_FDRM_CRYPTO_FX_CRYPT_H_ diff --git a/core/fdrm/crypto/fx_crypt_aes.cpp b/core/fdrm/crypto/fx_crypt_aes.cpp index 1a6eab4283..27c064e19f 100644 --- a/core/fdrm/crypto/fx_crypt_aes.cpp +++ b/core/fdrm/crypto/fx_crypt_aes.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #ifdef __cplusplus extern "C" { diff --git a/core/fdrm/crypto/fx_crypt_sha.cpp b/core/fdrm/crypto/fx_crypt_sha.cpp index 222ab9eb80..eb3373cfb0 100644 --- a/core/fdrm/crypto/fx_crypt_sha.cpp +++ b/core/fdrm/crypto/fx_crypt_sha.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #ifdef __cplusplus extern "C" { diff --git a/core/fdrm/crypto/include/fx_crypt.h b/core/fdrm/crypto/include/fx_crypt.h deleted file mode 100644 index 155def6f88..0000000000 --- a/core/fdrm/crypto/include/fx_crypt.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_FDRM_CRYPTO_INCLUDE_FX_CRYPT_H_ -#define CORE_FDRM_CRYPTO_INCLUDE_FX_CRYPT_H_ - -#include "core/fxcrt/include/fx_system.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void CRYPT_ArcFourCryptBlock(uint8_t* data, - uint32_t size, - const uint8_t* key, - uint32_t keylen); -void CRYPT_ArcFourSetup(void* context, const uint8_t* key, uint32_t length); -void CRYPT_ArcFourCrypt(void* context, uint8_t* data, uint32_t size); -void CRYPT_AESSetKey(void* context, - uint32_t blocklen, - const uint8_t* key, - uint32_t keylen, - FX_BOOL bEncrypt); -void CRYPT_AESSetIV(void* context, const uint8_t* iv); -void CRYPT_AESDecrypt(void* context, - uint8_t* dest, - const uint8_t* src, - uint32_t size); -void CRYPT_AESEncrypt(void* context, - uint8_t* dest, - const uint8_t* src, - uint32_t size); -void CRYPT_MD5Generate(const uint8_t* data, uint32_t size, uint8_t digest[16]); -void CRYPT_MD5Start(void* context); -void CRYPT_MD5Update(void* context, const uint8_t* data, uint32_t size); -void CRYPT_MD5Finish(void* context, uint8_t digest[16]); -void CRYPT_SHA1Generate(const uint8_t* data, uint32_t size, uint8_t digest[20]); -void CRYPT_SHA1Start(void* context); -void CRYPT_SHA1Update(void* context, const uint8_t* data, uint32_t size); -void CRYPT_SHA1Finish(void* context, uint8_t digest[20]); -void CRYPT_SHA256Generate(const uint8_t* data, - uint32_t size, - uint8_t digest[32]); -void CRYPT_SHA256Start(void* context); -void CRYPT_SHA256Update(void* context, const uint8_t* data, uint32_t size); -void CRYPT_SHA256Finish(void* context, uint8_t digest[32]); -void CRYPT_SHA384Start(void* context); -void CRYPT_SHA384Update(void* context, const uint8_t* data, uint32_t size); -void CRYPT_SHA384Finish(void* context, uint8_t digest[48]); -void CRYPT_SHA384Generate(const uint8_t* data, - uint32_t size, - uint8_t digest[48]); -void CRYPT_SHA512Start(void* context); -void CRYPT_SHA512Update(void* context, const uint8_t* data, uint32_t size); -void CRYPT_SHA512Finish(void* context, uint8_t digest[64]); -void CRYPT_SHA512Generate(const uint8_t* data, - uint32_t size, - uint8_t digest[64]); -void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData, - uint32_t size, - uint8_t* data_buf, - uint32_t& data_len)); - -#ifdef __cplusplus -}; -#endif - -#endif // CORE_FDRM_CRYPTO_INCLUDE_FX_CRYPT_H_ diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp index 192e0947bc..bd217fcf99 100644 --- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp +++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp @@ -9,7 +9,7 @@ #include #include -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #include "core/fpdfapi/fpdf_font/cpdf_type1font.h" #include "core/fpdfapi/fpdf_font/font_int.h" #include "core/fpdfapi/fpdf_page/cpdf_pagemodule.h" diff --git a/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp index 6dfe918761..3dbe7b9570 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_crypto_handler.cpp @@ -8,7 +8,7 @@ #include -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #include "core/fpdfapi/fpdf_parser/cpdf_security_handler.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" diff --git a/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp index bf18028d7a..2920d470d9 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp @@ -8,7 +8,7 @@ #include -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #include "core/fpdfapi/fpdf_parser/cpdf_crypto_handler.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" diff --git a/fpdfsdk/javascript/DEPS b/fpdfsdk/javascript/DEPS index 5fb57284d1..1f6ae10df2 100644 --- a/fpdfsdk/javascript/DEPS +++ b/fpdfsdk/javascript/DEPS @@ -1,5 +1,5 @@ include_rules = [ - '+core/fdrm/crypto/include', + '+core/fdrm/crypto', '+core/fpdfapi/fpdf_font/include', '+fxjs/include' ] diff --git a/fpdfsdk/javascript/JS_GlobalData.cpp b/fpdfsdk/javascript/JS_GlobalData.cpp index eff785353f..c07fe24741 100644 --- a/fpdfsdk/javascript/JS_GlobalData.cpp +++ b/fpdfsdk/javascript/JS_GlobalData.cpp @@ -6,7 +6,7 @@ #include "fpdfsdk/javascript/JS_GlobalData.h" -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" #include "third_party/base/stl_util.h" #define JS_MAXGLOBALDATA (1024 * 4 - 8) diff --git a/xfa/fxfa/app/DEPS b/xfa/fxfa/app/DEPS index 53c19d1aa9..2f7428f6bf 100644 --- a/xfa/fxfa/app/DEPS +++ b/xfa/fxfa/app/DEPS @@ -1,5 +1,5 @@ include_rules = [ - '+core/fdrm/crypto/include', + '+core/fdrm/crypto', '+core/fpdfapi/fpdf_font/include', '+core/fpdfapi/fpdf_page/include', '+core/fpdfapi/fpdf_parser/include', diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 419f15bc34..73f6c1edd5 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -6,7 +6,7 @@ #include "xfa/fxfa/include/xfa_checksum.h" -#include "core/fdrm/crypto/include/fx_crypt.h" +#include "core/fdrm/crypto/fx_crypt.h" namespace { -- cgit v1.2.3