MCPcopy Create free account
hub / github.com/apache/impala / InitializeFields

Method InitializeFields

be/src/util/openssl-util.cc:578–596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578Status EncryptionKey::InitializeFields(const uint8_t* key, int key_len, const uint8_t* iv,
579 int iv_len, AES_CIPHER_MODE m) {
580 RETURN_IF_ERROR(ValidateModeAndKeyLength(m, key_len));
581 if (!IsModeSupported(m, true)) {
582 return Status(Substitute("AES mode $0 is not supported by OpenSSL version ($1) "
583 "that Impala was built against.", ModeToString(m), OPENSSL_VERSION_TEXT));
584 }
585
586 mode_ = m;
587
588 key_length_ = key_len;
589 iv_length_ = iv_len;
590 memcpy(key_, key, key_length_);
591 if (iv_length_ != 0) {
592 memcpy(iv_, iv, iv_length_);
593 }
594 initialized_ = true;
595 return Status::OK();
596}
597
598void EncryptionKey::SetGcmTag(const uint8_t* tag) {
599 memcpy(gcm_tag_, tag, AES_BLOCK_SIZE);

Callers 2

InitializeEncryptionKeyFunction · 0.80
TEST_FFunction · 0.80

Calls 4

ValidateModeAndKeyLengthFunction · 0.85
SubstituteFunction · 0.85
OKFunction · 0.85
StatusClass · 0.70

Tested by 1

TEST_FFunction · 0.64