Skip to content

Commit

Permalink
deprecate AEAD_Mode::set_associated_data_vec()
Browse files Browse the repository at this point in the history
  • Loading branch information
reneme committed Feb 22, 2023
1 parent 024ba23 commit 7f0bce6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cli/pk_crypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class PK_Encrypt final : public Command

const Botan::secure_vector<uint8_t> nonce = rng().random_vec(aead->default_nonce_length());
aead->set_key(file_key);
aead->set_associated_data_vec(encrypted_key);
aead->set_associated_data(encrypted_key);
aead->start(nonce);

aead->finish(data);
Expand Down Expand Up @@ -203,7 +203,7 @@ class PK_Decrypt final : public Command
rng());

aead->set_key(file_key);
aead->set_associated_data_vec(encrypted_key);
aead->set_associated_data(encrypted_key);
aead->start(nonce);

try
Expand Down
1 change: 1 addition & 0 deletions src/lib/modes/aead/aead.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class BOTAN_PUBLIC_API(2,0) AEAD_Mode : public Cipher_Mode
* @param ad the associated data
*/
template<typename Alloc>
BOTAN_DEPRECATED("Simply use set_associated_data")
void set_associated_data_vec(const std::vector<uint8_t, Alloc>& ad)
{
set_associated_data(ad.data(), ad.size());
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tls/tls12/tls_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void decrypt_record(secure_vector<uint8_t>& output,

const size_t ptext_size = aead.output_length(msg_length);

aead.set_associated_data_vec(
aead.set_associated_data(
cs.format_ad(record_sequence,
record_type,
record_version,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tls/tls_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ Session::encrypt(const SymmetricKey& key, RandomNumberGenerator& rng) const
BOTAN_ASSERT_NOMSG(aead->valid_nonce_length(TLS_SESSION_CRYPT_AEAD_NONCE_LEN));
BOTAN_ASSERT_NOMSG(aead->tag_size() == TLS_SESSION_CRYPT_AEAD_TAG_SIZE);
aead->set_key(aead_key);
aead->set_associated_data_vec(buf);
aead->set_associated_data(buf);
aead->start(aead_nonce);
aead->finish(bits, 0);

Expand Down

0 comments on commit 7f0bce6

Please sign in to comment.