DRBG documentation improvements #287
No reviewers
Labels
No labels
api-spec
bug
CLA requested
CLA valid
compliance
DO NOT MERGE
duplicate
enhancement
feature branch
good first issue
HEADER FORMATTING ISSUE
help wanted
Information
invalid
Jira status: AWAITING REVIEW
Jira status: CLOSED
Jira status: DONE
Jira status: IN PROGRESS
Jira status: IN REVIEW
Jira status: OPEN
Jira status: REOPENED
Jira status: RESOLVED
mirrored
mirror internally
needs: backports
needs: ci
needs: design review
needs: preceding PR
needs: review
needs: work
notabug
open for community contribution
Product Backlog
question
ready for merge
security
stale
type: bug
type: enhancement
type: question
web pages
wontfix
writing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-ARMmbed/mbed-crypto!287
Loading…
Reference in a new issue
No description provided.
Delete branch "ctr_drbg-doc-nist-crypto"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Improve the documentation of the CTR_DRBG and HMAC_DRBG modules. This part is a straightfoward forward-port of https://github.com/ARMmbed/mbedtls/pull/2860: the 2.16 and 2.19 versions of
hmac_drbg.handctr_drbg.hwere near-identical and I changed them in identical ways.I am working on a separate pull request for the following changes (separate PR because it was getting really messy):
mbedtls_hmac_drbg_seed()andmbedtls_ctr_drbg_seed()overrode the entropy length in the DRBG context, so callingmbedtls_hmac_drbg_set_entropy_len()ormbedtls_ctr_drbg_set_entropy_len()before callingxxx_seed()had no effect. Change thexxx_seed()functions to respect the entropy length set withxxx_set_entropy_len().Backports: 2.16 in https://github.com/ARMmbed/mbedtls/pull/2860, 2.7 in https://github.com/ARMmbed/mbedtls/pull/2878.
Internal ref: IOTCRYPT-180, IOTCRYPT-457
CI failed in the Windows 2013 job. The failure is the CTR_DRBG selftest, The reason the selftest started failing is that I moved
MBEDTLS_CTR_DRBG_USE_128_BIT_KEYto a different section inconfig.pl, so it got included inconfig.pl full. Theselftestprogram has been failing whenMBEDTLS_CTR_DRBG_USE_128_BIT_KEYis enabled ever since we introduced this option (#290) but we didn't realize until now because we were never enabling this option on the CI (#289).I've excluded
MBEDTLS_CTR_DRBG_USE_128_BIT_KEYfromconfig.pl full. Fixing #289 and #290 is out of scope of this PR.The merge job passed except for
check-generated-files.shin TLS which is a known issue with a fix pending.The head job failed because of some Jenkins wonkiness that's unrelated to the PR.
What's the difference between
#MBEDTLS_CTR_DRBG_USE_128_BIT_KEYand\c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY? Since I can see that both of these versions are used.Didn't you mention previously that in such case the entropy len has to be at least 24?
#MACROtypesetsMACROand links to the definition ofMACROifMACROis defined, but typesets#MACROifMACROis undefined, so it isn't good for preprocessor symbols that may or may not be defined. Hence the use of\c MACROfor symbols that may or may not be defined.24 for the initial seeding, 16 for subsequent reseeds. This function only influences subsequent reseeds.
MBEDTLS_CTR_DRBG_ENTROPY_LENinfluences both.Shouldn't it be
\c MBEDTLS_CTR_DRBG_USE_128_BIT_KEYeverywhere then? Or will doxygen ignore blocks that won't get compiled?It can be
#MBEDTLS_CTR_DRBG_USE_128_BIT_KEYhere because this comment is surrounded by#ifdef MBEDTLS_CTR_DRBG_USE_128_BIT_KEY.CI ok. PR approved, near-identical PR for 2.16 approved, 2.7 backport approved. This is good to merge.