Hello,
The entropy module uses a hash to mix the entropy. It uses SHA-512 if
present and SHA-256 otherwise. Depending on the hash function, the
entropy module can return either up to 64 bytes (SHA-512) or 32 bytes
(SHA-256). The CTR_DRBG module knows about this and requests only 32
bytes at a time if the entropy module only delivers 32 bytes at a time.
It looks like something goes wrong when CTR_DRBG tries to request 64
bytes. This could be, for example, because a buffer is too small
somewhere, or because of a limitation of the entropy source. You would
need to debug the call to mbedtls_entropy_func to know more.
As a workaround, you can enable MBEDTLS_ENTROPY_FORCE_SHA256. Then the
entropy module will use SHA-256 (even if MBEDTLS_SHA512_C is enabled)
and only return 32 bytes at a time, and CTR_DRBG understands this and
will only request 32 bytes.
--
Gilles Peskine
Mbed TLS developer
On 27/01/2021 06:08, T V LIJIN (EXT) via mbed-tls wrote:
> Hi,
> After enabling *MBEDTLS_NO_PLATFORM_ENTROPY* and*MBEDTLS_SHA512_C* ,
> /mbedtls_ctr_drbg_seed/ is returning *0x0034
> */(MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED)/
> But if I just enable *MBEDTLS_NO_PLATFORM_ENTROPY* and keep
> *MBEDTLS_SHA512_C* disabled, it does not return any error for
> /mbedtls_ctr_drbg_seed./
> /
> /
> My project uses certificates with SHA384 signature, so it
> requires***MBEDTLS_SHA512_C *to be enabled.
> /*MBEDTLS_NO_PLATFORM_ENTROPY* and*MBEDTLS_SHA512_C* /both needs to be
> enabled in my project , but Iam facing issue with
> mbedtls_ctr_drbg_seed returning 0x0034. Please guide me on this. What
> might be the reason for mbedtls_ctr_drbg_seed to fail while
> enabling/////*MBEDTLS_SHA512_C.*/////
> How to overcome this issue?
>
>
> Thanks,
> LIJIN T V
>
Hi,
After enabling MBEDTLS_NO_PLATFORM_ENTROPY and MBEDTLS_SHA512_C , mbedtls_ctr_drbg_seed is returning 0x0034 (MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED)
But if I just enable MBEDTLS_NO_PLATFORM_ENTROPY and keep MBEDTLS_SHA512_C disabled, it does not return any error for mbedtls_ctr_drbg_seed.
My project uses certificates with SHA384 signature, so it requires MBEDTLS_SHA512_C to be enabled.
MBEDTLS_NO_PLATFORM_ENTROPY and MBEDTLS_SHA512_C both needs to be enabled in my project , but Iam facing issue with mbedtls_ctr_drbg_seed returning 0x0034. Please guide me on this. What might be the reason for mbedtls_ctr_drbg_seed to fail while enabling MBEDTLS_SHA512_C.
How to overcome this issue?
Thanks,
LIJIN T V
Hi,
I'm trying to optimize the size of my binary file by making the following changes in "mbedtls/config.h"
#define MBEDTLS_MPI_WINDOW_SIZE 1
#define MBEDTLS_MPI_MAX_SIZE 32
#define MBEDTLS_ECP_MAX_BITS 256
#define MBEDTLS_SHA256_SMALLER
Even after making the above changes I couldn't see any change in the binary size.
https://tls.mbed.org/kb/how-to/reduce-mbedtls-memory-and-storage-footprint - This is the link I referred to follow the above-mentioned steps.
Is there anything else I can try to reduce my final binary file size (ROM size) ?
Thanks,
LIJIN T V
Dear,
In our project, our device should act as both client and server. Is it
possible for both TLS and DTLS? If yes, how about the certificate? Do we
need only 2 certs for this divice (one for the server role and one for
the client role)?
Best regards,
Farhad
Hello,
There is work in progress by community members to implement PKCS#7
SignedData parsing and generation.
https://github.com/ARMmbed/mbedtls/pull/3970https://github.com/ARMmbed/mbedtls/pull/3431
Arm has no particular plans in this area, but if you need other parts of
PKCS#7, we'd be happy to accept more contributions. We'll can't commit
to doing any development, but we'll assist with submissions and review
code as usual.
--
Gilles Peskine
Mbed TLS developer
On 13/01/2021 07:31, Subramanian Gopi Krishnan via mbed-tls wrote:
>
> Hi,
>
>
>
> Is there a plan to support PKCS#7 Certificate in
> future? We are work with rfc7030 service, which issues certificate in
> PKCS#7 format.
>
>
>
> Thanks,
>
> Gopi Krishnan
>
>
Hi,
Is there a plan to support PKCS#7 Certificate in future? We are work with rfc7030 service, which issues certificate in PKCS#7 format.
Thanks,
Gopi Krishnan
This is a notice that Mbed TLS 2.7 will no longer be supported or maintained after February 5th 2021. Mbed TLS 2.7.0 was released on February 5th 2018 with a three year support period.
The current version of Mbed TLS 2.7 is 2.7.18, which was released on December 11th 2020. There are no pending bug or security fixes, so unless new issues arise during the next month, there will not be another release of 2.7. We do not plan to merge any non-critical backports to 2.7 in the next month.
We recommend that where practical, users upgrade to either 2.16, which will be supported until the end of 2021, or to the development branch, which will be released as an LTS in mid 2021, with an expected support period until mid 2024.
Dave Rodgman
Hi,
Hanno suggested me to post our discussion here:
We use mbedtls in Facebook family apps. One of missing features is the ability to delegate cert verification to application. Hanno has pointed us to a similar ask in https://github.com/ARMmbed/mbedtls/pull/2091
We implemented cert verification process in Android/java and iOS/objective-C. Having this feature enables us to use the OS module for cert verification. The motivation is reduced maintenance cost. Some mobile APPs use OS TLS stack (rather than bundle mbedtls or openssl in the binary), so we have to maintain our OS-specific cert verification modules anyways. It’ll be ideal if we only keep the Android and iOS implementations as source of truth.
Any thoughts on supporting this?
Thanks,
Junqi
Hi all,
Back in June 2019, we added support for the experimental DTLS Connection ID extension in Mbed TLS 2.18.0. This extension makes it possible to keep a connection alive even when the client's connectivity changes (eg new IP address). Since this was based on a draft rather than an established standard, it is disabled in the default config, and the option to enable it comes with a warning about us not being able to make any stability promises.
As it turns out, a couple of months ago an extension number was assigned by IANA for this extension, which is different from the one we picked up when implementing the draft, so we'll have to change that in a future version of Mbed TLS. This change is trivial to do but would break compatibility in the following sense: and old client and a new server (or a new client and a new server) would no longer be able to negotiate this extension; only old-old and new-new would work. (Thanks to Achim Kraus for bringing that to our attention by the way: https://github.com/ARMmbed/mbedtls/issues/3892 )
One obvious solution to that issue would be to make sure all users upgrade all the clients and the servers at the same time. This can probably be managed in a development/testing environment as well as some tightly controlled production environments, but is probably less suitable for large-scale deployments where clients and servers might not even be manged by the same party.
So, before we plan this changed, we'll like to know if anyone already has a production deployment relying on Connection ID where updating all the clients and servers at the same time would not be an option.
If that is the case, we may consider implementing a compatibility mode that would allow a server to negotiate use of the extension with both old and new clients. However, such compatibility code would be non-standard and a testing burden (not to mention, significantly more work that just updating the relevant #define), so that's something we'd like to avoid doing unless we know that there is an actual need for it.
Please let us know what you think by replying to this email either on-list, or privately if you'd rather not share deployment information publicly (in that case, please mention it explicitly so that we know you didn't just forget to Cc the list).
Thanks,
Manuel
Dear Xiao Nian Jun,
Thanks for your response! Knowing the practical impact of the issue will help us prioritize it.
Best regards,
Manuel
________________________________
From: Xiao, Nian Jun <nianjun.xiao(a)siemens.com>
Sent: 29 December 2020 02:43
To: Manuel Pegourie-Gonnard <Manuel.Pegourie-Gonnard(a)arm.com>
Cc: He, Shu Shan <shushan.he(a)siemens.com>; Xia, Juan <juan.xia(a)siemens.com>
Subject: RE: MBEDTLS issue I found
Dear Manuel,
Really appreciate for your quick and detail feedback.
We think this is more like an interoperability issue, we found this issue during we developing webserver feature using MBEDTLS. Google Chrome treat such certificate as invalid. Follow below steps will reproduce this issue.
1. Generate a self-signed root certificate with ECC256 key.(using genKey and certWrite program of MBEDTLS)
2. Using above root certificate to sign a device certificate which also using ECC256 as its private key. (using genKey and certWrite program of MBEDTLS)
3. Install root certificate so Chrome can see it.
4. using Nginx or some other opensource web server, modify its configuration so it will use the device certificate and corresponding private key as the ciphers to setup TLS communication.
5. Open Chrome and visit default Nginx web page(or some other web server tools’ default web page), you can see Chrome won’t let user to continue because it treat the device certificate as invalid.
6. According to our test, Chrome has this issue, fire fox, IE, etc. doesn’t have this issue.
7. If I modify function mbedtls_asn1_write_algorithm_identifier like I said yesterday, Chrome will accept it and other browser also will accept it, happy life back again.
Have a good day and looking for your feedback again!
B.R.
Xiao Nian Jun.
From: Manuel Pegourie-Gonnard <Manuel.Pegourie-Gonnard(a)arm.com>
Sent: Monday, December 28, 2020 9:23 PM
To: mbed-tls(a)lists.trustedfirmware.org; Xiao, Nian Jun (RC-CN DI FA BL CTR-SL PRC2) <nianjun.xiao(a)siemens.com>
Cc: He, Shu Shan (RC-CN DI FA BL CTR-SL PRC2) <shushan.he(a)siemens.com>
Subject: Re: MBEDTLS issue I found
Dear Xiao Nian Jun,
Thanks for your kind words and for reporting this issue you found.
I checked RFC 7427 and indeed while parameters must be present and NULL for all RSA algorithms, appendix A.3 is clear that they must be absent for ECDSA. Since RFC 7427 is about IKEv2 rather than about X.509 certificates, I also checked RFC 5480 (updating RFC 3279 which defines the X.509 profile used by the IETF), and it concurs: for ECDSA, parameters are absent (appendix A).
Our behaviour is not conformant, and this should be fixed. Just to help us evaluate the severity of the issue, I'd like to know if this is something you found by inspecting the generated certificate yourself, or if it caused the generate certificate to be rejected by some other X.509 implementation or verification tool. Said otherwise, is this only a compliance issue, or also an interoperability issue?
Regarding your fix, I think it works as long as you are only generating ECC-signed X.509 certificates, but as you suggest, I'm afraid it only fixes the problem by creating another one: it would suppress the NULL parameters for RSA as well, but unfortunately, they're mandatory there (I wish the standards were more consistent). So, we'll probably have to do something similar, but only for ECDSA.
I was going to create a ticket for that in our bug tracker when I noticed we already have a ticket tracking that: https://github.com/ARMmbed/mbedtls/issues/2924 - Ill add a link to your message in the ticket.
Thanks again for your report.
Best regards,
Manuel
________________________________
From: mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org<mailto:mbed-tls-bounces@lists.trustedfirmware.org>> on behalf of Xiao, Nian Jun via mbed-tls <mbed-tls(a)lists.trustedfirmware.org<mailto:mbed-tls@lists.trustedfirmware.org>>
Sent: 28 December 2020 03:24
To: mbed-tls(a)lists.trustedfirmware.org<mailto:mbed-tls@lists.trustedfirmware.org> <mbed-tls(a)lists.trustedfirmware.org<mailto:mbed-tls@lists.trustedfirmware.org>>
Cc: He, Shu Shan <shushan.he(a)siemens.com<mailto:shushan.he@siemens.com>>
Subject: [mbed-tls] MBEDTLS issue I found
Dear MBEDTLS team,
I’m a developer at SIEMENS, my name is Xiao Nian Jun. Please accept my sincere gratitude for your excellent work and to spend extra time to read my email.
We are using MBEDTLS to generate ECC key and certificates, we found an issue regarding algorithm identifier in the final ASN.1 certificate. For certificate signed by ECC key, the algorithm identifier is “NULL” which doesn’t conforms to RFC7427 specification.
[cid:image001.png@01D6DDC1.DCE8CFC0]
You can see the “NULL” string in the certificate, Chrome will treat this kind of certificate as invalid.
This issue has blocked us for a while, and after some investigation, we found an easy fix –- probably immature fix --- to make it works right--- we just commented out this line of code “MBEDTLS_ASN1_CHK_ADD( len, mbedtls_asn1_write_null( p, start ) )" in function mbedtls_asn1_write_algorithm_identifier.
To be honesty, we’ve been using MBEDTLS for very short time, probably this is not an issue, probably our fix will end up break up something…currently, it’s just looks correct.
Please check if my fix works or not, if not, please do not hesitate to correct me.
B.R.
Xiao Nian Jun.