Skip to content

Commit

Permalink
feat(mbedtls): cherry-pick openthread#9492 manually.
Browse files Browse the repository at this point in the history
  • Loading branch information
zwx1995esp committed Oct 10, 2023
1 parent e64ba13 commit 04af482
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
- uses: actions/checkout@v2
with:
repository: ARMmbed/mbedtls
ref: v3.2.1
ref: v3.5.0
path: third_party/mbedtls/repo
- name: Build
run: |
Expand Down
4 changes: 4 additions & 0 deletions src/core/crypto/pbkdf2_cmac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ void GenerateKey(const uint8_t *aPassword,
uint16_t aKeyLen,
uint8_t * aKey)
{
#if (MBEDTLS_VERSION_NUMBER >= 0x03050000)
const size_t kBlockSize = MBEDTLS_CMAC_MAX_BLOCK_SIZE;
#else
const size_t kBlockSize = MBEDTLS_CIPHER_BLKSIZE_MAX;
#endif
uint8_t prfInput[kMaxSaltLength + 4]; // Salt || INT(), for U1 calculation
long prfOne[kBlockSize / sizeof(long)];
long prfTwo[kBlockSize / sizeof(long)];
Expand Down
6 changes: 6 additions & 0 deletions third_party/mbedtls/mbedtls-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@
#include MBEDTLS_USER_CONFIG_FILE
#endif

#include "mbedtls/version.h"
// Include in the legacy config name adjustment file for mbedtls >= 3.5.0
#if (MBEDTLS_VERSION_NUMBER >= 0x03050000)
#include "mbedtls/config_adjust_legacy_crypto.h"
#endif

#include "mbedtls/check_config.h"

#endif /* MBEDTLS_CONFIG_H */

0 comments on commit 04af482

Please sign in to comment.