]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/cpp/src/parquet/encryption/encryption_internal_nossl.cc
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / cpp / src / parquet / encryption / encryption_internal_nossl.cc
CommitLineData
1d09f67e
TL
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#include "parquet/encryption/encryption_internal.h"
19#include "parquet/exception.h"
20
21namespace parquet {
22namespace encryption {
23
24void ThrowOpenSSLRequiredException() {
25 throw ParquetException(
26 "Calling encryption method in Arrow/Parquet built without OpenSSL");
27}
28
29class AesEncryptor::AesEncryptorImpl {};
30
31AesEncryptor::~AesEncryptor() {}
32
33int AesEncryptor::SignedFooterEncrypt(const uint8_t* footer, int footer_len,
34 const uint8_t* key, int key_len, const uint8_t* aad,
35 int aad_len, const uint8_t* nonce,
36 uint8_t* encrypted_footer) {
37 ThrowOpenSSLRequiredException();
38 return -1;
39}
40
41void AesEncryptor::WipeOut() { ThrowOpenSSLRequiredException(); }
42
43int AesEncryptor::CiphertextSizeDelta() {
44 ThrowOpenSSLRequiredException();
45 return -1;
46}
47
48int AesEncryptor::Encrypt(const uint8_t* plaintext, int plaintext_len, const uint8_t* key,
49 int key_len, const uint8_t* aad, int aad_len,
50 uint8_t* ciphertext) {
51 ThrowOpenSSLRequiredException();
52 return -1;
53}
54
55AesEncryptor::AesEncryptor(ParquetCipher::type alg_id, int key_len, bool metadata) {
56 ThrowOpenSSLRequiredException();
57}
58
59class AesDecryptor::AesDecryptorImpl {};
60
61int AesDecryptor::Decrypt(const uint8_t* plaintext, int plaintext_len, const uint8_t* key,
62 int key_len, const uint8_t* aad, int aad_len,
63 uint8_t* ciphertext) {
64 ThrowOpenSSLRequiredException();
65 return -1;
66}
67
68void AesDecryptor::WipeOut() { ThrowOpenSSLRequiredException(); }
69
70AesDecryptor::~AesDecryptor() {}
71
72AesEncryptor* AesEncryptor::Make(ParquetCipher::type alg_id, int key_len, bool metadata,
73 std::vector<AesEncryptor*>* all_encryptors) {
74 return NULLPTR;
75}
76
77AesDecryptor::AesDecryptor(ParquetCipher::type alg_id, int key_len, bool metadata) {
78 ThrowOpenSSLRequiredException();
79}
80
81AesDecryptor* AesDecryptor::Make(ParquetCipher::type alg_id, int key_len, bool metadata,
82 std::vector<AesDecryptor*>* all_decryptors) {
83 return NULLPTR;
84}
85
86int AesDecryptor::CiphertextSizeDelta() {
87 ThrowOpenSSLRequiredException();
88 return -1;
89}
90
91std::string CreateModuleAad(const std::string& file_aad, int8_t module_type,
92 int16_t row_group_ordinal, int16_t column_ordinal,
93 int16_t page_ordinal) {
94 ThrowOpenSSLRequiredException();
95 return "";
96}
97
98std::string CreateFooterAad(const std::string& aad_prefix_bytes) {
99 ThrowOpenSSLRequiredException();
100 return "";
101}
102
103void QuickUpdatePageAad(const std::string& AAD, int16_t new_page_ordinal) {
104 ThrowOpenSSLRequiredException();
105}
106
107void RandBytes(unsigned char* buf, int num) { ThrowOpenSSLRequiredException(); }
108
109} // namespace encryption
110} // namespace parquet