-
Notifications
You must be signed in to change notification settings - Fork 144
Xaes 256 gcm #2740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xaes 256 gcm #2740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 14. Check the log or trigger a new build to see more.
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1622:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1631:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1666:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1675:
- en;
+ en = 0;
crypto/cipher_extra/cipher_test.cc
Outdated
CHECK_ERROR(EVP_EncryptFinal(ctx.get(), out_vec.data(), &out_len), ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
CHECK_ERROR(EVP_DecryptUpdate(ctx.get(), out_vec.data(), &out_len, in_vec.data(), in_len), ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
CHECK_ERROR(EVP_DecryptFinal(ctx.get(), out_vec.data(), &out_len), ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); | ||
int ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
int ciphertext_len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
int ciphertext_len; | ||
ASSERT_TRUE(EVP_CipherUpdate(ctx.get(), (uint8_t*)ciphertext.data(), &ciphertext_len, | ||
plaintext.data(), plaintext.size())); | ||
int len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'len' is not initialized [cppcoreguidelines-init-variables]
int len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1537: Value stored to 'plaintext_len' is never read
^
crypto/cipher_extra/cipher_test.cc
Outdated
int aad_len = aad.size(); | ||
ASSERT_EQ(aad_len, EVP_Cipher(ctx.get(), NULL, aad.data(), aad_len)); | ||
|
||
int ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
int ciphertext_len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
int ciphertext_len; | ||
ASSERT_TRUE(EVP_CipherUpdate(ctx.get(), (uint8_t*)ciphertext.data(), &ciphertext_len, | ||
plaintext.data(), plaintext.size())); | ||
int len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'len' is not initialized [cppcoreguidelines-init-variables]
int len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1634: Value stored to 'plaintext_len' is never read
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_xaes_256_gcm) { | ||
memset(out, 0, sizeof(EVP_CIPHER)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_CIPHER));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:1896: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_CIPHER));
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an OPENSSL_memset
that should be used internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for letting me know!
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_xaes_256_gcm_key_commit) { | ||
memset(out, 0, sizeof(EVP_CIPHER)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_CIPHER));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:1969: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_CIPHER));
^
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_xaes_256_gcm) { | ||
memset(out, 0, sizeof(EVP_AEAD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_AEAD));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:2076: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_AEAD));
^
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_xaes_256_gcm_key_commit) { | ||
memset(out, 0, sizeof(EVP_AEAD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_AEAD));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:2157: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_AEAD));
^
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2740 +/- ##
==========================================
+ Coverage 78.89% 78.98% +0.08%
==========================================
Files 677 677
Lines 115526 116001 +475
Branches 16249 16288 +39
==========================================
+ Hits 91150 91618 +468
- Misses 23579 23584 +5
- Partials 797 799 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_xaes_256_gcm) { | ||
memset(out, 0, sizeof(EVP_CIPHER)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_CIPHER));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:1904: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_CIPHER));
^
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_xaes_256_gcm_key_commit) { | ||
memset(out, 0, sizeof(EVP_CIPHER)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_CIPHER));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:1967: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_CIPHER));
^
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_xaes_256_gcm) { | ||
memset(out, 0, sizeof(EVP_AEAD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_AEAD));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:2074: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_AEAD));
^
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_xaes_256_gcm_key_commit) { | ||
memset(out, 0, sizeof(EVP_AEAD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_AEAD));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:2155: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_AEAD));
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/fipsmodule/cipher/e_aes.c
Outdated
} | ||
|
||
DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_xaes_256_gcm) { | ||
memset(out, 0, sizeof(EVP_CIPHER)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
memset(out, 0, sizeof(EVP_CIPHER));
^
Additional context
crypto/fipsmodule/cipher/e_aes.c:1906: Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11
memset(out, 0, sizeof(EVP_CIPHER));
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1716:
- en;
+ en = 0;
ASSERT_TRUE(EVP_CIPHER_CTX_ctrl(ctx.get(), EVP_CTRL_AEAD_SET_IVLEN, 24, NULL)); | ||
ASSERT_TRUE(EVP_CipherInit_ex(ctx.get(), NULL, NULL, key, nonce, -1)); | ||
|
||
int ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
int ciphertext_len; | |
= 0 |
ASSERT_TRUE(EVP_CipherUpdate(ctx.get(), (uint8_t*)ciphertext.data(), &ciphertext_len, | ||
plaintext, plaintext_len)); | ||
|
||
int len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'len' is not initialized [cppcoreguidelines-init-variables]
int len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
int aad_len = aad.size(); | ||
ASSERT_EQ(aad_len, EVP_Cipher(ctx.get(), NULL, aad.data(), aad_len)); | ||
|
||
int ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
int ciphertext_len; | |
= 0 |
ASSERT_TRUE(EVP_CipherUpdate(ctx.get(), (uint8_t*)ciphertext.data(), &ciphertext_len, | ||
plaintext.data(), plaintext.size())); | ||
|
||
int len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'len' is not initialized [cppcoreguidelines-init-variables]
int len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
size_t plaintext_len; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
|
||
decrypted.resize(plaintext.size()); | ||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1617: Value stored to 'plaintext_len' is never read
^
crypto/cipher_extra/cipher_test.cc
Outdated
|
||
plaintext_len = len; | ||
ASSERT_TRUE(EVP_DecryptFinal(dctx.get(), (uint8_t*)decrypted.data() + len, &len)); | ||
plaintext_len += len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1622: Value stored to 'plaintext_len' is never read
^
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1715: Value stored to 'plaintext_len' is never read
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1628:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1660:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1674:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1715:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1724:
- en;
+ en = 0;
#define NUM_NID 999 | ||
#define NUM_NID 1001 | ||
|
||
static const uint8_t kObjectData[] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'uint8_t' [clang-diagnostic-error]
static const uint8_t kObjectData[] = {
^
0x32, | ||
}; | ||
|
||
static const ASN1_OBJECT kObjects[NUM_NID] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: unknown type name 'ASN1_OBJECT' [clang-diagnostic-error]
static const ASN1_OBJECT kObjects[NUM_NID] = {
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1728:
- en;
+ en = 0;
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1738: Value stored to 'plaintext_len' is never read
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 16. Check the log or trigger a new build to see more.
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1630:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1661:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1675:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1729:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1740:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1780:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1791:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1819:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1832:
- en;
+ en = 0;
crypto/cipher_extra/cipher_test.cc
Outdated
|
||
decrypted.resize(plaintext.size()); | ||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1604: Value stored to 'plaintext_len' is never read
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 10 out of 18. Check the log or trigger a new build to see more.
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1629:
- en;
+ en = 0;
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1728:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1739:
- en;
+ en = 0;
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t ciphertext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1779:
- en;
+ en = 0;
crypto/cipher_extra/aead_test.cc
Outdated
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm(), key, 32, tag_size, nullptr)); | ||
|
||
size_t plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1790:
- en;
+ en = 0;
bssl::ScopedEVP_AEAD_CTX ctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t ciphertext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1818:
- en;
+ en = 0;
bssl::ScopedEVP_AEAD_CTX dctx; | ||
ASSERT_TRUE(EVP_AEAD_CTX_init(dctx.get(), EVP_aead_xaes_256_gcm_key_commit(), key.data(), key.size(), tag_size, nullptr)); | ||
|
||
size_t plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
crypto/cipher_extra/aead_test.cc:1831:
- en;
+ en = 0;
ASSERT_TRUE(EVP_CIPHER_CTX_ctrl(ctx.get(), EVP_CTRL_AEAD_SET_IVLEN, iv.size(), NULL)); | ||
ASSERT_TRUE(EVP_CipherInit_ex(ctx.get(), NULL, NULL, key.data(), iv.data(), -1)); | ||
|
||
int ciphertext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ciphertext_len' is not initialized [cppcoreguidelines-init-variables]
int ciphertext_len = 0; | |
= 0 |
std::vector<uint8_t> decrypted; | ||
decrypted.resize(plaintext.size()); | ||
len = 0; | ||
size_t plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'plaintext_len' is not initialized [cppcoreguidelines-init-variables]
size_t plaintext_len = 0; | |
= 0 |
crypto/cipher_extra/cipher_test.cc
Outdated
|
||
decrypted.resize(plaintext.size()); | ||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1603: Value stored to 'plaintext_len' is never read
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/cipher_extra/cipher_test.cc
Outdated
|
||
plaintext_len = len; | ||
ASSERT_TRUE(EVP_DecryptFinal(dctx.get(), (uint8_t*)decrypted.data() + len, &len)); | ||
plaintext_len += len; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1608: Value stored to 'plaintext_len' is never read
^
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1863: Value stored to 'plaintext_len' is never read
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
crypto/cipher_extra/cipher_test.cc
Outdated
ASSERT_EQ((size_t)aad_len, aad.size()); | ||
|
||
len = 0; | ||
plaintext_len = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: Value stored to 'plaintext_len' is never read [clang-analyzer-deadcode.DeadStores]
^
Additional context
crypto/cipher_extra/cipher_test.cc:1859: Value stored to 'plaintext_len' is never read
^
Issues:
Resolves #ISSUE-NUMBER1
Addresses #ISSUE-NUMBER2
Description of changes:
Describe AWS-LC’s current behavior and how your code changes that behavior. If there are no issues this pr is resolving, explain why this change is necessary.
Call-outs:
Point out areas that need special attention or support during the review process. Discuss architecture or design changes.
Testing:
How is this change tested (unit tests, fuzz tests, etc.)? Are there any testing steps to be verified by the reviewer?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.