Hi
We are using mbedtls 2.28.9 and want to offload crypto operations to HSM
from NXP imx-secure-enclave.
is the below approach correct or please suggest alternate approaches if any?
1.Transition all apis from traditional apis to psa in modules
Use PSA crypto module
https://github.com/Mbed-TLS/mbedtls/blob/development/docs/psa-transition.md
2. Integrate PSA module with imx-secure-enclave in our custom mbedtls
3. All modules will use custom mbedtls which will internally offload crypto
operations to HSM
or Do you recommend to use MBEDTLS_PK_RSA_ALT_SUPPORT? and implement the
key creation/signing/export of public key operations ?
Thanks,
Kavitha
Hi!
We are working with Mbed TLS 3.6.0 library and need the following information:
1.
Is there any End-Of-Life date planned for this library?
2. What is the current version?
3. How can we obtain support for the library enquiries? Does this support has a cost?
4.
How is the library update? Does this update has a cost?
5.
Are this library Open Source?
Thanks in advance for your help! 🙂
Have a great day!
Héctor J. Solís Castillo
Embedded Engr I
Honeywell | HTS Building Automation
990, Av. Eje 5 Norte, Mexico City
CDMX
hectorjose.solis(a)honeywell.com<mailto:hectorjose.solis@honeywell.com>
honeywell.com<http://www.honeywell.com/>
Pronouns: He/Him<https://www.mypronouns.org/what-and-why>
Hello,
I have the following two certificate chains: server <- intermediateCA <-
rootCA and client <- intermediateCA <- rootCA.
Currently there are two ways the client is authenticated by the server:
both the intermediateCA and rootCA certificates are configured as CAs on
the server or if only intermediateCA is configured.
I am using a custom verify callback set by mbedtls_ssl_conf_verify().
I would like to achieve two separate cases:
1) Make the MbedTLS' built-in pre-verify be successful, even when only
the rootCA certificate is set as the server's CA.
2) Always obtain the whole certificate chain up to the root in the
verify callback.
For case 1) this is how our OpenSSL TLS implementation works, it is
discussed here <https://github.com/openssl/openssl/issues/7871>. From my
understanding the server should be able to build the certificate chain
by inquiring the client about its certificate's issuer, etc.
For case 2), whenever both rootCA and intermediateCA are configured on
the server, only the chain client <- intermediateCA is received by the
callback. I would like to be able to receive the chain client <-
intermediateCA <- rootCA.
Are these two cases achievable with mbedTLS? For reference I am using
mbedTLS 3.5.2. For my server I would like to utilize both cases 1) and
2) and for the client only the case 1).
Kind regards,
Roman Janota
Hello,
I notice in 'crypto.h' of mbedTLS 3.6.3, PSA_CRYPTO_API_VERSION_MAJOR & PSA_CRYPTO_API_VERSION_MINOR show the version implemented as v1.0.
Per the github page of TF-PSA-Crypto (https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/development/README.md), the implementation is of v1.1. I verified that this mismatch between the README and crypto.h exists on the development branch of TF-PSA-Crypto as well.
What is the correct version implemented, as of mbedTLS 3.6.3?
Regards,
Kevin
Hi,
I'm trying to build the mbedtls v3.6.3 for an embedded 386 device. The
build is configured as `crypto_baremetal`. In the snippet below I use the
make build process with a GCC 11.2 cross toolchain that's installed in
`/opt/x-tools/i386-elf but the build process ends with an error:
```
(venv) dev [ /workspaces/mbedtls ]$ make
CC=/opt/x-tools/i386-elf/bin/i386-elf-gcc
AR=/opt/x-tools/i386-elf/bin/i386-elf-ar
make[1]: Entering directory '/workspaces/mbedtls/library'
CC aes.c
CC aesni.c
CC aesce.c
...
CC src/certs.c
CC src/psa_test_wrappers.c
CC src/test_helpers/ssl_helpers.c
make[1]: Leaving directory '/workspaces/mbedtls/tests'
make[1]: Entering directory '/workspaces/mbedtls/programs'
CC aes/crypt_and_hash.c
/opt/x-tools/i386-elf/lib/gcc/i386-elf/11.2.0/../../../../i386-elf/bin/ld:
cannot find crt0.o: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:160: aes/crypt_and_hash] Error 1
make[1]: Leaving directory '/workspaces/mbedtls/programs'
make: *** [Makefile:34: programs] Error 2
(venv) dev [ /workspaces/mbedtls ]$
```
So I have two questions:
This error says it fails to link find crt0.o but the output
(library/libmbedcrypto.a) exists and looks ok (altho I've yet to try
linking against it). Is the error message spurious or is the library it
produced unusable?
Do I really need a version of crt0.o to link successfully? (The same
configuration builds with no errors using the host's x64 compiler toolchain
- and that toolchain also doesn't have a crt0.o file).
Thanks in advance!
Hi,
I'm the main developer of Leshan Library. This is a Java open source
implementation of LWM2M protocol hosted at Eclipse Foundation.
We currently use Scandium (from Californium Project) as DTLS library.
This library fits our needs until now but we have some concerns about
future-proofness of it (Especially, there is no plan for DTLS 1.3) and
there is no support of TLS.
So we explore some other way for the future.
I had consider to use OpenJdk but there is a lot of missing IoT
Features. I contact OpenJdk security dev and they makes me understand
politely that IoT is not the priority (at least this is my understanding)
Another solution we explore would be to use an mbedtls Java binding.
(as mbedtls is well supported and focus IoT)
There is a not official one at :
https://github.com/open-coap/kotlin-mbedtls
*Questions :
*
1. Is there any official java binding ?
2. If no, is there any plan for that kind of binding ?
3. If no, if there is a community initiative could it be hosted by you ?
Thx,
Simon
MBed-TLS Technical Forum - Asia
Every 4 weeks from 10am to 10:50am on Monday
United Kingdom Time
Trusted Firmware is inviting you to a scheduled Zoom meeting.Topic:
MBed-TLS Technical Forum - AsiaTime: Jun 16, 2025 10:00 AM London
Every 4 weeks on Mon, 39 occurrence(s)Please download and import the
following iCalendar (.ics) files to your calendar system.Weekly:
https://linaro-org.zoom.us/meeting/tJMqcuGuqDotGtIbACm498ytl0ZhydWKdu1b/ics…
Zoom
Meetinghttps://linaro-org.zoom.us/j/97758661706?pwd=baMjUvnWbY20z3ignQca7QVahhozkI.1Meeting
ID: 977 5866 1706Passcode: 577208---One tap
mobile+16892781000,,97758661706# US+17193594580,,97758661706# US---Dial by
your location• +1 689 278 1000 US• +1 719 359 4580 US• +1 253 205 0468 US•
+1 253 215 8782 US (Tacoma)• +1 301 715 8592 US (Washington DC)• +1 305 224
1968 US• +1 309 205 3325 US• +1 312 626 6799 US (Chicago)• +1 346 248 7799
US (Houston)• +1 360 209 5623 US• +1 386 347 5053 US• +1 507 473 4847 US•
+1 564 217 2000 US• +1 646 558 8656 US (New York)• +1 646 931 3860 US• +1
669 444 9171 US• +1 669 900 9128 US (San Jose)• 833 548 0282 US Toll-free•
833 928 4608 US Toll-free• 833 928 4609 US Toll-free• 833 928 4610 US
Toll-free• 877 853 5247 US Toll-free• 888 788 0099 US Toll-free• 833 548
0276 US Toll-freeMeeting ID: 977 5866 1706Find your local number:
https://linaro-org.zoom.us/u/acdtApJNbc
Guests
mbed-tls(a)lists.trustedfirmware.org
psa-crypto(a)lists.trustedfirmware.org
View all guest info
https://calendar.google.com/calendar/event?action=VIEW&eid=NjI4c3NnYjFoZHRh…
Reply for mbed-tls(a)lists.trustedfirmware.org and view more details
https://calendar.google.com/calendar/event?action=VIEW&eid=NjI4c3NnYjFoZHRh…
Your attendance is optional.
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
Hi all,
I am writing in behalf of Security Pattern, a security firm specialized
in embedded systems.
We are a member of the QUBIP European Funded Project (https://qubip.eu),
which aims at transitioning protocols, networks, and systems to Post
Quantum algorithms.
As a result of the project, we have integrated a set of Post Quantum
algorithms in the TLS1.3 stack of the MbedTLS code (see here
https://github.com/QUBIP/pq-mqtt-client-mbedtls).
We have code running on STM32 Nucleo board in two versions:
the former is a full software, by leveraging the crypto primitives
provided in a library developed by another partner, the latter using a
Secure Element emulated by FPGA connected via I2C (also developed by
another partner of QUBIP).
Our main work has beed dedicated to integrating the new hybrid KEM and
signatures (MLKEM768-x25519 and MLDSA44-Ed25519) into the TLS stack, in
order to demonstrate communication with an MQTT broker running OpenSSL.
At the current stage we are about to publish the code on github with MIT
license (here https://github.com/QUBIP/pq-mqtt-client-mbedtls).
Meanwhile, we think the effort we made could be of help for MBedTLS
development/developers. So I would like to ask if you can address me to
some contact that is responsible in MbedTLS or ARM about the PQC
transition or the best way to facilitate the use/integration of our work.
Best Regards,
Alberto
--
Security Pattern <https://www.securitypattern.com/>
Alberto Battistello
Senior Security Engineer
M. +39 333 3239810
Via G. Boccaccio, 58 | 25080 Mazzano (BS) | Italy | P.I. 03943650980
www.securitypattern.com
<https://www.securitypattern.com/?utm_source=newsletter&utm_medium=email&utm…>
| Follow Linkedin <https://www.linkedin.com/company/securitypattern/> |
We value your privacy
<https://www.iubenda.com/privacy-policy/40319464/legal>
Hi all,
We have encountered a challenge while using mbedTLS 3.5.1 and would greatly appreciate the assistance of the experts. Thank you in advance for your support.
I used mbedTLS 3.5.1 to connect to the server acc.connect.cpms.milence.com, and the TLS handshake failed with an Alert (Level: Fatal, Description: Protocol Version) error. Detailed information is described at this GitHub issue<https://github.com/Mbed-TLS/mbedtls/issues/10141>.
* We attempted to connect with the Windows EDGE browser and found through packet capture that the handshake was successful.
* We were also able to successfully handshake using TLS 1.2.
* When we limited the supported group to only: MBEDTLS_SSL_IANA_TLS_GROUP_SECP256R1 and used TLS 1.3, the handshake was also successful.
For more details, please refer to the discussion on GitHub: Handshake fail with "Alert (Level: Fatal, Description: Protocol Version)" ・ Issue #10141 ・ Mbed-TLS/mbedtls<https://github.com/Mbed-TLS/mbedtls/issues/10141>.
Best Regards,
Fu Baicheng
Dear Mbed TLS users,
We have released Mbed TLS versions 3.6.3 and 2.28.10. These releases provide bugfixes, security fixes and minor improvements.
This release of Mbed TLS provides the fix for the TLS compatibility issue of handling fragmented handshake messages. This release includes fixes for security issues.
Full details are available in the release notes:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.28.10https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.3
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Many thanks,
Minos Galanakis
Mbed TLS developer
Dear Mbed TLS users,
We have released Mbed TLS versions 3.6.3 and 2.28.10. These releases provide bugfixes, security fixes and minor improvements.
This release of Mbed TLS provides the fix for the TLS compatibility issue of handling fragmented handshake messages. This release includes fixes for security issues.
Full details are available in the release notes:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.28.10https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.3
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Many thanks,
Minos Galanakis
Mbed TLS developer
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
--
Mbed-tls-announce mailing list -- mbed-tls-announce(a)lists.trustedfirmware.org
To unsubscribe send an email to mbed-tls-announce-leave(a)lists.trustedfirmware.org
Dear Mbed TLS users,
The next release of Mbed TLS (3.6.3 and 2.28.10) is scheduled on Monday
2025-03-24. It will include a security fix for a vulnerability with a
high impact to affected applications.
Due to the nature of the vulnerability, which involves an insecure
default in current versions of Mbed TLS, fixing it may require a small
change in application code. We will provide instructions in the release
notes. Without this change, affected applications will fail at runtime
with Mbed TLS 3.6.3 or 2.28.10. Applications that are currently secure
will generally not require any change.
We apologize for the inconvenience.
Best regards,
--
Gilles Peskine
On behalf of the Mbed TLS security team
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
--
Mbed-tls-announce mailing list -- mbed-tls-announce(a)lists.trustedfirmware.org
To unsubscribe send an email to mbed-tls-announce-leave(a)lists.trustedfirmware.org
Hi Team,
I am working on an embedded security project and exploring ECC support in
MbedTLS 3.6.2. I would like to confirm whether the MbedTLS supports ECC-160
i.e. Elliptic Curve Cryptography with a 160 bit key size, in the latest
version or any earlier versions.
Looking forward to your response.
Thanks and regards,
Ankita Hatmode
--
-------------------------------------------------------------------------------------------------------------------------
**Disclaimer:** This email message including any attachments is
confidential, and may be privileged and proprietary to Agiliad. If you are
not the intended recipient, please notify us immediately by replying to
this message and destroy all copies of this message including any
attachments. You are NOT authorized to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. Thank
you.
------------------------------------------------------------------------------------------------------------------------
Hello Everybody,
I am trying to migrate my cross-compilation setup from version 2.28.9 to
version 3.6.2.
I use a Makefile based approach for compilation.
Everything seems to work fine up to the point where the compilation process
reaches the test_suite data generation
Gen suites/test_suite_psa_crypto_generate_key.generated.data
suites/test_suite_psa_crypto_low_hash.generated.data
suites/test_suite_psa_crypto_not_supported.generated.data
suites/test_suite_psa_crypto_op_fail.generated.data
suites/test_suite_psa_crypto_storage_format.current.data
suites/test_suite_psa_crypto_storage_format.v0.data
At that point it seems that the python based tools attempts to execute a
temp executable (generated for my cross-compilation target ?) which fails.
The traceback obtained is the following:
Traceback (most recent call last):
File "../framework/scripts/generate_psa_tests.py", line 849, in <module>
test_data_generation.main(sys.argv[1:], __doc__, PSATestGenerator)
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/test_data_generation.py",
line 224, in main
generator.generate_target(target)
File "../framework/scripts/generate_psa_tests.py", line 845, in
generate_target
super().generate_target(name, self.info)
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/test_data_generation.py",
line 177, in generate_target
self.write_test_data_file(name, test_cases)
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/test_data_generation.py",
line 164, in write_test_data_file
test_case.write_data_file(filename, test_cases)
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/test_case.py",
line 88, in write_data_file
for tc in test_cases:
File "../framework/scripts/generate_psa_tests.py", line 694, in
all_test_cases
if key.location_value() != 0:
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/psa_storage.py",
line 186, in location_value
return self.lifetime.value() >> 8
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/psa_storage.py",
line 89, in value
self.update_cache()
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/psa_storage.py",
line 67, in update_cache
include_path=includes) #type: List[str]
File
"/home/dev/test/mbed-TLS_3.6.2/framework/scripts/mbedtls_framework/c_build_helper.py",
line 158, in get_c_expression_values
output = subprocess.check_output([exe_name])
File "/usr/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/usr/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/tmp/tmp--m95sjmdw'
make[2]: *** [Makefile:127: generated_psa_test_data] Error 1
make[2] : on quitte le répertoire « /home/dev/test/mbed-TLS_3.6.2/tests »
make[1]: *** [Makefile:35: tests] Error 2
make[1] : on quitte le répertoire « /home/dev/test/mbed-TLS_3.6.2 »
make: *** [test.make:152: all] Error 2
Looking at the format of the generated tmp executable, it seems it is
generated for my cross-compilation target, it therefore cannot be executed
in my compilation environment.
I would like to be able to generate the test and test data in order to be
able to execute them on my compilation target, which is what I used to do
with the previously integrated version of the library.
Is there something I am missing in my compilation? am I missing a specific
setup variable in my Makefile?
Thanks for your feedback.
Best regards,
Francois
Hello,
I recently updated mbedTLS library version 2.6.2 to 3.6.2. I am using the
library to add https to Mongoose web server on a STM32H753 with FreeRTOS +
LWIP.
2.6.2 was generated in a IAR project using STMCubeMX.
What I am noticing is that file transfer performance has gotten much worse.
With version 2.6.2 it took a few minutes to transfer a file of around 33
MB, now with version 3.6.2 it takes around 15 min. What could this depend
on? Attached is the configuration used for the two versions. The
certificate for https is EC curve secp256r1.
Thank you
Dear Mbed TLS and PSA Crypto users,
We would like to update you on the release timeline for Mbed TLS 4.0/TF-PSACrypto1.0 release.
As a reminder, the key objectives of the release are a separate TF-PSA Crypto repo., PSA Crypto becoming the de facto Crypto API and Mbed TLS using PSA Crypto APIs as the crypto API by default.
While TF-PSA Crypto repository is now available, the remaining effort to be ready for the release is more than we originally planned for.
Based on remaining effort estimates, we plan to make Mbed TLS 4.0-Beta and TF-PSA Crypto 1.0-Beta release around end of June. The Mbed TLS 4.0, and TF-PSA Crypto 1.0 release is expected around end of September.
We don’t expect users to integrate the Beta release. Beta is aimed to pipeclean the separate Mbed TLS and TF-PSA Crypto release process and get any early feedback. The release in September is expected to be integrated by users to their projects.
We wanted to provide these revised release dates so that the users can plan accordingly. In the meantime, bug fixes and security fixes will continue to be provided via. Mbed TLS 3.6.x LTS releases.
Thanks,
Mbed TLS/PSA Crypto Maintainers.
--
Mbed-tls-announce mailing list -- mbed-tls-announce(a)lists.trustedfirmware.org
To unsubscribe send an email to mbed-tls-announce-leave(a)lists.trustedfirmware.org
Hi MbedTLS team,
I have been following up the MbedTLS roadmap from here - https://mbed-tls.readthedocs.io/en/latest/project/roadmap/ . It talks about Post Quantum Cryptography support in future.
And in the section of Long Term Plans for MbedTLS, I see the note related to PQC as "Regarding post-quantum cryptography (PQC) in particular, we do plan to wait until there are official standards: as of 2023, apart from stateful hash-based signatures, there are too many open questions about selected algorithms (choice of parameters, data formats, hybrid combinations…).
This note seems to be pretty old as it refers to 2023.. So, are there any latest update on the roadmap? Is there any plan to support latest NIST standardized algorithms (ML-DSA, ML-KEM, SLH-DSA) in this year or next year.
Thanks & Regards,
*
Nayna
Hello mbedtls mailing list,
I'm working to modify mbedTLS (3.6.2) to use our PSA Crypto Implementation in a separate library. Our solution does not make use of PSA 'drivers' that mbedTLS refers to. I've modified makefiles to not build PSA Crypto files, and have enabled MBEDTLS_PSA_CRYPTO_C & MBEDTLS_USE_PSA_CRYPTO. I've also defined MBEDTLS_PSA_ACCEL_ALG_XXX for our supported algorithms.
1. Is there a good way to determine whether a given TLS/X509 configuration would require a certain 'legacy' (maybe a better term is 'non-PSA') crypto file to be built into the mbedTLS library?
* The goal is to build as few crypto source files into the mbedTLS source files as possible, maximizing usage of our separate PSA implementation
2. Example: My test application using mbedtls_x509_crt_parse() receives linking errors for mbedtls_ecp_(group/point)_xxx() and mbedtls_mpi_xxx() that are referenced in pkparse.c (which I am building into the library).
* Ecp.c is currently excluded from the build (as is its define) - if I add it, I add significantly more linking errors for mbedtls_mpi APIs. I was under the impression that ECP and MPI APIs could be avoided with the correct configuration.
* If ecp/mpi helper APIs are needed still for x509, this would be good to know. However, I'd like to avoid usage of MPI APIs that perform actual software calculations.
See the screenshot for a list of non-PSA crypto files I am currently building to test with. I imagine I may have to add more incrementally.
[cid:image001.png@01DB726D.879014D0]
Any insights on this general use case or my ECP troubles with x509 would be appreciated. I plan to extend the strategy as these are the findings from an attempt to use just one x509 API.
Best,
Kevin Zak
Dear Developer,
I was reviewing the code and noticed that in the TLS 1.3 handshake protocol state machine, the "Change Cipher Spec" state has been divided into five different states based on its occurrence timing. Could you please clarify if there are any specific considerations for this approach?
Additionally, these states can appear multiple times during a single handshake, which implies multiple "Change Cipher Spec" messages. However, the TLS 1.3 standard suggests that the "Change Cipher Spec" should only appear once in a single handshake. Could you kindly explain the rationale behind this design decision?
Thank you for your time and assistance. I look forward to your response.
Best regards,
XiangDong Li
Hello,
I am currently working on a project using STM32CubeIDE, where I am leveraging mbedTLS v2.16.2 to establish a secure MQTT connection with a Mosquitto broker on port 8883.
During my implementation, I encountered a TLS handshake error with the following details:
mbedtls_ssl_handshake failed. -29312 (-0x7280)
I would like to confirm if mbedTLS v2.16.2, as provided in STM32CubeIDE, supports secure TLS connections (e.g., Secure MQTT) and is compatible with Mosquitto broker configurations. Additionally, I would appreciate guidance on resolving this error.
Here are some specific details about my setup:
1. mbedTLS version: 2.16.2 (as integrated into STM32CubeIDE).
2. Broker: Mosquitto, configured for secure MQTT on port 8883.
3. Issue: TLS handshake fails with the error mentioned above.
4. Certificates: [CA certificates, ].
Please let me know if additional information
Regards,
Noushad
Embedded systems engineer
Inthings Technologies Private Limited
www.inthings.tech<http://www.inthings.tech>
[cid:image001.png@01DB65BA.1F5B9660]
Dear Developer,
I was reviewing the code and noticed that in the TLS 1.3 handshake protocol state machine, the "Change Cipher Spec" state has been divided into five different states based on its occurrence timing. Could you please clarify if there are any specific considerations for this approach?
Additionally, these states can appear multiple times during a single handshake, which implies multiple "Change Cipher Spec" messages. However, the TLS 1.3 standard suggests that the "Change Cipher Spec" should only appear once in a single handshake. Could you kindly explain the rationale behind this design decision?
Thank you for your time and assistance. I look forward to your response.
Best regards,
XiangDong Li
Hi,
I am trying to determine what would be an optimal stack and heap allocation for mbedtls.
I realize this changes with algorithms, some configuration macros for the algorithms as well as concurrency.
But is there any information on stack and heap usage that I can use as a starting point? And is there any information on the same for a crypto suite.
Thanks
Michael T
Disclaimer: This message and any files or text attached to it are intended only for the recipients named above and contain information that may be confidential or privileged. If you are not an intended recipient, you must not forward, copy, use or otherwise disclose this communication or the information contained herein. In the event you have received this message in error, please notify the sender immediately by replying to this message, and then delete all copies of it from your system. Thank you.
Hello,
I am currently working on a project using STM32CubeIDE, where I am leveraging mbedTLS v2.16.2 to establish a secure MQTT connection with a Mosquitto broker on port 8883.
During my implementation, I encountered a TLS handshake error with the following details:
mbedtls_ssl_handshake failed. -29312 (-0x7280)
I would like to confirm if mbedTLS v2.16.2, as provided in STM32CubeIDE, supports secure TLS connections (e.g., Secure MQTT) and is compatible with Mosquitto broker configurations. Additionally, I would appreciate guidance on resolving this error.
Here are some specific details about my setup:
1. mbedTLS version: 2.16.2 (as integrated into STM32CubeIDE).
2. Broker: Mosquitto, configured for secure MQTT on port 8883.
3. Issue: TLS handshake fails with the error mentioned above.
4. Certificates: [Specify if you are using self-signed certificates, CA certificates, etc.].
Please let me know if additional information or logs would be helpful for diagnosing the issue.
Thank you for your assistance.
Regards,
Noushad
Embedded systems engineer
Inthings Technologies Private Limited
www.inthings.tech<http://www.inthings.tech>
[cid:image001.png@01DB5D28.96B30030]
Regards,
Noushad
Embedded systems engineer
Inthings Technologies Private Limited
www.inthings.tech<http://www.inthings.tech>
[cid:image001.png@01DB5D28.96B30030]
Dear Mbed TLS Support Team,
I am currently working on a project using Mbed TLS version 3.6 on FreeRTOS,
and I am encountering an issue with handling multiple CA certificates
during the TLS handshake process. My device has a set of built-in
certificates, and I need to try each certificate one by one to establish a
successful connection to my server. However, I am facing difficulties in
this process.
### System Information:
- **Mbed TLS version**: 3.6
- **Operating System**: FreeRTOS
- **Configuration**: Default
- **Compiler and Options**: N/A (using default configuration)
### Expected Behavior:
The first certificate (e.g., `cdotroot.cer`) cannot be verified by Mbed
TLS, while the correct certificate should successfully establish a
connection.
### Actual Behavior:
Both the incorrect and correct CA certificates fail to establish a
connection successfully.
### Steps to Reproduce:
Here is a sample of my code:
```c
static int load_and_verify_certificates(int conn_id, uint8_t *cert_buffer,
size_t buffer_size) {
int ret;
bool connection_established = false;
uint32_t cert_index = 0;
while (!connection_established && cert_index < MAX_CERT_COUNT) {
size_t cert_size = buffer_size;
// Free and initialize the certificate context
mbedtls_x509_crt_free(&cacert[conn_id]);
mbedtls_x509_crt_init(&cacert[conn_id]);
// Load the built-in certificate
ret = try_built_in_certificate(cert_buffer, &cert_size, cert_index);
if (ret == CERT_ERR_INDEX_OUT_OF_RANGE) {
break;
}
if (ret != CERT_SUCCESS) {
cert_index++;
continue;
}
// Parse the certificate
cert_buffer[cert_size] = '\0';
ret = mbedtls_x509_crt_parse(&cacert[conn_id], cert_buffer,
cert_size + 1);
if (ret < 0) {
cert_index++;
continue;
}
// Set the certificate chain
mbedtls_ssl_conf_ca_chain(&conf[conn_id], &cacert[conn_id], NULL);
// Perform the TLS handshake
ret = mbedtls_ssl_handshake(&ssl[conn_id]);
if (ret == 0) {
uint32_t flags = mbedtls_ssl_get_verify_result(&ssl[conn_id]);
if (flags == 0) {
connection_established = true;
// Cache the certificate
cache_certificate(cert_buffer, cert_size, cert_index);
break;
}
} else {
LOGD("Failed to perform handshake with certificate index %d,
error: -0x%x\n", cert_index, -ret);
}
// Reset the SSL session
ret = mbedtls_ssl_session_reset(&ssl[conn_id]);
if (ret != 0) {
LOGD("Failed to reset SSL session, error: -0x%x\n", -ret);
return ret;
}
cert_index++;
}
return connection_established ? 0 : -1;
}
```
### Additional Information:
Here are the logs:
```
Reading certificate 'cdotroot.cer' at address 0x08100650, size: 1348
Failed to perform handshake with certificate index 0, error: -0x2700
Reading certificate 'digicertroot.cer' at address 0x08100B94, size: 1360
Failed to perform handshake with certificate index 1, error: -0x7300
...
```
I suspect that the issue may be related to the limited RAM space available
on my device. I am looking for guidance on how to properly iterate through
and verify the built-in certificates within these constraints. Any
suggestions or best practices for handling multiple certificates in such an
environment would be greatly appreciated.
Thank you for your assistance.
Best regards,
[Tony]
---
Feel free to replace `[Your Name]` with your actual name before sending the
email.
Hello,
I described an issue I have here: https://github.com/Mbed-TLS/mbedtls/issues/9867
During compilation it compiles with the wrong mbedtls_config.h even though I set up this part in my CMakeLists.txt:
#MbedTLS default START
# 1. MbedTLS custom config setup
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mbedtls)
set(MBEDTLS_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/mbedtls_config.h")
add_compile_definitions(
MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}"
MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}"
)
set(ENABLE_TESTING OFF CACHE BOOL "Disable mbedtls testing" FORCE)
set(ENABLE_PROGRAMS OFF CACHE BOOL "Disable mbedtls programs" FORCE)
set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mbedtls)
# Add mbedtls build
add_subdirectory(${MBEDTLS_DIR})
#MbedTLS END
There’s more information on the GitHub link.
Thank you in advance.
Alex
Dear Mbed TLS users,
Mbed TLS has contained the reference implementation of the PSA Crypto API since the early days of the standard. This implementation was experimental at first, but over years of development it reached maturity, and the experimental status was removed three years ago (in version 3.6.1.).
Shortly after that, in 2022, the TF-PSA-Crypto<https://github.com/Mbed-TLS/TF-PSA-Crypto> repository was created just for the PSA Crypto API implementation to make it more accessible for users only interested in that. This repository was only a mirror of the main one and the development of the PSA Crypto API implementation remained integral part of Mbed TLS.
In the background, work has been started to make this repository the place where the development of the PSA Crypto API reference implementation happens. This work has finally been completed and from now on TF-PSA-Crypto<https://github.com/Mbed-TLS/TF-PSA-Crypto> is ready to receive contributions, bug reports and enhancement requests. TF-PSA-Crypto<https://github.com/Mbed-TLS/TF-PSA-Crypto> will now be the development repository for the PSA Crypto reference implementation.
Mbed TLS will continue to rely on TF-PSA-Crypto<https://github.com/Mbed-TLS/TF-PSA-Crypto> and will be using it as a submodule.
Many thanks,
Janos Follath
Mbed TLS developer
Hi,
Can you give me a little advice on how v3 works?
I've updated our mbed library from 2.16.1 to 3.6.2 which was mostly a very
smooth experience, thanks.
The one question in my mind relates to making p_bio private in
mbedtls_ssl_context
*I used to free it before calling mbedtls_ssl_free - is it ok to skip this
now? ie:*
//mbedtls_net_free((mbedtls_net_context *) m_ssl.p_bio);
mbedtls_ssl_free(&m_ssl);
*I also used to poll it before calling mbedtls_ssl_close_notify - is ok to
skip this now? ie:*
//if(mbedtls_net_poll((mbedtls_net_context *) m_ssl.p_bio,
MBEDTLS_NET_POLL_WRITE, 0) < 0)
// return;
int ret;
while((ret = mbedtls_ssl_close_notify(&m_ssl)) < 0)
{
if(ret != MBEDTLS_ERR_SSL_WANT_READ &&
ret != MBEDTLS_ERR_SSL_WANT_WRITE)
return;
}
It all seems to run just fine like this, but I could really do with some
confidence boosting validation of my cavalier commenting.
Thank you
Daniel
Dear Mbed TLS team,
I am trying to integrate Mbed TLS in our platform:
- nxp imx rt 1024 CPU (arm based)
- FreeRTOS (10.6)
- Lwip (2.2)
- Mbed TLS (3.6.2)
LWIP supports Mbed TLS when adding defines in their configuration:
/* ---------- TLS ------------------------- */
#define LWIP_ALTCP 1
#define LWIP_ALTCP_TLS 1
#define LWIP_ALTCP_TLS_MBEDTLS 1
But, unfortunately this supports an older version of Mbed TLS (I believe
2.2.x).
When I try to compile against the Mbed TLS 3.6.2 libraries, I get a bunch
of compiler warnings / errors. Most of them are mentioned in the migration
guide, but even then, I have a hard time figuring out how to resolve them
"the right way".
1. Private fields
The migration guide
<https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-3.6/docs/3.0-migration-gui…>
explains that most structs are now considered private.
1.1: The altcp_mbed module in LWIP relies on the *out_left* field of the *ssl
context* struct.
/* calculate TLS overhead part to not send it to application */
overhead = state->overhead_bytes_adjust + state->ssl_context.out_left;
I am correct that this field is simply not exposed through accessor
functions? I can find functions like mbedtls_ssl_get_avail, so I would
expect something like mbedtls_ssl_get_bytes_to_write or something like that?
1.2: The altcp_mbed module in LWIP relies on the *start* field of the *ssl
session* struct.
err_t
altcp_tls_set_session(struct altcp_pcb *conn, struct altcp_tls_session
*session)
{
if (session && conn && conn->state) {
altcp_mbedtls_state_t *state = (altcp_mbedtls_state_t *)conn->state;
int ret = -1;
* if (session->data.start)*
ret = mbedtls_ssl_set_session(&state->ssl_context, &session->data);
return ret < 0 ? ERR_VAL : ERR_OK;
}
return ERR_ARG;
}
I also don't know how to obtain this field "the right way". I know this is
a bad idea, but it's all I got
if (session->data.*private_start)* ...
2. parse key expects a RNG function
This is also explained in the migration guide:
*Some functions gained an RNG parameterThis affects users of the following
functions: `mbedtls_ecp_check_pub_priv()`,`mbedtls_pk_check_pair()`,
`mbedtls_pk_parse_key()`, and`mbedtls_pk_parse_keyfile()`.You now need to
pass a properly seeded, cryptographically secure RNG whencalling these
functions. It is used for blinding, a countermeasure againstside-channel
attacks.*
Can you please give me some guidance here? I looked for examples in Mbed
TLS repo and ended up with this (bold parts are added, using the key_app.c
in your repo as leading example):
* mbedtls_entropy_context entropy; mbedtls_ctr_drbg_context ctr_drbg;
mbedtls_entropy_init(&entropy); mbedtls_ctr_drbg_init(&ctr_drbg); if
((ret = mbedtls_ctr_drbg_seed( &ctr_drbg,
mbedtls_entropy_func, &entropy, privkey,
privkey_len)) != 0) { // TODO: handle error } *
ret = mbedtls_pk_parse_key(
conf->pkey, privkey,
privkey_len,
privkey_pass,
privkey_pass_len,
*mbedtls_ctr_drbg_random, &ctr_drbg*);
3. The altcp_mbed module in LWIP relies on mbedtls_ssl_flush_output
The altcp_mbed module had an include on ssl internal.
#include "mbedtls/ssl_internal.h" /* to call mbedtls_flush_output after
ERR_MEM */
This header seems no longer part of the library. But the prototype of the
function is now part of ssl_misc.h, but I don't think I am supposed to rely
on this header either.
I have a couple of options:
- ignore the compiler warning
/home/dev_container/app/thirdparty/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c:535:5:
warning: implicit declaration of function 'mbedtls_ssl_flush_output'; did
you mean 'mbedtls_ssl_tls_prf'? [-Wimplicit-function-declaration]
535 | mbedtls_ssl_flush_output(&state->ssl_context);
- copy paste the declaration in the LWIP source file
- Or.... don't flush any buffers managed by Mbed TLS in the first place?
For the last one, I could really use your input. Can you say anything
meaningful about the flush (line in bold) In the below function, Is it
mandatory? Or can I trust the Mbed TLS will flush the output buffer
whenever it needs to get flushed?
/** Sent callback from lower connection (i.e. TCP)
* This only informs the upper layer the number of ACKed bytes.
* This now take care of TLS added bytes so application receive
* correct ACKed bytes.
*/
static err_t
altcp_mbedtls_lower_sent(void *arg, struct altcp_pcb *inner_conn, u16_t len)
{
struct altcp_pcb *conn = (struct altcp_pcb *)arg;
LWIP_UNUSED_ARG(inner_conn); /* for LWIP_NOASSERT */
if (conn) {
int overhead;
u16_t app_len;
altcp_mbedtls_state_t *state = (altcp_mbedtls_state_t *)conn->state;
LWIP_ASSERT("state", state != NULL);
LWIP_ASSERT("pcb mismatch", conn->inner_conn == inner_conn);
/* calculate TLS overhead part to not send it to application */
mbedtls_ssl_get_bytes_avail(&state->ssl_context);
overhead = state->overhead_bytes_adjust +
state->ssl_context.private_out_left;
if ((unsigned)overhead > len) {
overhead = len;
}
/* remove ACKed bytes from overhead adjust counter */
state->overhead_bytes_adjust -= len;
/* try to send more if we failed before (may increase overhead adjust
counter) */
*mbedtls_ssl_flush_output(&state->ssl_context); // Does it make sense
this LWIP port is responsible for flushing here??*
/* remove calculated overhead from ACKed bytes len */
app_len = len - (u16_t)overhead;
/* update application write counter and inform application */
if (app_len) {
state->overhead_bytes_adjust += app_len;
if (conn->sent)
return conn->sent(conn->arg, conn, app_len);
}
}
return ERR_OK;
}
After applying the changes I mentioned above, the software compiles against
Mbed TLS. I haven't dared to run anything, I just want to enjoy this short
moment where I have the feeling I achieved something before runtime errors
ruin my day :).
Many thanks in advance for any reply!
Best regards, Bas
[image: image.png]
Hi Team
I am investigating the move from MbedTLS 2.25 to 3.6, however, our client uses the 2.25 currently (looks like they prefer to stay with it) and I need to provide convincing proof to move to 3.6 considering the upgrade issues that might arise. Any suggestions here that is convincing proof to do the migration to 3.6? I would appreciate your comments. Thanks
Michael
Dear Mbed TLS team,
I am at the early steps of trying to integrate Mbed TLS with LWIP for our
project (imx rt 1024 NXP micro, arm M7, running FreeRTOS and LWIP). I
understand the basics of TLS, but I am far from an expert.
Let me first apologise for the lengthy first email. I am afraid to leave
out details. Feel free to skip directly to the end marked with:
=============================
My questions:
=============================
Some background / translation of how I think it (should) work:
From a distance, I understand that LWIP has an abstraction layer on their
TCP module, which can be used to integrate Mbed TLS.
In fact, LWIP already did this, all I need to do is enable some directives
(LWIP_ALTCP_TLS and LWIP_ALTCP_TLS_MBEDTLS).
The implemented integration assumes a somewhat older version of Mbed TLS,
so I have to adjust a couple to cope with the breaking changes from Mbed
TLS 2.x to Mbed TLS 3.6.2.
But other than that, integrating Mbed TLS would mean:
- figure out which options i want to enable in Mbed TLS
- cross compile it for our arm toolchain
- extend our build scripts to compile against 3 static Mbed TLS libraries
- figure out how to read the CA certificates, and provide them to Mbed TLS
- test and fail, and hopefully be man enough to solve the challenges
ahead...
I haven't achieved much yet, but at least I managed to compile Mbed TLS
with our toolchain and recompile our project against the linked libraries.
This steps fails though, I get a bunch of linker errors :
[100%] Linking CXX executable app.axf
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_msg.c.obj):
in function `mbedtls_ssl_encrypt_buf':
/home/dev/app/thirdparty/mbedtls/library/ssl_msg.c:1211:(.text.mbedtls_ssl_encrypt_buf+0x1b4):
undefined reference to `mbedtls_cipher_auth_encrypt_ext'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_msg.c.obj):
in function `mbedtls_ssl_decrypt_buf':
/home/dev/app/thirdparty/mbedtls/library/ssl_msg.c:1638:(.text.mbedtls_ssl_decrypt_buf+0x180):
undefined reference to `mbedtls_cipher_auth_decrypt_ext'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_msg.c.obj):
in function `mbedtls_ssl_transform_free':
/home/dev/app/thirdparty/mbedtls/library/ssl_msg.c:6213:(.text.mbedtls_ssl_transform_free+0x14):
undefined reference to `mbedtls_cipher_free'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/thirdparty/mbedtls/library/ssl_msg.c:6214:(.text.mbedtls_ssl_transform_free+0x1e):
undefined reference to `mbedtls_cipher_free'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_tls.c.obj):
in function `mbedtls_ssl_transform_init':
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:1028:(.text.mbedtls_ssl_transform_init+0x18):
undefined reference to `mbedtls_cipher_init'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:1029:(.text.mbedtls_ssl_transform_init+0x22):
undefined reference to `mbedtls_cipher_init'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_tls.c.obj):
in function `mbedtls_ssl_get_mode_from_ciphersuite':
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:2453:(.text.mbedtls_ssl_get_mode_from_ciphersuite+0x12):
undefined reference to `mbedtls_cipher_info_from_type'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_tls.c.obj):
in function `mbedtls_ssl_parse_finished':
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:8680:(.text.mbedtls_ssl_parse_finished+0xac):
undefined reference to `mbedtls_ct_memcmp'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_tls.c.obj):
in function `ssl_tls12_populate_transform':
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:8878:(.text.ssl_tls12_populate_transform+0xa6):
undefined reference to `mbedtls_cipher_info_from_type'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:9136:(.text.ssl_tls12_populate_transform+0x454):
undefined reference to `mbedtls_cipher_setup'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:9142:(.text.ssl_tls12_populate_transform+0x476):
undefined reference to `mbedtls_cipher_setup'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:9148:(.text.ssl_tls12_populate_transform+0x4a8):
undefined reference to `mbedtls_cipher_setkey'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/thirdparty/mbedtls/library/ssl_tls.c:9155:(.text.ssl_tls12_populate_transform+0x4da):
undefined reference to `mbedtls_cipher_setkey'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
CMakeFiles/app.dir/home/dev/app/thirdparty/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c.obj:
in function `altcp_mbedtls_sndbuf':
/home/dev/app/thirdparty/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c:1192:(.text.altcp_mbedtls_sndbuf+0x7e):
undefined reference to `mbedtls_ssl_get_max_frag_len'
/opt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld:
/home/dev/app/source/iobox-app/../../thirdparty/mbedtls/build/library/libmbedtls.a(ssl_tls12_server.c.obj):
in function `ssl_parse_client_psk_identity':
/home/dev/app/thirdparty/mbedtls/library/ssl_tls12_server.c:3638:(.text.ssl_parse_client_psk_identity+0xb6):
undefined reference to `mbedtls_ct_memcmp'
The distinct list undefined references of the above:
undefined reference to `mbedtls_cipher_auth_encrypt_ext'
undefined reference to `mbedtls_cipher_auth_decrypt_ext'
undefined reference to `mbedtls_cipher_free'
undefined reference to `mbedtls_cipher_init'
undefined reference to `mbedtls_cipher_info_from_type'
undefined reference to `mbedtls_ct_memcmp'
undefined reference to `mbedtls_cipher_setup'
undefined reference to `mbedtls_cipher_setup'
undefined reference to `mbedtls_cipher_setkey'
undefined reference to `mbedtls_cipher_setkey'
undefined reference to `mbedtls_ssl_get_max_frag_len'
All except the last one are coming from Mbed TSL internally, so I *guess*
this means I am missing options? Or maybe I am still having too many?
The last one is called from the LWIP integration of Mbed TLS, and I could
"sweep this under the carpet" by disabling
"MBEDTLS_SSL_MAX_FRAGMENT_LENGTH". But I haven't looked further in what I
cause if I do not support "RFC 6066 max_fragment_length extension in SSL"
My Mbed TLS configuration:
I followed the suggestion of your documentation, and went for a minimal
example configuration. Pure on intuition, I went for
"config-ccm-psk-dtls1_2.h". Because the file name suggests it brings TSL
1.2 which is basically all I need. I think.
I did had to make the following changes in order to be able to compile it:
1. Comment out two defines in order to get rid of module requiring
"windows or unix"
//#define MBEDTLS_NET_C
//#define MBEDTLS_TIMING_C
2. Add a define, again to get rid of the compiler error "require windows or
unix"
#define MBEDTLS_NO_PLATFORM_ENTROPY
After applying these small changes to the include/mbedtls/mbedtls_config.h
I was able to cross compile (and link) Mbed TLS with arm-none-eabi
toolchain.
Once I adjusted the build scripts to lnk against the Mbed TLS static
libraries, I finally ended up with the earlier mentioned linker errors.
=============================
My questions:
=============================
1. Does my starting point configuration make sense?
As mentioned earlier, pure intuition made me try the
"config-ccm-psk-dtls1_2.h" configuration example, which after some
modifications compiled and produced 3 static libraries. but, this bit in
the example header worries me a bit:
* Distinguishing features:
* - Optimized for small code size, low bandwidth (on an unreliable
transport),
* and low RAM usage.
* - No asymmetric cryptography (no certificates, no Diffie-Hellman key
* exchange).
* - Fully modern and secure (provided the pre-shared keys are generated and
* stored securely).
* - Very low record overhead with CCM-8.
* - Includes several optional DTLS features typically used in IoT.
What does "no asymmetric cryptography" exactly mean? Isn't that the pure
basis of TLS altogether?
If I want to achieve HTTPS using TLS, is this a good starting point?
2. Undefined references: wrong configuration, or should I supply some of
the implementations?
As mentioned before, I have quite a few linking errors related to the
cipher module. I tried to find answers in the documentation, but came up
empty.
I assume (again...) that I should be able to get rid of these linking
errors by enabling more features in Mbed TLS. But I honestly get lost in
#define's. And maybe it's documented somewhere, but I couldn't find it.
3. Root CA provided by me?
I assume I *need* to provide at least one root CA for Mbed TLS to be able
to verify the public key provided by the server, at some point, right? I
would expect some callback I need to implement where such a root CA was
read (in my case, i would have to read if from flash). Am I
misunderstanding Mbed TLS on this aspect also? Or did I just miss the
obvious spot where to Mbed TLS requests a root CA?
4. More examples available for typical microcontroller projects
(FreeRTOS/LWIP)?
My experience so far is:
- Mbed TLS is well documented
- LWIP is no longer actively maintained, and lacks documentation in general
- Google finds a painful amount of LWIP/TLS integrations which are based on
really old implementations of both, which does more harm than good for me
- Chat GPT knows everything, even when it doesn't, which is a really great
recipe to get on the wrong track... It doesn't seem rather helpful on my
integration questions for Mbed TLS/LWIP. Disclaimer: could be that my lack
of knowledge is causing gpt to come up with wrong answers of course...
I understand that my email is (too?) long, and that the chance somebody
will actually find the time to help me out is limited.
I expect nothing,
I hope for everything :)
ANY help is more than welcome. Good references, links to official
documentation I missed, or in the best case: answers to my
questions/uncertainties.
Many thanks in advance.
Best regards, Bas
Dear MbedTLS maintainers,
we are already using MBedTLS, however, we recently enabled TLS 1.3 and
found that our certificates doesn't work anymore, because they are
brainpoolP256r1 (https://datatracker.ietf.org/doc/html/rfc8734). So the
question would be, if I missed any configuration to enable the usage of
brainpool curves (which are working for TLS 1.2) or if there are any
plans, that these are getting supported by MBedTLS 3.6.x?
Best regards,
Maren Konrad
Hi,
I am trying to build lief which is dependent on mbedtls as a static library.
I am using conan recipe to build using cmake.
The build of the library succeeded, however later while trying to build my
own application and link with lief I get the following error:
LIEF.lib(x509.obj) : error LNK2001: unresolved external symbol
mbedtls_snprintf
What do I do wrong?
Or should I configure something while building the mbedtls library ?
Thanks,
Gal.
Dear Mbed TLS maintainers,
I have surveyed Mbed TLS and know that it has features which can improve
AES block cipher performance by hardware instructions instead of SW
implementation
e.q., AESCE of ARMV8 and AESNI of INTEL.
AS far as I know about RISC-V Cryptography extension(Zkne and Zknd),
it also supports relevant AES instructions which can accelerate aes
key schedule, encryption and decryption process.
(https://tools.cloudbear.ru/docs/riscv-crypto-spec-scalar-1.0.0-rc6-20211012…)
I want to ask for your opinions and agreement.
Is there any willingness to accept this RISC-V accelerated feature
idea and contribution to Mbed TLS ?
If you agree with it, I would like to prepare a pull request for you to review.
Sincerely,
Rick
Dear Mbed TLS users,
We have released Mbed TLS version 3.6.2. This release provides a security fix for an out-of-bounds write vulnerability in the pkwrite module.
Full details are available in the release notes:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.2
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Many thanks,
David Horstmann
Mbed TLS developer
Hi,
I'm currently working on adding mbedTLS 3.x support for Privoxy [0].
Everything seems to be working but I ifdef'ed out the following
code in [1] that worked with mbedTLS 2.28.8:
/*
* Check if key and issuer certificate match
*/
if (!mbedtls_pk_can_do(&issuer_cert.pk, MBEDTLS_PK_RSA) ||
mbedtls_mpi_cmp_mpi(&mbedtls_pk_rsa(issuer_cert.pk)->N,
&mbedtls_pk_rsa(*issuer_key)->N) != 0 ||
mbedtls_mpi_cmp_mpi(&mbedtls_pk_rsa(issuer_cert.pk)->E,
&mbedtls_pk_rsa(*issuer_key)->E) != 0)
{
log_error(LOG_LEVEL_ERROR,
"Issuer key doesn't match issuer certificate");
ret = -1;
goto exit;
}
As N and E are private now it no longer compiles.
Is there a way to implement the check with mbedTLS 3.x?
My impression is that the sanity check is overly cautious
and we don't have equivalent code for OpenSSL and wolfSSL
but I'm curious.
Thanks,
Fabian
[0] <https://www.privoxy.org/>
[1] <https://www.privoxy.org/gitweb/?p=privoxy.git;a=blob;f=ssl.c;h=e8007cd9adad…>
Hello,
I'm running into an issue with using Mbed-TLS on an embedded device of ours and I'm curious if anyone would be able to point me in the right direction. If this is the wrong channel for general use questions, let me know and I'll search elsewhere. As a forewarning, I'm still getting my bearings around the nuts and bolts of Mbed-TLS and network security; apologies if I misstate something or jumble things up.
Our device uses Mbed-TLS 3.0.0; ideally I'd like to upgrade this to a newer version, but this version was included in a SDK package for our device and I'd like to get some basic functionality proven out first before trying to reintegrate a newer version into the rest of provided code. The current goal is to get our device to serve a web page over HTTPS with TLS.
What we currently see is that the initial hello client and server messages are exchanged without issue, but the connection is rejected after the server requests a certificate from the client. In some browsers, this opens a prompt where you can select a given certificate on the machine; in others, it skips this prompt and sends a response back with an empty certificate. In both instances, the server will return an error and deny the connection.
This seems like some sort of user configuration error, given your average web page served over HTTPS on the internet avoids making this request. The literature I've been able to find so far also seems to suggest this request is entirely optional. Is there some option I'm overlooking that makes the server skip asking the client for its certificate and lets connection continue on?
Michael Reutman
Senior Embedded Software Engineer
NovaTech Automation
261 Brodhead Rd.
Bethlehem, PA 18017
novatechautomation.com<http://www.novatechautomation.com/> | NovaTechLinkedIn<https://www.linkedin.com/company/565017>
NovaTech Automation is Net Zero committed. #KeepItCool<https://www.keepitcool.earth/>
Receipt of this email implies compliance with our terms and conditions<https://www.novatechautomation.com/email-terms-conditions>.
Hi,
I'm trying to parse this DER encoded certificate in hex format:
3082018230820128a003020102020900f3b305f55622cfdf300a06082a8648ce3d04030230003020170d3735303130313030303030305a180f34303936303130313030303030305a30003059301306072a8648ce3d020106082a8648ce3d0301070342000458f7e9581748ff9bdd933b655cc0e5552a1248f840658cc221dec2186b5a2fe4641b86ab7590a3422cdbb1000cf97662f27e5910d7569f22feed8829c8b52e0fa38188308185308182060a2b0601040183a25a01010101ff0471306f042508021221026b053094d1112bce799dc8026040ae6d4eb574157929f1598172061f753d9b1b04463044022040712707e97794c478d93989aaa28ae1f71c03af524a8a4bd2d98424948a782302207b61b7f074b696a25fb9e0059141a811cccc4cc28042d9301b9b2a4015e87470300a06082a8648ce3d04030203480030450220143ae4d86fdc8675d2480bb6912eca5e39165df7f572d836aa2f2d6acfab13f8022100831d1979a98f0c4a6fb5069ca374de92f1a1205c962a6d90ad3d7554cb7d9df4
This certificate is part of a simple test for this specification
https://github.com/libp2p/specs/blob/master/tls/tls.md
I'm using this https://github.com/status-im/nim-mbedtls Nim language
library wrapper for mbedtls. I don't know the mbedtls version exactly,
but the lib is based on this commit
https://github.com/Mbed-TLS/mbedtls/tree/09d23786f6fdcb4dfa88aad30c8767bd27….
In my code I use:
proc parseUnverified*(derInput: seq[byte]) =
var crt: mbedtls_x509_crt
mbedtls_x509_crt_init(addr crt)
var ret = mbedtls_x509_crt_parse_der(addr crt, unsafeAddr
derInput[0], derInput.len.uint)
if ret != 0:
raise newException(Exception, "Failed to parse certificate, error
code: " & $ret)
which is a straightforward version of the C code, but ti fails with:
Failed to parse certificate, error code: -9186 [Exception]
It seems the problem is because the certificate doesn't have the
Distinguished Name set. Does it make sense? If this is really the
cause of the problem, is there any workaround?
Regards.
Hi,
We were using old MBed TLS version 2.19.1 and existing trusted CA
certificates were working fine in that release. Recently we upgraded
to 3.6.0 and see that now certificate parsing is returning -ox262e
value from function mbedtls_x509_get_sig_alg cause of which handshake
is not even initiated.
Can you please let us know what can cause such an issue and remedy the same?
Regards,
Prakash
Hi Mbed TLS,
I am looking for some suggestions about make some (or all) Mbed TLS APIs non-secure callable APIs on armv8m.
The background is that I am going to have a secure firmware that provides encryption services by building part (or whole) of Mbed TLS into that firmware and make those original mbedtls_x APIs non-secure callable, so the existing non-secure firmware could link those non-secure callable APIs and use them.
Some of my thoughts:
(1) The easiest way to do it I can think of is just add the attribute "cmse_nonsecure_call" to those APIs' declaration (or use a macro to wrap the attribute for conditional build to not impact others don't want it), but I do not think this modification could be accepted by upstream 🙂.
(2) So my another thought is duplicate all header files and put them under another folder, assuming it is my-include folder, then I can do whatever I want to my-include folder, but there is also a problem I can think of: a merge/compare burden between include and my-include folder after I have updated Mbed TLS.
I really appreciate other suggestions!
Thanks,
William
Hi All,
A gentle reminder that the US-Europe timezone-friendly MBed TLS Tech forum
is next Monday at 4:30pm UK time. Invite details can be found on the online
calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Janos know. :)
Don
My mbedtls client has been working for 2 years. It did what I required and
has been stable.
However, I now need to force a new server to use my preferred cipher suite.
I found the helper function to force the cipher suite here:
https://github.com/Mbed-TLS/mbedtls/blob/de4d5b78558666d2e258d95e6c5875f9c7…
I added mbedtls_ssl_conf_preference_order(conf,
MBEDTLS_SSL_SRV_CIPHERSUITE_ORDER_CLIENT) to the end of the function to
force the server to choose my ciphersuite.
Prior to this change I called the mbedtls functions in this chronological
order:
mbedtls_ssl_init(&_ssl);
mbedtls_ssl_config_init(&_conf);
mbedtls_ctr_drbg_init(&_ctr_drbg);
mbedtls_entropy_init(&_entropy);
mbedtls_x509_crt_init(&_cacert);
mbedtls_pk_init(&_pkey);
mbedtls_ctr_drbg_seed
mbedtls_ssl_config_defaults
mbedtls_ssl_conf_rng
mbedtls_ssl_conf_authmode
mbedtls_x509_crt_parse_file
mbedtls_ssl_conf_ca_chain
mbedtls_ssl_setup
mbedtls_ssl_set_hostname
and then proceed to call:
mbedtls_ssl_set_bio
mbedtls_ssl_handshake
Now:
If I call mbedtls_ssl_conf_ciphersuites BEFORE mbedtls_ssl_config_defaults,
the ciphersuite list is ignored/seems to get overriden.
If I call mbedtls_ssl_conf_ciphersuites AFTER mbedtls_ssl_config_defaults,
my ciphersuite list changes are accepted and transmitted (I can see in
Wireshark). The server then responds agreeing to use my chosen cipher suite.
However, mbedtls_ssl_handshake returns with value -26112, which I have
looked up to be MBEDTLS_ERR_SSL_ILLEGAL_PARAMETER.
Unfortunately I have no clue what is causing this.
Could somebody please advise how this should be done? I can see Client2
example but there are functions I have which are not in there. Client1
seems too simple for me but Client2 seems beyond what I require.
I am using MbedTLS client code based on this:
https://github.com/machinezone/IXWebSocket/blob/master/ixwebsocket/IXSocket…
I am connecting to a server via it's URL. However, I would like to connect directly using an IP address returned from running the traceroute command on the URL.
So I replaced the URL with the IP address. However, MBedTLS fails on the handshake:
https://github.com/machinezone/IXWebSocket/blob/master/ixwebsocket/IXSocket…
I get the error:
"error in handshake : X509 - Certificate verification failed, e.g. CRL, CA or signature check failed"
If I revert back to URL, it works. The IP address does exist.
How can I connect using the IP address, instead of the URL?
Micron Confidential
Hi,
I find that mbed-tls already support LMS, could you please Point to some reference and starting from which version mbedTLS lib version supports LMS?
Best Regards,
Raunak
Get Outlook for iOS<https://aka.ms/o0ukef>
Micron Confidential
Micron Confidential
Dear MbedTLS,
Can you please help to provide some references for LMS stateful signatures schemes support in MbedTLS,
May be something like documentation and github repo link?
Unfortunately I am not able to find it online?
Thanks,
Raunak
Get Outlook for iOS<https://aka.ms/o0ukef>
Micron Confidential
________________________________
From: Shebu Varghese Kuriakose <Shebu.VargheseKuriakose(a)arm.com>
Sent: Tuesday, September 3, 2024 8:48 PM
To: Raunak Gupta <raunakgupta(a)micron.com>; enquiries(a)trustedfirmware.org <enquiries(a)trustedfirmware.org>
Cc: nd <nd(a)arm.com>
Subject: [EXT] RE: Inquiry About PQC Cryptos in embedTLS Library
Micron Confidential
CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.
Hi Raunak,
Mbed TLS today supports LMS stateful hash-based signature scheme. While supporting other PQC algorithms is in the Mbed TLS project roadmap, the team isn’t actively working on it. The focus for the team now is preparing for Mbed TLS 4.0.
Feel free to ask any further technical questions in the Mbed TLS public mailing list - mbed-tls(a)lists.trustedfirmware.org<mailto:mbed-tls@lists.trustedfirmware.org> (https://lists.trustedfirmware.org/mailman3/lists/mbed-tls.lists.trustedfirm…)
Regards,
Shebu
Micron Confidential
From: 'Raunak Gupta' via TFenquiries <enquiries(a)trustedfirmware.org>
Sent: Tuesday, September 3, 2024 2:34 AM
To: enquiries(a)trustedfirmware.org
Subject: Inquiry About PQC Cryptos in embedTLS Library
Micron Confidential
Dear Trusted Firmware Team,
I hope this message finds you well. My name is Raunak, and I am a Security Engineer at Micron Technology.
I would like to inquire whether the embedTLS library has been updated to include Post-Quantum Cryptography (PQC) algorithms such as LMS, HSS, and XMSS.
Additionally, is the embedTLS team actively working on integrating these PQC algorithms?
Thank you for your assistance.
Best regards,
Raunak
Micron Confidential
To unsubscribe from this group and stop receiving emails from it, send an email to enquiries+unsubscribe(a)trustedfirmware.org<mailto:enquiries+unsubscribe@trustedfirmware.org>.
Dear Mbed TLS users,
We have released Mbed TLS versions 3.6.1 and 2.28.9. These releases provide bugfixes, security fixes and minor improvements.
The 3.6.1 release includes fixes for issues caused by enabling TLS 1.3 for TLS connections in the default configuration.
Full details are available in the release notes:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.28.9https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.1
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Many thanks,
David Horstmann
Mbed TLS developer
Hi all,
From the announcement and also the long term plans (https://mbed-tls.readthedocs.io/en/latest/project/long-term-plans/) it is apparent that bignum/ecp operations on the public API will go away and usage will be restricted to internal only.
I do understand and welcome the shift towards PSA API and to abandon the ALT interface for higher level legacy API crypto functions. However, I'm not so positive about removal of the bignum and ecp API. There are projects using those functions even in their PSA porting layer (Matter comes to mind: https://github.com/project-chip/connectedhomeip/blob/master/src/crypto/CHIP…) or projects using the bignum layer as abstraction (Zephyr hostap/wpa_supplicant: https://github.com/zephyrproject-rtos/hostap/tree/main/src/crypto, crypto_mbedtls*.c).
There might be a case to support those functions to have (hardware-accelerated) low level building blocks for algorithms Mbed TLS doesn't yet or never will support. As other SSL libraries such as OpenSSL also expose similar API (BN_ and EC_POINT_ ), the removal in Mbed TLS will certainly leave a gap.
What's the view here from the project team?
Cheers,
Gernot
Hi,
We are in the process of qualifying a suitable encryption library for our pre-hospital patient monitor and the telemedicine system. I am writing to request your guidance regarding the mbed-tls use for commercial purposes. I look forward to your response.
Regards,
Praveen Kumar
R&D Project Manager
Emergency Care Professional (EC-Pro)
Philips
Tel +44 (0) 1256 362427 Email praveen.m.kumar(a)philips.com<mailto:praveen.m.kumar@philips.com>
Remote Diagnostic Technologies Limited. Registered office: Ascent 1, Farnborough Aerospace Centre, Aerospace Boulevard, Farnborough GU14 6XW, UK. Registered in England No. 3321782.
[Logo Description automatically generated]<http://www.philips.com/>
Connect with Philips
[cid:image002.gif@01DAE7F8.0802FC50]<https://www.linkedin.com/company/philips/>[cid:image003.gif@01DAE7F8.0802FC50]<https://twitter.com/PhilipsHealth>[cid:image004.gif@01DAE7F8.0802FC50]<https://www.youtube.com/PhilipsHealthcare/videos>
________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
Hello,
Following consultations with the community and internal discussions
among the Mbed TLS maintenance team, we can now present the major
changes that will happen in the next major version of Mbed TLS. Our plan
remains to release in the second quarter of 2025.
The next major version will focus on two things:
1. The cryptography library will be a separate product called
TF-PSA-Crypto 1.0. The X.509 and TLS library will be called Mbed TLS
4.0, and will rely on TF-PSA-Crypto for all cryptographic functionality.
2. This release completes the migration of cryptography APIs from
classic mbedtls APIs to PSA APIs.
Please find more information below about what this means in practice.
What follows are just headlines, not an exhaustive list of changes. We
expect many small changes that do not affect major functionality.
Please note that the changes presented here are our current plan. We may
revise it based on new inputs, new insights or unexpected hurdles. You
can follow the advancement of the design, planning and development of
the next release on the 4.0+1.0 planning board at
https://github.com/orgs/Mbed-TLS/projects/15/views/1 .
Removal of legacy APIs
The following low-level application interfaces will no longer be present
in the API of TF-PSA-Crypto 1.0 and Mbed TLS 4.0:
* Hashes: hkdf.h, md5.h, ripemd160.h, sha1.h, sha3.h, sha256.h, sha512.h;
* Random generation: ctr_drbg.h, hmac_drbg.h, entropy.h;
* Ciphers and modes: aes.h, aria.h, camellia.h, chacha20.h,
chachapoly.h, cipher.h, cmac.h, gcm.h, poly1305.h;
* Private key encryption mechanisms: pkcs5.h, pkcs12.h.
* Asymmetric cryptography: bignum.h, dhm.h, ecdh.h, ecdsa.h,
ecjpake.h, ecp.h, rsa.h.
The cryptographic mechanisms remain present, but they will only be
accessible via the PSA API (psa_xxx functions introduced gradually
starting with Mbed TLS 2.17).
If you maintain code that uses these interfaces, you can already start
migrating it today, since almost all PSA interfaces are available in the
mbedtls-3.6 long-time support branch (and many even in 2.28 LTS). Please
consult the PSA transition guide
https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-3.6/docs/psa-transition.md
for guidance.
Some non-PSA crypto interfaces will still be present in TF-PSA-Crypto 1.0:
* pk.h will remain with some changes, mainly to provide an interface
to key parsing and formatting which does not have a PSA equivalent yet.
* md.h will remain as a thin layer over PSA hash functions (not HMAC)
to ease the transition.
* nist_kw.h will remain because it does not have a PSA equivalent yet.
Removal of legacy integration interfaces
TF-PSA-Crypto 1.0 and Mbed TLS 4.0 will no longer support
MBEDTLS_xxx_ALT replacement of functions and modules. Use PSA
transparent drivers instead.
TF-PSA-Crypto 1.0 and Mbed TLS 4.0 will no longer support
MBEDTLS_PK_RSA_ALT and MBEDTLS_PSA_CRYPTO_SE_C. Use PSA opaque drivers
instead.
TF-PSA-Crypto 1.0 and Mbed TLS 4.0 will no longer have the
mbedtls/entropy.h interface to configure entropy sources. This will be
replaced by PSA random drivers.
In addition, we are planning to rework the platform abstraction layer
(MBEDTLS_PLATFORM_xxx configuration options). More details will be
available in the coming months.
Removal of legacy mechanisms
The following cryptographic mechanisms are planned to be removed in
TF-PSA-Crypto 1.0 and Mbed TLS 4.0:
* DES (including 3DES).
* PKCS#1v1.5 encryption/decryption (RSAES-PKCS1-v1_5). (OAEP, PSS, and
PKCS#1v1.5 signature are staying.)
* Finite-field Diffie-Hellman with custom groups. (RFC 7919 groups
remain supported.)
* Elliptic curves of size 225 bits or less.
The following cipher suites are planned to be removed from (D)TLS 1.2 in
Mbed TLS 4.0:
* TLS_RSA_* (including TLS_RSA_PSK_*), i.e. cipher suites using RSA
decryption. (RSA signatures, i.e. TLS_ECDHE_RSA_*, are staying.)
* TLS_ECDH_*, i.e. cipher suites using static ECDH. (Ephemeral ECDH,
i.e. TLS_ECDHE_*, is staying.)
* TLS_DHE_*, i.e. cipher suites using finite-field Diffie-Hellman.
(Ephemeral ECDH, i.e. TLS_ECDHE_*, is staying.)
* TLS_*CBC*, i.e. all cipher suites using CBC.
Non-functional changes
Due to the separation into two separate products (TF-PSA-Crypto and Mbed
TLS), there will be major changes to the directory structure and to the
build system. We plan to use CMake as the primary build system.
Since TF-PSA-Crypto is a new product, identifiers that are not PSA
interfaces (such as optimisation options and platform interfaces) will
be renamed with a new prefix.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hi,
ECB is unsecure, see
https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_cod…
and shouldn't be used in production.
So, I have switched to one of CBC/CMAC/CTR modes, but in
`mbedtls_cipher_cmac_starts`
I see that it only accepts ECB variants, and also doesn't seem to be
using the `type`.
From https://github.com/Mbed-TLS/mbedtls/issues/8617 I see that ECB
for AES was intentional,
even for the CMAC API.
Is this expected?
1. Is using ECB for CMAC API correct?
2.Shouldn't we remove the ECB altogether?
Appreciate any clarifications.
Cheers,
Chaitanya.
Dear Trusted Firmware,
I’m Jay, an embedded security firmware developer at Hyosung TNS<https://global.hyosunginnovue.com/?lang_switch>.
We are a company that manufactures ATMs. For cryptographic communication between ATM PC software and ATM devices, we are looking for a cryptographic library to apply to ATM devices(e.g. cash dispenser). If there is an appropriate library that meets the requirements below, I would appreciate it if you could provide us an estimate. If custom development is required, I would also like to know the expected development period.
[Development environment]
- CPU : TI AM1806(ARM9)
- Compiler : ARM DS-5(armcc)
- RTOS : ThreadX
- C language
- No dynamic allocation
- VFP(Vectored Floating Point) not supported
[Security Features]
- RSA(2048bits) : Certificate and signature verification, Data encryption and decryption
- ECC(256bits) : Generating a symmetric key using ECDH and ECDSA
- 3DES, AES, AEAD, SHA256, HMAC256, etc : Algorithms related to data encryption and decryption
- Random : Prevent replay attacks
Please contact me if you have any questions.
Best Regards,
Jay
[cid:image001.png@01DAE289.1B3D4C90]
Jaewhan Shin
Performance Manager | CISSP | Firmware Development Team
Suseo Bldg., 281, Gwangpyeong-ro, Gangnam-gu, Seoul, 06349 Korea
t. 82-2-6181-2480, m. 82-10-8158-3015
e. jaewhan.shin(a)hyosung.com<mailto:jaewhan.shin@hyosung.com>
hyosunginnovue.com<https://hyosunginnovue.com/>
[cid:image002.png@01DAE289.1B3D4C90]<https://www.linkedin.com/company/hyosung-tns/> [cid:image003.png@01DAE289.1B3D4C90] <https://www.youtube.com/@hyosungtns3918>
HYOSUNG TNS, Inc. Email Disclaimer. This communication, including attachments, is intended only for the exclusive use of addressee and may contain proprietary, confidential, or privileged information. Any use, review, duplication, disclosure, dissemination, or distribution is strictly prohibited. If you were not the intended recipient, and you have received this communication in error, please notify sender immediately by return e-mail, delete this communication, and destroy any copies.
Hello,
Mbed TLS 3.6.0 was the first release to enable TLS 1.3 support by
default. Unfortunately, this breaks many applications that open a TLS
connection with default settings, which are now negotiating TLS 1.3
instead of TLS 1.2, but hit a difference in how Mbed TLS 3.6.0
implements the two versions of the protocol.
The most common symptom is: you are using the default configuration (or
something close), and your application fails in the handshake with an
internal error whenever it negotiates TLS 1.3. To resolve this, call
psa_crypto_init() before starting a TLS handshake.
For a list of other known issues, please see
https://github.com/Mbed-TLS/mbedtls/issues/9223
If you are encountering a problem due to the enablement of TLS 1.3 that
is not listed on that page, please let us know by opening an issue on
GitHub.
If no workaround or patch is available for your problem yet, you can
disable TLS 1.3 by calling mbedtls_ssl_conf_max_tls_version(ssl_config,
MBEDTLS_SSL_VERSION_TLS1_2) before mbedtls_ssl_setup().
We are planning to fix all the issues listed on that page before the
3.6.1 patch release. We do not yet have a date for the 3.6.1 release.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello!
I am trying to add TLS 1.3 support to OpenVPN when using Mbed TLS as the TLS library. My current roadblock is that OpenVPN needs the TLS-Exporter functionality (RFC 8446, Section 7.5).
For TLS 1.2, we get the master secret through mbedtls_ssl_set_export_keys_cb() and then implement the exporter using mbedtls_ssl_tls_prf(). For TLS 1.3, an approach like this doesn't work because the callback isn't called with the exporter master secret.
Am I missing anything, or does this feature not yet exist? Are there any plans to add it? If not, I'd be interested in trying to make a patch.
Best regards,
Max
https://www.bestwritercontent.com
A man was going to the house of some rich person. As he went along the road, he saw a box of good apples at the side of the road. He said, "I do not want to eat those apples; for the rich man will give me much food; he will give me very nice food to eat." Then he took the apples and threw them away into the dust.
He went on and came to a river. The river had become very big; so he could not go over it. He waited for some time; then he said, "I cannot go to the rich man's house today, for I cannot get over the river."
He began to go home. He had eaten no food that day. He began to want food. He came to the apples, and he was glad to take them out of the dust and eat them.
Hi All,
A gentle reminder that the Asia-Europe timezone-friendly MBed TLS Tech
forum is next Monday at 10:00am PM UK time. Invite details can be found on
the online calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Dave Rodgman know. :)
Best regards,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
ReplyReply to allForward
Compose:
Community activity: OpenCV, Sensors, AI
[image: Minimise][image: Pop-out][image: Close]
Compose:
Reminder: MBed TLS Tech Forum - Asia/Europe
[image: Minimise][image: Pop-out][image: Close]
Recipients
Hi All,
We are using the MBedTLS 3.6.0 release stack and often see the TLS
client -> server sending Encrypted Alert 21 packets followed by
closing the SSL connection (or rather reconnection starting from new
handshake messages).
As far as I understand Alert 21 is a fatal message stating Decryption
of a TLSCiphertext record is decrypted in an invalid way: either it
was not an even multiple of the block length or its padding values,
when checked, were not correct - copied from the Internet.
But then Handshake and Application Data goes thru fine for a while and
then we see our client sending Alert 21 encrypted message
Is it legitimate that the client can send Alert 21 messages to the
server and close the current connection - we are observing that the
server application is waiting for messages from the client and is
un-aware that a connection reset has occurred. So the server
application states a timeout for receiving messages from the client.
Further, how can we assert such a scenario? When and how can it occur?
Is there a way we can simulate it and send details to owners of server
firmware to fix their issue?
Regards,
Prakash
Hi All,
We are using MbedTLS on our devices and implementing PSA wrappers to use our Crypto hardware.
For validating this one we are using MbedTLS test suites.
Could you please tell me:
1. Does your test suites compliant to FIPS 140-3?
2. Do you use NIST test vectors to validate your algorithm implementations?
Thanks.
Viktor Ivanets.
On a project at my company, we're using mbedtls to encrypt and sign our
data. We began the project with mbedtls 2.2.6, and have continuously
upgraded until now, 3.6.0.
I've noticed my application has grown greatly since then, even though we
are only using the following APIs:
Encryption:(only decryption on the embedded side)
- mbedtls_aes_init
- mbedtls_aes_setkey_dec
- mbedtls_aes_crypt_cbc
Signing (only verification on the embedded side)
- mbedtls_ecp_point_read_binary
- mbedtls_sha256_init/free
- mbedtls_sha256_starts_ret
- mbedtls_sha256_update_ret
- mbedtls_sha256_finish_ret
- mbedtls_ecdsa_init/free
- mbedtls_ecp_group_load
- mbedtls_ecdsa_read_signature
The size of libembedcrypto.a has grown from under 400K to almost 800K.
I've tried reducing it with mbedtls_config,h, but it is not entirely clear
to me which #defines do what. I tried one of the sample configs which by
it;s name looked promising (crypto-config-ccm-aes-sha256.h), and it reduced
the size of the library by 90%, but left me with link errors for all of the
above functions. Going one #define at a time manually to see if it saves
or grows is slow, and so I hoped I could find some assistance here.
Thanks in advance
Hi TF-M and mbedtls community,
I am new to TF-M, I have a few questions about CryptoCell and random number generation. Thank you in advance.
1.
I figure there seems to have two CryptoCell 312 implementations within TF-M. One under lib/ext/cryptocell-312-runtime and the other under platform/ext/accelerator/cc312/cc312-rom. What are the difference between these two?
2.
For lib/ext/cryptocell-312-runtime, it does not define MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG whereas /ext/accelerator/cc312/cc312-rom does. Does that mean cryptocell-312-runtime is initiating RNG cryptodriver by using mbedtls_entropy_add_source whereas cc312-rom is using mbedtls_psa_external_get_random<https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/8df9cc8baf462…>. If so, may I ask why these two cryptocells take two different approaches? I read from one of the documentation that mbedtls_psa_external_get_random is used when entropy is sufficient. So if entropy is sufficient, is it always preferred to have MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG defined and implements mbedtls_psa_external_get_random? What are the differences between the two approaches.
3.
I also found cryptocell-312-runtime defines the entry point function cc3xx_init_random<https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/8df9cc8baf462…>. But since PSA random number entry point funciton is not complete, the cc3xx_init_random is not being called anywhere, right?
[https://opengraph.githubassets.com/17cdebc400b0ed807c620b586b21f3f77ff9c5d3…]<https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/8df9cc8baf462…>
trusted-firmware-m/platform/ext/accelerator/cc312/cc312-rom/psa_driver_api/src/cc3xx_psa_random.c at 8df9cc8baf46252fd188bba1d87333a8daa9a5e8 · zephyrproject-rtos/trusted-firmware-m<https://github.com/zephyrproject-rtos/trusted-firmware-m/blob/8df9cc8baf462…>
Zephyr repository tracking https://git.trustedfirmware.org/trusted-firmware-m.git/ - zephyrproject-rtos/trusted-firmware-m
github.com
4.
I know random number generation PSA entry point function is in development, may I ask when that would be expected to complete?
Thank you very much!
Best regards,
Hao
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/107
Should TF-PSA-Crypto 1.0 (and thus Mbed TLS 4.0) have an interface for
*pseudo*-random generation? It will, of course, still have a
pseudorandom generator (= deterministic random bit generator = DRBG)
internally, to power psa_generate_random(), psa_generate_key(), etc. The
question is whether there will still be a public interface to create
other DRBG instances, and if so, with what interface.
If you want to be able to create instances of HMAC_DRBG and CTR_DRBG
from application code in TF-PSA-Crypto 1.0, please let us know what your
use case is. In particular, what parameters do you need (HMAC_DRBG and
CTR_DRBG have many)? Do you need reseeding, and if so under whose
control (the DRBG, or the caller)? In the absence of feedback, it is
likely that HMAC_DRBG and CTR_DRBG will not be publicly available.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hi all,
I have a custom configuration where MBEDTLS_ECDSA_C is defined but MBEDTLS_PSA_CRYPTO_C and MBEDTLS_PSA_CRYPTO_CONFIG are not.
This leads to a compiler warning in e.g. psa_util.c because a zero-sized array is declared
(because PSA_VENDOR_ECC_MAX_CURVE_BITS is defined as 0).
As of C99, §6.7.5.2 Array declarators: "If the expression is a constant expression, it shall have a value greater than zero."
psa_util.c:
#if defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) // Line 368
int mbedtls_ecdsa_raw_to_der(...) // Line 433
unsigned char r[PSA_BITS_TO_BYTES(PSA_VENDOR_ECC_MAX_CURVE_BITS)]; // Line 436 --> becomes in my config: unsigned char r[0];
MBEDTLS_PSA_UTIL_HAVE_ECDSA is automatically defined in my configuration due to the following code in config_adjust_legacy_crypto.h:
#if defined(MBEDTLS_ECDSA_C) || (defined(MBEDTLS_PSA_CRYPTO_C) && \
(defined(PSA_WANT_ALG_ECDSA) || defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)))
#define MBEDTLS_PSA_UTIL_HAVE_ECDSA
#endif
PSA_VENDOR_ECC_MAX_CURVE_BITS only receives a non-zero value if a PSA_WANT_<CURVE>, e.g. PSA_WANT_ECC_BRAINPOOL_P_R1_256, is defined.
PSA_WANT_<CURVE> only gets defined in crypto_config.h if MBEDTLS_PSA_CRYPTO_CONFIG is defined (which it is not in my configuration).
I have worked around it by explicitly defining e.g. PSA_WANT_ECC_BRAINPOOL_P_R1_256 in my configuration.
But I believe there is some mismatch in the defines, at least in this example case, because mbedtls_ecdsa_raw_to_der() is only used in pk_wrap.c if MBEDTLS_USE_PSA_CRYPTO is defined.
Impact:
* In general, zero-sized arrays have undefined behavior in C (but are allowed by some compiler extensions) and thus behave differently for different compilers
--> you might want to review PSA_VENDOR_ECC_MAX_CURVE_BITS and PSA_VENDOR_FFDH_MAX_KEY_BITS (and possibly more definitions) that fall through to 0 and are used as array sizes.
* In my particular case, I believe code is compiled that is not needed (defines in psa_util.c and pk_wrap.c do not seem to match)
Hello,
This is a request for feedback about the next major release of Mbed TLS
(Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain supported with its current
feature set until at least Q2 2027.) Please reply to this thread or on
the GitHub issue linked below. If you wish to leave feedback privately,
you can reply privately and your feedback will be anonymized before
sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/9307
Mbed TLS requires a C99 platform, with some pragmatic restrictions. One
restriction is that we do not require printf and friends to support %zu
for size_t printing. Starting with Mbed TLS 4.0, we are considering
requiring printf() and friends (or the mbedtls_printf() and friends
alternatives if overridden) to support %zu. This only affects the TLS
library, not X.509 and crypto.
Is it still necessary in 2025 to support platforms where printf() does
not support the z modifier?
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/106
We are evaluating build systems for TF-PSA-Crypto, and this will
influence the Mbed TLS build as well (the Mbed TLS build scripts will
call the TF-PSA-Crypto build scripts, whatever they are). Our current
thinking is that we would like to have *CMake as the sole build system*.
(We're still investigating whether CMake can do all we need.) That would
mean that we would no longer provide GNU makefiles or Visual Studio
solutions.
As this remains a C project, for just building the library, compiling
all the .c files with an include path covering all the .h files will
keep working in common cases (but, as today, it isn't something we
support officially). The main case I can think of where this wouldn't
work is when cryptographic accelerator support requires special includes
or compiler flags.
Are there environments where the use of CMake is a problem? What is the
oldest version of CMake that you'd like us to be compatible with?
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain supported with its current
feature set until at least Q2 2027.) Please reply to this thread or on
the GitHub issue linked below. If you wish to leave feedback privately,
you can reply privately and your feedback will be anonymized before
sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/8170
We are considering removing support for RSA and RSA-PSK key exchanges in
Mbed TLS 4. These are cipher suites that use RSA encryption, as opposed
to cipher suites using a key agreement (ECDHE) plus RSA signature. These
key exchanges are hard to implement securely (we believe we got it
right, but it's very delicate code), and they add significantly to the
complexity of the TLS code. They have been formally deprecated for a
long time and were removed in TLS 1.3. However, I'm aware that some
ecosystems are clinging to RSA key exchange.
Are RSA-encryption key exchanges still relevant for Mbed TLS? If you
want Mbed TLS 4 to keep supporting RSA-encryption cipher suites in TLS
1.2, please let us know and tell us about your use cases.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/8231
We currently have two implementations of accelerated AES on x86_64 using
AESNI (Intel AES acceleration): using assembly or using compiler
intrinsics. The assembly code works with GCC and Clang without any
compilation options, but not with MSVC. The intrinsics work with MSVC,
but not with ancient GCC/Clang and they require compiling at least
aesni.c with suitable CPU variant options (e.g. -maes -mpclmul for Clang).
We're considering removing the assembly implementation. Is there still
interest in compiling AESNI support with older compilers or with simple
build systems that don't pass machine options?
Best regards,
--
Gilles Peskine
Mbed TLS developer
+ Mbed TLS mailing list as well for visibility and any comments.
Regards,
Shebu
From: Zhang, Hao via TF-M <tf-m(a)lists.trustedfirmware.org>
Sent: Wednesday, June 5, 2024 12:37 AM
To: tf-m(a)lists.trustedfirmware.org
Subject: [TF-M] PSA Cryptoprocessor Driver Interface
Hi TF-M community,
TF-M allows Semiconductor vendors to plug in their HW accelerator using PSA cryptoprocessor driver interface. I have a couple of questions in terms of the driver interface.
1. To port customized HW accelerator to TF-M's Crypto service for TF-M v2.1.0 LTS using driver interface, for the multipart operation, https://github.com/zephyrproject-rtos/mbedtls/blob/zephyr/docs/proposed/psa… states that "A driver that implements a multi-part operation must define all of the entry points in this family as well as a type that represents the operation context." Take aead encrypt as an example, if the underlying hardware does not support aead_abort, could it implements aead_abort by simply return PSA_ERROR_NOT_SUPPORTED?
1. The driver interface depends heavily on psa_crypto_driver_wrappers.h to dispatch operations to customized HW accelerator, where the psa_crypto_driver_wrappers.h file is automatically generated by scripts/data_files/driver_templates/psa_crypto_driver_wrappers.h.jinja. To port customized HW accelerator to TF-M's Crypto service for TF-M v2.1.0 LTS, would the approach be creating a customized psa_crypto_driver_wrappers.h.jinja file, the driver description file in JSON, and entry point functions. If so and we are considering upstreaming TF-M in the future, all these files would go inside platform/ext/accelerator/<vendor name>. Efforts need to be made so files such as psa_crypto_driver_wrappers.h.jinja should point to mbedtls, right? Additionally, as .jinja is retiring (mentioned in another email exchange), how would semi vendors update psa_crypto_driver_wrappers.h in the future?
[https://opengraph.githubassets.com/c87e79773a7fb0841ea038f7cf3dfdf4170debb8…]<https://github.com/zephyrproject-rtos/mbedtls/blob/zephyr/docs/proposed/psa…>
mbedtls/docs/proposed/psa-driver-interface.md at zephyr * zephyrproject-rtos/mbedtls<https://github.com/zephyrproject-rtos/mbedtls/blob/zephyr/docs/proposed/psa…>
mbedtls module for Zephyr, this is not a mirror of the official mbedtls repository. - zephyrproject-rtos/mbedtls
github.com
Thank you very much!
Best regards
Hi,
Not sure whether I should report this as a bug or maybe an enhancement issue or maybe it is as-designed:
I recently migrated from 2.28.8 to 3.6.0 and noticed:
An X.509 certificate DN coded as T61 string (done automatically so by openssl for a DN that contains an underscore) is returned as a hex string in 3.6.0 while it is returned as a regular, human-readable string in 2.28.8.
As this is not working for us I patched mbedtls_c509_dn_gets() locally as shown below.
Please feedback whether you want me to report an issue or if the 3.6.0 behavior is as-designed for a good reason.
Best regards,
/Almut
--- mbedtls-3.6.0_orig/library/x509.c 2024-03-28 09:59:12.000000000 +0100
+++ mbedtls-3.6.0/library/x509.c 2024-05-21 10:43:43.327442284 +0200
@@ -840,9 +840,7 @@
MBEDTLS_X509_SAFE_SNPRINTF;
}
- print_hexstring = (name->val.tag != MBEDTLS_ASN1_UTF8_STRING) &&
- (name->val.tag != MBEDTLS_ASN1_PRINTABLE_STRING) &&
- (name->val.tag != MBEDTLS_ASN1_IA5_STRING);
+ print_hexstring = !MBEDTLS_ASN1_IS_STRING_TAG(name->val.tag);
if ((ret = mbedtls_oid_get_attr_short_name(&name->oid, &short_name)) == 0) {
ret = mbedtls_snprintf(p, n, "%s=", short_name);
I have a very basic use case, to use a buffer and perform ECDSA encryption in a TA application.
I also want to read back the private key which is generated.
I see functions like mbedtls_ecp_gen_key but I have failed to find enough details on what steps to follow to use this function.
It will be really helpful if I can be pointed to a example. Or let me know If there is some other way to achieve the end goal.
Hello Gilles,
I see that you are requesting feedback on a set of issues, but not on
support of EdDSA. Yet, support for ED25519 is an important requirement
for TLS and QUIC. With other crypto suites, the CPU load is
significantly lower for ED25519 than for ECDSA/secp255r1.
Somewhat related, but there is also demand for ChaCha20-poly1035, for
performance reason on some systems.
Are there any plans?
-- Christian Huitema
Hello,
This is a request for feedback about the next major release of Mbed TLS
(Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain supported with its current
feature set until at least Q2 2027.) Please reply to this thread or on
the GitHub issue linked below. If you wish to leave feedback privately,
you can reply privately and your feedback will be anonymized before
sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/9202
In 2025 (by the time Mbed TLS 4.0 is released), are CBC-based cipher
suites still relevant for Mbed TLS? If you still need support for
CBC-based cipher suites (as opposed to cipher suites using AEAD: CCM,
GCM or ChaChaPoly, or null cipher suites), please let us know.
Removing them would allow us to significantly simplify some parts of the
TLS code. They are difficult to implement securely due to being very
sensitive to side channels; we think we got it right, but at the expense
of performance, code size and maintainability.
One option we're considering is to keep CBC cipher suites, but only when
the encrypt-then-MAC (EtM) extension is enabled. However, this is
problematic because the TLS protocol does not allow a client to indicate
that it requires EtM support, which could lead to a failed connection
even when the server also have an AEAD cipher suite in common.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(Mbed TLS 4.0). (Mbed TLS 3.6 LTS will remain supported with its current
feature set until at least Q2 2027.) Please reply to this thread or on
the GitHub issue linked below. If you wish to leave feedback privately,
you can reply privately and your feedback will be anonymized before
sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/9201
We are considering removing static ECDH cipher suites. (Mbed TLS has
never supported static non-EC DH.) They are officially deprecated by RFC
9325. OpenSSL dropped them in 2016. If you want Mbed TLS 4.0 to continue
supporting ECDH, please let us know in what ecosystem they're still
relevant.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4,0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/8151
We are planning to remove the dynamic secure element interface enabled
by MBEDTLS_PSA_CRYPTO_SE_C, in favor of PSA secure element drivers
declared at compile time. The functionality is the same, but with a
cleaner interface (we learned from the first draft). However, this does
mean that all drivers must be declared at compile time.
If you are currently using MBEDTLS_PSA_CRYPTO_SE_C and relying on
runtime declaration of drivers, please let us know about your use case,
so that we can try to find an alternative solution.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4,0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/103
We are removing all the ALT interfaces to implement hardware-accelerated
cryptography, in favor of PSA drivers. For the most part, PSA
accelerator drivers provide equivalent functionality to ALT interface.
However, there is one main exception: the ECC code allows replacing just
code ECC arithmetic (MBEDTLS_ECP_ALT) or even just selected functions
(sub-options of MBEDTLS_ECP_INTERNAL_ALT). On the other hand, the
granularity of PSA accelerators is whole mechanisms: ECDH, ECDSA, etc.
on a specific set of curves.
If you are currently using MBEDTLS_ECP_ALT or MBEDTLS_ECP_INTERNAL_ALT
to implement accelerated ECC airthmetic and relying on code from ecp.c,
ecdh.c and ecdsa.c to provide ECC mechanisms, please let us know what
your requirements are and how much of a pain it would be to have to
fully implement ECDH/ECDSA/... in your driver.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4,0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/105
Mbed TLS 4 and TF-PSA-Crypto will complete our migration to PSA
cryptography APIs. For simplicity, PSA only requires implementations to
support complete representations RSA private keys, where all the fields
are provided (n, e, d, p, q, dp, dq, u). Thus, with only PSA APIs, it is
not possible to import an RSA private key without the public exponent,
or an RSA private key without the CRT parameters.
Should TF-PSA-Crypto provide an extension to support such private keys?
If you need this, please let us know about your use case.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4,0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/102
Mbed TLS 4 and TF-PSA-Crypto will complete our migration to PSA
cryptography APIs, which are higher-level than the legacy mbedtls_xxx()
APIs in Mbed TLS ≤3.x. As a consequence, the API will only provide
access to ECC-based cryptographic mechanisms such as ECDH, ECDSA and
ECJPAKE. (ECIES can be implemented on top of ECDH. Support for EdDSA and
SPAKE2+ is planned, but might not be ready at the 4.0 release time.) It
will not provide access to ECC arithmetic functions such as
mbedtls_ecp_muladd().
Do you need custom ECC-based mechanisms (e.g. custom PAKE)? If so,
please let us know which mechanisms and what arithmetic they require. We
are not currently planning to make it possible to use such mechanisms
without patching the TF-PSA-Crypto code.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4,0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/104
Mbed TLS 4 and TF-PSA-Crypto will complete our migration to PSA
cryptography APIs, which are higher-level than the legacy mbedtls_xxx()
APIs in Mbed TLS ≤3.x. As a consequence, the API will only provide
access to RSA-based encryption and signature mechanisms (PKCS#1v1.5
encryption, OAEP, PKCS#1v1.5 signature, RSS), not to the low-level
RSA-public and RSA-private operations.
Do you need custom RSA-based mechanisms (e.g. full-domain encryption or
hashing)? If so, please let us know. We are not currently planning to
make it possible to use such mechanisms without patching the
TF-PSA-Crypto code.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hello,
This is a request for feedback about the next major release of Mbed TLS
(TF-PSA-Crypto 1.0 + Mbed TLS 4,0). (Mbed TLS 3.6 LTS will remain
supported with its current feature set until at least Q2 2027.) Please
reply to this thread or on the GitHub issue linked below. If you wish to
leave feedback privately, you can reply privately and your feedback will
be anonymized before sharing outside Arm.
https://github.com/Mbed-TLS/mbedtls/issues/9164
We are considering fully removing DES, including 3DES, from the library.
Is any DES variant still relevant to Mbed TLS users these days? If you
want Mbed TLS 4 to include DES, please let us know what you're using it for.
Reasons to remove: it's long obsolete, and no longer accepted even by
NIST except to handle legacy data. Removing it would be one less module
to support and would allow generic block cipher code to focus on modern
ciphers with 128-bit blocks.
Best regards,
--
Gilles Peskine
Mbed TLS developer
I am trying to build *https://github.com/ithewei/libhv
<https://github.com/ithewei/libhv>* with MBEDTLS on Windows but it doesn't
have include and library define options on *CMake*. When I ask them with an
issue on *GitHub*, they said I need to use *"Default Search Path"*. I
installed it with *cmake --build . --config Release --target INSTALL *and I
can see it in *Program Files/MBed TLS. *I think I need to define an
environment variable. But what is correct names for includes and libraries ?
Hi Team,
Need support on one the below query. I had previously raised this in issue #9116 : Client certificate verify · Issue #9116 · Mbed-TLS/mbedtls · GitHub<https://github.com/Mbed-TLS/mbedtls/issues/9116> .However I was asked to redirect the query to the mbedTLS support.
Q#1 : I have a client certificate chain (end entity cert, intermediate cert and root cert) and I have got 1 public key (extracted from root CA cert) on my server. Is there any way in mbedTLS where I can validate the client certificate using just the public key of the root CA and not the whole root CA certificate on my server?
As per my understanding of CA and certificate validation we would need a whole CA cert and not just the public key of the root certificate. However, I would like to know if there are any API's in mbedTLS for this validation?
Thanks,
Sushma
________________________________
Disclaimer: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient of this message , or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. Email transmission cannot be guaranteed to be secure or error-free, as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender, therefore, does not accept liability for any errors, omissions or contaminations in the contents of this message which might have occurred as a result of email transmission. If verification is required, please request for a hard-copy version.
________________________________
I am testing a test program in an Ubuntu VM, and I have an issue.
I started by configuring MbedTLS in "full" mode (scripts/config.py
full), but in that case the linker fails, "in function
`psa_load_builtin_key_into_slot`, psa_crypto_slot_management.c:
undefined reference to 'mbedtls_psa_platform_get_builtin_key`.
I can suppress the error by editing `include\mbedtls\mbedtls_config.h`
and removing the option `MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS`. The compile
succeeds, but the call to `psa_crypto_init` fails when initializing the
RNG module.
I am struggling. I must be making some mistake, I will keep trying to
understand, but I would appreciate a little bit of help!
-- Christian Huitema
Hello Mbed TLS team,
Mbed TLS 3.6 introduced the first UTF-8 characters “±” in source code, see mbedtls_config.h, line 4179:
* at the same pace. The typical accuracy of an RTC crystal is ±100 to ±20 parts
Is this intended?
Thanks
Stephan
The specification of the "psa_verify_message" function is simple enough:
pass a key ID, an algorithm ID, the data that were signed, the signature
received from the peer, and receive a status. There is just one tiny
problem: in the application, the algorithm ID is specified as a 16 bit
TLS SignatureScheme
(https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-si…),
which is not quite the same as "psa_algorithm_t". Is there a simple way
to covert from TLS SignatureScheme to PSA ALgorithm identifier? Maybe a
two columns table?
-- Christian Huitema
Hi,
I have an inhouse developed secure authentication program that uses certificate for authentication. I have used mbedtls library for the x.509 certificate verification purpose. In our custom PKI we have only three level of certificates, Root-CA -> Intermediate-CA -> Device-Cert.
The embedded device has very limited memory, so instead of sending whole certificate chain, the devices communicates intermediate_CA and device cert (in der format base64 encoded) in separate packet. Root-CA will be available on node as trusted-ca. Intermediate is verified against Root; then device cert is verified against intermediate.
The problem is, the poc developed on linux platform is working fine - but on embedded platform I encounter either 0x3b00(parsing failed) or 0x2700(with flag 8). Also the error code are inconsistent.
I verified the integrity of packet with certificate using crc16. So no chance of certificate getting corrupted. Also verified the certificate's base64 format integrity using crc16.
All certificates are sha256WithRSAEncryption; RSA Public-Key: (4096 bit)
Attached config.h on target platform for reference - could you help me if anything wrong with configuration.
While trying to trace, the flag was set from x509_crt.c from below code.
/* No parent? We're done here */
if( parent == NULL )
{
printf("NO_PARENT\r\n");
*flags |= MBEDTLS_X509_BADCERT_NOT_TRUSTED;
return( 0 );
}
Any clue would be helpful.
Thanks,
Gopi Krishnan
Hi, I'm having an issue with some code using Mbed TLS and I was pointed to this mailing list as the correct place to ask for support. Please let me know if I should ask somewhere else. I'm trying to connect to my local government's website via a Raspberry Pi Pico, using a TLS client based on lwIP and altcp_tls. It's based off of the example from the Raspberry Pi team here: https://github.com/raspberrypi/pico-examples/tree/master/pico_w/wifi/tls_cl… . My Mbed TLS config is the same as what they have there, aside from some extra defines I added for debugging. The issue I am facing is that while various hosts work fine (e.g. postman-echo.com for testing), when I attempt to connect to my local council's website I get a TLS handshake error. My client has TLS verification disabled for the moment, but I have tried with the correct root certificates as well. The error I receive is mbedtls_ssl_handshake failed: -30592 I cloned down the mbed_tls repo, and had a similar issue with ssl_client1 -- i.e. works on postman-echo, not for my government, with mbedtls_ssl_handshake returning the error. Notably however, the error code in that instance was -31488. Interestingly, ssl_client2 works flawlessly with both hosts. I wasn't quite sure what part of ssl_client2 would cause it to work with my government host, as it's several thousand lines long, but I'm sure the answer is in there somewhere. I've attached a trace taken with debug logging level 4 on my Pico which shows where the TLS handshake is failing. I'd really appreciate any guidance of areas to troubleshoot next. Thanks, Jay
Hello,
I am referencing the Mbed TLS (v3.5) implementation for key slots & how they interact with the PSA key management APIs. In the PSA documentation<https://arm-software.github.io/psa-api/crypto/1.1/overview/implementation.h…>, sections 6.3.3 and 6.3.4 describe that persistent keys (that are handled according to the Memory cleanup rule) would have to be loaded from NVM on each use of the key, unless PSA_KEY_USAGE_CACHE is set.
However, I'm not certain I see this followed in the Mbed TLS code. 'psa_export_key()' is the simplest example. This function retrieves and locks the key slot for the requested key ID using 'psa_get_and_lock_key_slot_with_policy()' - this function may retrieve the persistent key material from NVM if necessary (it seems to return sooner if it finds that persistent key in a slot already). The remainder of psa_export_key() copies the key material from the slot directly to the output buffer, but it never removes the key material from the slot.
My understanding was that the key material should be removed from the slot unless PSA_KEY_USAGE_CACHE was set. Can anyone clear this up for me? Does this just mean that the reference implementation does not follow the memory cleanup rule, or is the slot buffer cleared at some later point for the persistent key?
Thank you,
Kevin Zak
Hi All,
A gentle reminder that the US-Europe timezone-friendly MBed TLS Tech forum
is next Monday at 4:30 PM UK time. Invite details can be found on the
online calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Dave Rodgman know. :)
Best regards,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
Dear Mbed TLS users,
We recently announced the release of Mbed TLS 3.6.0, starting the 3.6 long-term support branch. We intend for this to be the last 3.x feature release. Mbed TLS 3.6.x will as usual receive bug fixes (including security improvements), but no new features. This will allow the Mbed TLS team to focus on preparing the next major release, Mbed TLS 4.0, planned for 2025 (expect further updates when the timeline becomes more precise).
The main focus of Mbed TLS 4.0 is to complete the migration to PSA crypto APIs. This means that most mbedtls_xxx cryptography APIs will be removed. We expect mbedtls_x509 and mbedtls_ssl to change in relatively minor, but sometimes incompatible ways. Alongside this technical change, the crypto APIs will be published as a separate product, TF-PSA-Crypto<https://github.com/Mbed-TLS/TF-PSA-Crypto> (very early preview so far), while the X.509 and TLS libraries will continue to be called Mbed TLS.
The work on 4.0 will happen on the development branch in the mbedtls repository, so you can expect more instability than usual on that branch. The mbedtls-3.6<https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-3.6> branch is available if you want the latest patches on Mbed TLS 3.6 LTS.
As usual, you can see our high-level plans in the roadmap<https://mbed-tls.readthedocs.io/en/latest/project/roadmap/>, and in more detail on GitHub<https://github.com/Mbed-TLS/mbedtls/issues>. Look for issues labeled api-break<https://github.com/Mbed-TLS/mbedtls/issues?q=is%3Aissue+is%3Aopen+label%3Aa…> (note that we haven't filed issues on all topics yet).
We will launch some consultations on the mbed-tls mailing list<https://lists.trustedfirmware.org/mailman3/lists/mbed-tls.lists.trustedfirm…> soon, to gather community input on some topics.
Many Thanks,
Nathan Sircombe
(On behalf of the Mbed TLS development team)
Hi Mbed TLS list,
I’d just like to introduce myself to the wider Mbed TLS community.
I’ve recently joined the Mbed TLS team as the Engineering Manager for the Arm team. Although I’m new to this project, I’m not new to Arm having worked here for a while on a number of closed and open source library projects.
I look forward to working with you, and meeting some of you on our regular community calls.
Cheers,
Nathan.
p.s. my GitHub usid is nSircombe (https://github.com/nSircombe)
hello:
Recently, I am transplanting mbedtls from a 32-bit system to a 64-bit system. The compilation operating system is ubuntu20.4. The screenshot below is the code I use mbedtls(version number: 2.24.0). In the API mbedtls_rsa_gen_key implementation, there is a line of code that is ""MBEDTLS_MPI_CHK( mbedtls_mpi_lset( &ctx ->E, exponent ) );"", the program crashed at the memset in mbedtls_mpi_set during execution. This has not happened on 32-bit platforms before, so I would like to ask whether it has something to do with the platform used or whether I call the API. It’s a question about how to use it, thank you very much
Hi, I am trying to identify the API available by looking up exported symbols from the built shared libraries libmbedcrypto.so ,libmbedtls.so and libmbedx509.so. I noticed that many of the exported functions are not documented here https://mbed-tls.readthedocs.io/projects/api/en/development/ . My question really is, are those functions exported through the shared libraries intended to be so ? For example, function mbedtls_mpi_core_add does not seem to be part of the API but it is exported. Is this intentional ? It's not uncommon that functions would be exported but not part of the API, I just wanted to get some clarification if possible regarding the reasons for doing so in the case of MbedTLS. Thanks Ahmed
Hi,
I am sorry but I need to know test case scenarios to verify what is
supported in the recent MBedTLS stack - what should be tested.
Objective is that we cover MBedTLS code the maximum.
Since I am a new learner, I need to build the test cases from
scratch. So I thought to first find from stack what TLS ciphers suites
/ digest it supports, what are the different keysize, and protocols -
TLSvX (where x=1,2 or 3). Then build certificates related to the same
and verify the data as found. Are there other ways to find different
features in the current MBedTLs stack and verify each one of them?
Is this approach the right way - do we have known test case scenarios
to verify? Any other additional help will aid us out.
Thanks in advance.
Regards,
Prakash
Hi All,
This is going out to all the primary TF maillists.
It's a gentle reminder that a TF Discord channel has been created for all
chat communications in the TF ecosystem. All TF participants are
encouraged to join.
Instructions on how to join can be found here:
https://www.trustedfirmware.org/faq/ <https://www.trustedfirmware.org/faq/>
[image: Screenshot 2024-04-17 at 7.08.01 AM.png]
Please let me know if you have any questions,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
Hello,
I am trying to add TLS 1.3 support to a curl project
(https://github.com/MAntoniak/curl). As a result, it has two questions.
The first refers to the error code
MBEDTLS_ERR_SSL_RECEIVED_NEW_SESSION_TICKET. This suggests an error
receiving a new session ticket. I couldn't find anything else in the
documentation. However, in the ssl_cllient2.c example application (line
2638), this code is used as a message to the application about a new
session ticket. This makes me unsure whether it would be correct to
continue receiving application data normally.
The second question relates to the receipt of tickets. The curl project
does not store session tickets, so it uses the
MBEDTLS_SSL_SESSION_TICKETS_DISABLED flag. If this is the case, why do
we nevertheless receive a new ticket from the server?
Thank you for your reply.
Michał Antoniak
Hello,
I have an implementation in OpenSSL and am trying to recreate it using
MbedTLS. One of the differences in these two I have yet to overcome is
the following:
Is there a way to treat mbedtls_x509_crt simply as a certificate store?
Say I have some PEM data, parse it into a temporary mbedtls_x509_crt and
then I would like to append this certificate to said mbedtls_x509_crt
certificate store.
The following is stated in the docs of mbedtls_x509_crt:
> struct mbedtls_x509_crt *next
Next certificate in the linked list that constitutes the CA chain.
NULL indicates the end of the list. Do not modify this field directly.
Is there a way to achieve this if it's advised not to modify the field
directly?
Thank you in advance,
Roman.
Hey All,
I am trying to generate ECDSA public-private key pair for self-signed
certificate, and came across these examples
In gen_key.c
<https://github.com/Mbed-TLS/mbedtls/blob/bee96566dac936e7fdfa7aa18b6a1f6767…>,
"mbedtls_ecp_gen_key()" is used
In ecdsa.c
<https://github.com/Mbed-TLS/mbedtls/blob/bee96566dac936e7fdfa7aa18b6a1f6767…>,
"mbedtls_ecdsa_genkey()" is used.
My questions are:
- Which function should be used? (It seems mbedtls_ecdsa_genkey() is
just a wrapper of mbedtls_ecp_gen_key()?)
- If using mbedtls_ecdsa_genkey(), what are the steps to write the
public key into PEM format? (My understanding is that I define a
mbedtls_pk_context, and convert its address into mbedtls_ecdsa_context *,
and pass the pointer into mbedtls_ecdsa_genkey, and then call
mbedtls_ecdsa_genkey(), is this correct?)
Thanks,
Tom
Hi Satya,
Is this issue related to the one described in your previous email “[mbed-tls] EAP TLS - TLSv1.2 Record Layer: Alert (Level: Fatal, Description: Unknown CA)”?
Kind regards,
Janos
From: Satya Prakash Prasad <satyaprakash.developer.unix(a)gmail.com>
Date: Friday, 12 April 2024 at 16:27
To: Janos Follath <Janos.Follath(a)arm.com>
Subject: Re: [mbed-tls] CA Unknown Certificate
Hi Janos,
Kindly note that I have already provided the same in my initial email. Please refer the same for your reference:
Please note that we need to give CN value different for Root and Server / Client (since I am trying got mutual trusted certificate. You can also verify the same in below way:
First console :
# openssl s_server -cert crt1/server.crt -key crt1/server.key -WWW -port 12345 -CAfile crt1/trusted_ca.eap.pem -verify_return_err
or -Verify 1
verify depth is 1, must return a certificate
Using default temp DH parameters
ACCEPT
Second Console:
#touch test.txt
# openssl s_server -cert crt1/server.crt -key crt1/server.key -WWW -port 12345 -CAfile crt1/trusted_ca.eap.pem -verify_return_err
or -Verify 1
verify depth is 1, must return a certificate
Using default temp DH parameters
ACCEPT
On First Console we receive:
# openssl s_server -cert crt1/server.crt -key crt1/server.key -WWW -port 12345 -CAfile crt1/trusted_ca.eap.pem -verify_return_err
or -Verify 1
verify depth is 1, must return a certificate
Using default temp DH parameters
ACCEPT
depth=1 C = US, ST = CA, L = Somewhere, O = Someone, CN = FoobarCA
verify return:1
depth=0 C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
verify return:1
FILE:test.txt
Root CA Key
# openssl genrsa -des3 -out ca.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
..+++++
....+++++
e is 65537 (0x010001)
Enter pass phrase for ca.key.pem:^1234^
Verifying - Enter pass phrase for ca.key.pem:^1234^
Server Private Key
# openssl genrsa -out server.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
........................................+++++
.................................................................................................+++++
e is 65537 (0x010001)
Client Private Key
# openssl genrsa -out client.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
...............................+++++
..........................+++++
e is 65537 (0x010001)
Root CA Certificate from Root CA Key
# openssl req -x509 -new -nodes -key ca.key.pem -sha256 -days 365 -out
ca.cert.pem -subj /C=US/ST=CA/L=Somewhere/O=Someone/CN=FoobarCA
Enter pass phrase for ca.key.pem:^1234^
Server CSR & Certificate from Server Private Key
# openssl req -new -sha256 -key server.key.pem -subj
/C=US/ST=CA/L=Somewhere/O=Someone/CN=Foobar -out server.csr
# openssl x509 -req -in server.csr -CA ca.cert.pem -CAkey ca.key.pem
-CAcreateserial -out server.cert.pem -days 365 -sha256
Signature ok
subject=C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
Getting CA Private Key
Enter pass phrase for ca.key.pem:^1234^
Client CSR & Certificate from Client Private Key
# openssl req -new -sha256 -key client.key.pem -subj
/C=US/ST=CA/L=Somewhere/O=Someone/CN=Foobar -out client.csr
# openssl x509 -req -in client.csr -CA ca.cert.pem -CAkey ca.key.pem
-CAcreateserial -out client.cert.pem -days 365 -sha256
Signature ok
subject=C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
Getting CA Private Key
Enter pass phrase for ca.key.pem:^1234^
Regards,
Prakash
On Fri, Apr 12, 2024 at 5:55 PM Janos Follath <Janos.Follath(a)arm.com<mailto:Janos.Follath@arm.com>> wrote:
Hi Prakash,
Thank you for sharing the details about how you generated the certificates. Could you please share the command line for the server and the client as well?
Kind regards,
Janos
From: Satya Prakash Prasad via mbed-tls <mbed-tls(a)lists.trustedfirmware.org<mailto:mbed-tls@lists.trustedfirmware.org>>
Date: Friday, 12 April 2024 at 05:03
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>>
Subject: [mbed-tls] CA Unknown Certificate
Hi,
Please note that while using MBedTLS 3.6.0, when we are trying to
verify server / client connection using self-signed mutually trusted
certificates we are always getting a CA Unknown Certificate error code
46 alert message.
Root CA Key
# openssl genrsa -des3 -out ca.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
..+++++
....+++++
e is 65537 (0x010001)
Enter pass phrase for ca.key.pem:^1234^
Verifying - Enter pass phrase for ca.key.pem:^1234^
Server Private Key
# openssl genrsa -out server.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
........................................+++++
.................................................................................................+++++
e is 65537 (0x010001)
Client Private Key
# openssl genrsa -out client.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
...............................+++++
..........................+++++
e is 65537 (0x010001)
Root CA Certificate
# openssl req -x509 -new -nodes -key ca.key.pem -sha256 -days 365 -out
ca.cert.pem -subj /C=US/ST=CA/L=Somewhere/O=Someone/CN=FoobarCA
Enter pass phrase for ca.key.pem:^1234^
Server CSR & Certificate
# openssl req -new -sha256 -key server.key.pem -subj
/C=US/ST=CA/L=Somewhere/O=Someone/CN=Foobar -out server.csr
# openssl x509 -req -in server.csr -CA ca.cert.pem -CAkey ca.key.pem
-CAcreateserial -out server.cert.pem -days 365 -sha256
Signature ok
subject=C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
Getting CA Private Key
Enter pass phrase for ca.key.pem:^1234^
Client CSR & Certificate
# openssl req -new -sha256 -key client.key.pem -subj
/C=US/ST=CA/L=Somewhere/O=Someone/CN=Foobar -out client.csr
# openssl x509 -req -in client.csr -CA ca.cert.pem -CAkey ca.key.pem
-CAcreateserial -out client.cert.pem -days 365 -sha256
Signature ok
subject=C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
Getting CA Private Key
Enter pass phrase for ca.key.pem:^1234^
So we have used Root CA Certificatet as trusted certificate but during
handshake steps we see client reporting "Certificate Unknown'' alert
error message 46?
TLSv1.2 Record Layer: Alert (Level: Fatal, Description: Certificate Unknown)
Description: Certificate Unknown (46)
Can you please let us know the issue we are doing in creating the
certificates or it can also be some wrong steps / configuration while
compiling the 3.6.0 release?
Regards,
Prakash
--
mbed-tls mailing list -- mbed-tls(a)lists.trustedfirmware.org<mailto:mbed-tls@lists.trustedfirmware.org>
To unsubscribe send an email to mbed-tls-leave(a)lists.trustedfirmware.org<mailto:mbed-tls-leave@lists.trustedfirmware.org>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Hi,
Please note that while using MBedTLS 3.6.0, when we are trying to
verify server / client connection using self-signed mutually trusted
certificates we are always getting a CA Unknown Certificate error code
46 alert message.
Root CA Key
# openssl genrsa -des3 -out ca.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
..+++++
....+++++
e is 65537 (0x010001)
Enter pass phrase for ca.key.pem:^1234^
Verifying - Enter pass phrase for ca.key.pem:^1234^
Server Private Key
# openssl genrsa -out server.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
........................................+++++
.................................................................................................+++++
e is 65537 (0x010001)
Client Private Key
# openssl genrsa -out client.key.pem 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
...............................+++++
..........................+++++
e is 65537 (0x010001)
Root CA Certificate
# openssl req -x509 -new -nodes -key ca.key.pem -sha256 -days 365 -out
ca.cert.pem -subj /C=US/ST=CA/L=Somewhere/O=Someone/CN=FoobarCA
Enter pass phrase for ca.key.pem:^1234^
Server CSR & Certificate
# openssl req -new -sha256 -key server.key.pem -subj
/C=US/ST=CA/L=Somewhere/O=Someone/CN=Foobar -out server.csr
# openssl x509 -req -in server.csr -CA ca.cert.pem -CAkey ca.key.pem
-CAcreateserial -out server.cert.pem -days 365 -sha256
Signature ok
subject=C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
Getting CA Private Key
Enter pass phrase for ca.key.pem:^1234^
Client CSR & Certificate
# openssl req -new -sha256 -key client.key.pem -subj
/C=US/ST=CA/L=Somewhere/O=Someone/CN=Foobar -out client.csr
# openssl x509 -req -in client.csr -CA ca.cert.pem -CAkey ca.key.pem
-CAcreateserial -out client.cert.pem -days 365 -sha256
Signature ok
subject=C = US, ST = CA, L = Somewhere, O = Someone, CN = Foobar
Getting CA Private Key
Enter pass phrase for ca.key.pem:^1234^
So we have used Root CA Certificatet as trusted certificate but during
handshake steps we see client reporting "Certificate Unknown'' alert
error message 46?
TLSv1.2 Record Layer: Alert (Level: Fatal, Description: Certificate Unknown)
Description: Certificate Unknown (46)
Can you please let us know the issue we are doing in creating the
certificates or it can also be some wrong steps / configuration while
compiling the 3.6.0 release?
Regards,
Prakash
Public key operations like "psa_verify_message" use a "key-id" argument
to represent the public key. Is there a simple way to obtain or register
that key-id using the "cert->pk" member of a parsed certificate?
-- Christian Huitema
Hi All,
Apologies for the long email. I am adding all the 3 projects (TF-M, mbedTLS and Zephyr) to the mail chain because the issues I discuss below are inter-connected and affect all the three projects.
From mbedtls 3.5.0 version, the mbedtls project has migrated to auto-generated psa_crypto_driver_wrappers.h file.
https://github.com/Mbed-TLS/mbedtls/blob/development/docs/psa-driver-exampl…https://github.com/Mbed-TLS/mbedtls/blob/development/docs/proposed/psa-driv…
On TF-M, mbed-crypto, there are 2 patches for the drivers given below which are still hardcoding their changes and not following the above approach.
1. PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER (0001-Add-TF-M-Builtin-Key-Loader-driver-entry-points.patch)
2. PSA_CRYPTO_DRIVER_CC3XX (0005-Hardcode-CC3XX-entry-points.patch)
We at NXP, have migrated our psa crypto wrappers to the above approach using auto-generation. We want to maintain same code base for mbedtls for our SDK's, TFM mbed-crypto as well as align mbedTLS fork in Zephyr.
We are increasingly finding it difficult to migrate to newer versions of mbedtls because of hardcoding of above drivers. The problem is specially on the Zephyr front, where in the mbedTLS fork in zephyr these patches from tfm are applied by default.
I have queries for all the 3 projects listed below :
TF-M --> Can you please let us know what are the plans to migrate these 2 drivers in tfm to the auto-generation approach. If these patches can be migrated to make changes in jinja files rather than hardcoding in psa_crypto_driver_wrappers , things would be much easier to integrate.
Is somebody already working on it ? Are you open to accept patches for this change ?
mbedTLS --> What is the long term strategy from mbedTLS on this auto-generation ? We still have a lot of hard-coding in .jinja file rather than using drivers.json. Would mbedTLS/new PSA crypto repository start accepting patches for psa wrappers from platforms ? Can the patches which TF-M project maintains be merged in the mbedTLS ?
Zephyr --> On Zephyr front, what are the plans to align to this auto-generation approach ?
Regards,
Ruchika
I recently updated an embedded HTTPs web service using mbedtls from 2.22.0
to 3.2.1, and noticed the performance is about 30% better/faster. This is
good for sure, but I am curious, what are the changes contributing to this
improvement?
Thanks!
Hi,
It seems that in latest MbedTLS 3.6.0 following declarations have been deleted:
MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED
MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED
The below function implementation is not there
mbedtls_ssl_conf_export_keys_ext_cb
Regards,
Prakash
Hi,
Referring to https://mbed-tls.readthedocs.io/en/latest/kb/how-to/generate-a-self-signed-…
I am trying to create mutual certificates for server / client self
signed certificates. As I derive from the web page the following steps
need to be followed:
Generic
gen_key type=rsa rsa_keysize=2048 filename=ca.key format=pem
cert_write selfsign=1 issuer_key=ca.key
issuer_name=CN=myserver,O=myorganization,C=NL
not_before=20130101000000 not_after=20251231235959 is_ca=1
max_pathlen=0 output_file=my_crt.crt
Server Side:
What steps to do to create the following files where server.crt is
server side certificate, sever.key is the server private key and
trusted.pem is the CA that it trusts.
server.crt, server.key, trusted.pem[trusted.pem==>is it my_crt.crt]
Do we need to create new server keys and certificates then do we need
to bundle them - I am not sure how and what steps to do?
Client Side
What steps to do to create the following file where client.crt is
client side certificate, client.key is the client private key and
trusted.pem is the CA that it trusts.
client.crt, client.key, trusted.pem[trusted.pem==>is it my_crt.crt]
Do we need to create new client keys and certificates then do we need
to bundle them - I am not sure how and what steps to do?
Objective:
Objective is that client and server should be able to connect securely
successfully using their certs
Request to provide help related to the generation of self-signed
client / server certs that can be used for SSL handshake using MBedTLS
library.
Regards,
Prakash
Hi all,
Given TLS 1.3 has added two new cipher suites in RFC 8998 (
https://datatracker.ietf.org/doc/html/rfc8998), it would be useful to add
these algorithms and ciphersuites in Mbedtls.
CipherSuite TLS_SM4_GCM_SM3 = { 0x00, 0xC6 };
CipherSuite TLS_SM4_CCM_SM3 = { 0x00, 0xC7 };
There are some posts in this topic,
https://github.com/Mbed-TLS/mbedtls/pull/4091,
https://github.com/Mbed-TLS/mbedtls/pull/1620. But SM2/3/4 have not been
added in recent versions(e.g., 3.6).
I have implemented SM3, SM4 as standalone code(
https://github.com/zliucd/cryptoshark), and want to port the code to
Mbedtls while supporting SM2. However, to fully support the two new cipher
suites, we need to add lots of other code. The first step is to add SM2,
SM3 and SM as standalone ciphers.
Thanks for any comments.
Zhi
Hi Mbed TLS users,
We have released Mbed TLS versions 3.6.0 LTS and 2.28.8.
These releases of Mbed TLS address several security issues, provide bug fixes, and bring other minor changes. Full details are available in the release notes (https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.6.0, https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.8).
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
--
Mbed-tls-announce mailing list -- mbed-tls-announce(a)lists.trustedfirmware.org
To unsubscribe send an email to mbed-tls-announce-leave(a)lists.trustedfirmware.org
Hello Mbed-TLS team,
I am reaching out for guidance on an issue I've encountered while integrating MbedTLS for HTTPS requests using the coreHTTP stack alongside FreeRTOSplusTCP on an STM32F4 device. Although I have successfully implemented an HTTP client, moving to HTTPS has presented some challenges.
My approach has included several adjustments to the mbedtls_config file, such as:
- Integrating a Random Number Generator (RNG) from STM32 within the mbed_Entropy_poll function.
- Utilizing the calloc and free functions provided by FreeRTOS.
- Modifying the search algorithm to correctly handle null-terminated PEM certificates.
Despite these efforts, I am unable to establish a connection to the server, with the process consistently failing during the TLS handshake phase. Specifically, the client hello message is transmitted from my device, but no response is received from the server, resulting in an MBEDTLS_INTERNAL_ERROR.
Enclosed with this email are my mbedtls_config file and a detailed account of the issue as posted on the FreeRTOS forum<https://forums.freertos.org/t/integration-of-ssl-in-corehttp/19561/11>. While I do not expect a full code review<https://github.com/AshvajitP/Eth_FreeRTOS_F4>, any insights into potential causes for this type of handshake failure would be greatly appreciated.
Thank you for your time and assistance.
Regards,
Ashvajit Prasad
I saw the following comment when configuring Record Size Limit Extension (RFC 8449) in `mbedtls_config.h` [1]:
> This extension is currently in development and must NOT be used except for testing purposes.
Is this still accurate? What functionality is missing for full RFC 8449 support? Is this feature planned for a specific date?
[1] https://github.com/Mbed-TLS/mbedtls/blob/611f899c0c9d397baedfaec34ea0861ad2…
Hi,
We are integrating https://github.com/prplfoundation/hostap code into
our project that makes uses of crypto and SSL functionality. Their
code is so written that they have interfaces defined where crypto and
SSL 3rd party algorithms can be called and implemented.
We are stuck implementing those APIs interfaces using MBedTLS and in
need of help for its implementation. Referring to the below set of
interfaces as defined in
https://github.com/prplfoundation/hostap/blob/master/src/crypto/tls_none.c
we need to implement required code for MBedTLS.
I am in need help implementing below API:
struct tls_connection * tls_connection_init(void *tls_ctx) where
tls_connection is below defined type [user defined type - hope is
correct implementation]:
struct tls_connection {
mbedtls_ssl_context *ssl;
keyman_creds *cr;
};
We have made the below implementation
struct tls_connection * tls_connection_init(void *ssl_ctx)
{
mbedtls_ssl_context *mssl_ctx = ssl_ctx;
struct tls_connection *conn;
conn = os_zalloc(sizeof(*conn));
if (conn == NULL) {
return NULL;
}
conn->ssl = mssl_ctx ;
conn->cr = NULL;
mbedtls_ssl_set_bio(ssl_ctx, NULL, net_send, net_recv, NULL);
return conn;
}
If my above implementation is correct please let me know how to
implement our own net_send and net_recv function. There are many
buffer declaration in mbedtls_ssl_context I am not sue what algorithm
to use to read complete / remaining bytes using internal data
structure :
int net_recv(void *ctx, unsigned char *buf, size_t len)
{
/* how to implement */
}
int net_send(void *ctx, const unsigned char *buf, size_t len)
{
/* how to implement */
}
Thanks in advance.
Regards,
Prakash
Hi,
Please also let me know the features of PSA in MbedTLS. I found this
related document -
https://mbed-tls.readthedocs.io/en/latest/getting_started/psa/.
Is PSA related to Platform Security Architecture or is related to TLS security?
How will the inclusion and non-inclusion of PSA will differ in terms
of security?
Thanks in advance.
Regards,
Prakash
Hello,
Bignum is a very useful feature in Mbedtls, which is a part to
libmbedcrypto.a. I want to build this module only as a standalone static
library. However, I find it's difficult to modify CMakelists.txt to do
this.
I appreciate your suggestions.
Blade
Hi,
I am trying to compile MbedTLS 3.5.2 release without PSA but get below
error message:
mbedtls/check_config.h:62:2: #error "MBEDTLS_ECP_DP_BP256R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:66:2: #error "MBEDTLS_ECP_DP_BP384R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:70:2: #error "MBEDTLS_ECP_DP_BP512R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:74:2: #error "MBEDTLS_ECP_DP_CURVE25519_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:78:2: #error "MBEDTLS_ECP_DP_CURVE448_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:82:2: #error "MBEDTLS_ECP_DP_SECP192R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:86:2: #error "MBEDTLS_ECP_DP_SECP224R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:90:2: #error "MBEDTLS_ECP_DP_SECP256R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:94:2: #error "MBEDTLS_ECP_DP_SECP384R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:98:2: #error "MBEDTLS_ECP_DP_SECP521R1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:102:2: #error "MBEDTLS_ECP_DP_SECP192K1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:111:2: #error "MBEDTLS_ECP_DP_SECP256K1_ENABLED
defined, but not its PSA counterpart"
mbedtls/check_config.h:391:2: #error
"MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all
prerequisites"
mbedtls/check_config.h:397:2: #error
"MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all
prerequisites"
mbedtls/check_config.h:406:2: #error
"MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all
prerequisites"
mbedtls/check_config.h:418:2: #error
"MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all
prerequisites"
mbedtls/check_config.h:425:2: #error
"MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all
prerequisites"
mbedtls/check_config.h:481:2: #error "MBEDTLS_LMS_C requires
MBEDTLS_PSA_CRYPTO_C and PSA_WANT_ALG_SHA_256"
mbedtls/check_config.h:725:2: #error "MBEDTLS_PLATFORM_NV_SEED_ALT
defined, but not all prerequisites"
mbedtls/check_config.h:879:2: #error
"MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED defined, but
not all prerequisites"
mbedtls/check_config.h:885:2: #error
"MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED defined,
but not all prerequisites"
Regards,
Prakash
Hi,
I am trying to build MbedtLS 3.5.2 and get the below error:
mbedtls/library/psa_crypto_storage.c:23:23: psa/error.h: No such file
or directory
mbedtls/library/psa_crypto_storage.c:24:42:
psa/internal_trusted_storage.h: No such file or directory
I searched all thru the directories and found error.h in mbetls
directory but could not find internal_trusted_storage.h header file?
#if defined(MBEDTLS_PSA_ITS_FILE_C)
#include "psa_crypto_its.h"
#else /* Native ITS implementation */
#include "psa/error.h"
#include "psa/internal_trusted_storage.h"
#endif
Regards,
Prakash
Hi Team,
Referring to MBed release page -
https://github.com/Mbed-TLS/mbedtls/releases?page=1 I see that there has
been constant release periodically from Jul 27, 2018 mbedtls-2.1.14
till Nov 8, 2023 v3.5.1.
In the same context I understand that with each release there have been
fixes and new features / enhancement implementation. There was a project
that I was working in year 2020 were we tried to integrate MBed TLS in EAP
https://github.com/prplfoundation/hostap. It was a practice exercise that
our team did that time. I have not much idea as to which MBed TLS version
was opted and integrated then.
Now that so many new releases are made after 2020 - are older versions can
be taken as stable?
Is it that we should take the latest version and try again from scratch?
Thanks in advance.
Regards,
Prakash
Hello,
I have a simple http(s) server running on embedded platform using mbedtls.
Using ssl session cache significantly improves the throughput. However
while it works flawlessly in chromium based browser I noticed that in
Firefox it does not work at all.
Following there is a short snippet of my accept routine. Am I doing
something wrong?
...
mbedtls_ssl_conf_session_cache(&ssl_ctx->conf, &server_cache,
mbedtls_ssl_cache_get,
mbedtls_ssl_cache_set);
mbedtls_ssl_init(*ssl);
rc = mbedtls_ssl_setup(*ssl, &ssl_ctx->conf);
if (rc < 0) {
mbedtls_ssl_free(*ssl);
mg_free(*ssl);
*ssl = NULL;
return -ENOMEM;
}
mbedtls_ssl_set_bio(*ssl, sock, mbedtls_net_send, mbedtls_net_recv, NULL);
rc = mbed_ssl_handshake(*ssl);
...
best regards
Jan
Hi,
We are trying to integrate MBedTLs 3.5.2 release code into our
project. In the same regards we need your help for all information as
requested below - please do provide your valuable information:
1. Please confirm if all source and include files for MbedTLs 3.5.2
are available in below directories, so that we make use of these file
only (libraries can be built independently and have no dependency with
other files in other folder) -
mbedtls-3.5.2\include\mbedtls
mbedtls-3.5.2\include\psa
mbedtls-3.5.2\library
2. We are using our own RTOS threads instead of Posix or other
variants. Is there any specific configuration we need to do / setup?
3. We want to use as much small memory as possible - please let me
know the required configuration for the same?
4. Please let us know the various configuration / setup details that
we should do for the MBedTLS 3.5.2 codebase?
5. Any other references and information related to configuration /
setup / compilation will be an added advantage.
Thanks in advance and please let me know in case of any issues or concerns.
Regards,
Prakash
Hi,
Iam trying to import an ECC privatekey(parsed through mbedtls_parse_key()) to PSA (psa_import_key()) (for ECDSA NIST-P256-SECP-R1), by following the suggestions here ==>
https://github.com/Mbed-TLS/mbedtls/blob/development/docs/psa-transition.md (under the heading - Importing a PK key by export-import for an ECC private key).
But, i get an undefined reference to `mbedtls_ecp_export' error. Is there a special flag that controls this?
I can see that the definition of this function does exist in ecp.c.
Kind Regards,
Mathi.
Hi Shripad,
Cross-posting to mbed-tls ML.
I noticed though you already sent the same query to this list.
Regards,
Olivier.
________________________________
From: shripad.nunjundarao--- via TF-A <tf-a(a)lists.trustedfirmware.org>
Sent: 06 March 2024 05:39
To: tf-a(a)lists.trustedfirmware.org <tf-a(a)lists.trustedfirmware.org>
Subject: [TF-A] mbedtls and PQC algorithms support
Hi,
Is there a plan for mbedtls to add support for PQC algorithms (Dilithium/Khyber)?
regards,
/Shripad
--
TF-A mailing list -- tf-a(a)lists.trustedfirmware.org
To unsubscribe send an email to tf-a-leave(a)lists.trustedfirmware.org
Greetings,
## The Setup
Greetings,
## The Setup
I have a RENESAS board that has an integrated crypto processor and uses MbedTLS 2.25.0.
I have a SE (secure element) connected to it.
I am allowing hardware acceleration and PSA crypto API inside mbedtls_config.h
I registered my SE driver before calling psa_crypto_init().
The board connects to a web server and performs TLS handshake with the forced cipher `MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256`.
## The issue
The handshake fails during the step 8 when generating EC private key for ECDHE exchange.
I have tracked the issue through debug and it unfolded as follows inside `ssl_write_client_key_exchange()`:
- We enter the PSA crypto code from the pre-processor directives.
- We set the key attributes after initializing them to 0. (here usage_flags, algorithm, type and bits field are set but lifetime is still 0 from init at this point, this will count later on)
- The next function `psa_generate_key()` fails.
## In depth
When inside the `psa_generate_key()` function, we start the key creation inside `psa_start_key_creation()`.
But here, when validating the attributes of the key in `psa_validate_key_attributes()`, we are not able to rely on the SE to store the key due to it being volatile (lifetime is still 0), the driver is never called.
From there the program keeps going until trying to generate the key with the crypto processor from the board which does not support this type of key and returns unsupported error.
## Main question
Since the lifetime is forced to be representing a volatile key and since the driver for the SE is not called except for persistent ones, i cannot do this cryptographic step using the SE. Is the generation of the volatile key at this step meant to be handled by the MbedTLS library (software or hardware alt) and not by the PSA Crypto API (SE) due to the key being volatile ? If not, how is the Se supposed to be called in the handshake and what am i missing ?
## Discussion
I can pass the handshake when disabling hardware acceleration and using the software for cryptographic steps, but in this case i am not using the SE for them. Should the SE only be used to store the client certificate for mTLS case ?
## Note
I must use the MbedTLS version 2.25.0 since the SE driver I am using relies on this version.
Hi,
We are writing a client code which can accept or decline connection to the
server - so for each connection I understand there is a mbedtls_ssl_context
data established. Once the same is closed or not required we need to do
deinitialize or free memory allocated to its member variables like - we
need to free all memory allocated since we need it back else our
application will run out of memory like:
os_free(mbed_ctx->handshake);
os_free(mbed_ctx->transform_negotiate);
os_free(mbed_ctx->session_negotiate);
os_free(mbed_ctx->in_buf);
os_free(mbed_ctx->out_buf);
But there are many member variables which also need to free memory if
allocated and assigned to it.
Is there a function / method that can free all memory
for mbedtls_ssl_context instance variable?
Thanks in advance.
Regards,
Prakash
Hi All,
A gentle reminder that the Asia-Europe timezone-friendly MBed TLS Tech
forum is next Monday at 10:00am PM UK time. Invite details can be found on
the online calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Dave Rodgman know. :)
Best regards,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
Hi,
Please note that I needed to compile and work with MBed TLS version 2.19.1
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.19.1
However I am unable to compile the code / examples in it - i get below
error:
*$ cmake .CMake Deprecation Warning at CMakeLists.txt:1
(cmake_minimum_required): Compatibility with CMake < 2.8.12 will be
removed from a future version of CMake. Update the VERSION argument <min>
value or use a ...<max> suffix to tell CMake that the project does not
need compatibility with older versions.-- Selecting Windows SDK version
10.0.19041.0 to target Windows 10.0.22631.CMake Error at CMakeLists.txt:192
(add_subdirectory): add_subdirectory given source "crypto/3rdparty" which
is not an existing directory.CMake Error at CMakeLists.txt:199
(add_subdirectory): add_subdirectory given source "crypto/library" which
is not an existing directory.CMake Error at CMakeLists.txt:200
(add_subdirectory): add_subdirectory given source "crypto/include" which
is not an existing directory.CMake Warning (dev) at
programs/ssl/CMakeLists.txt:37 (target_sources): Policy CMP0076 is not
set: target_sources() command converts relative paths to absolute. Run
"cmake --help-policy CMP0076" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. An interface source
of target "ssl_client2" has a relative path.This warning is for project
developers. Use -Wno-dev to suppress it.CMake Warning (dev) at
programs/ssl/CMakeLists.txt:44 (target_sources): Policy CMP0076 is not
set: target_sources() command converts relative paths to absolute. Run
"cmake --help-policy CMP0076" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. An interface source
of target "ssl_server2" has a relative path.This warning is for project
developers. Use -Wno-dev to suppress it.CMake Warning (dev) at
programs/test/CMakeLists.txt:31 (target_sources): Policy CMP0076 is not
set: target_sources() command converts relative paths to absolute. Run
"cmake --help-policy CMP0076" for policy details. Use the cmake_policy
command to set the policy and suppress this warning. An interface source
of target "query_compile_time_config" has a relative path.This warning is
for project developers. Use -Wno-dev to suppress it.*
I tried removing the errors from the CmakeFile.txt but now get below error:
*$ cmake --build .Microsoft (R) Build Engine version 16.11.2+f32259642 for
.NET FrameworkCopyright (C) Microsoft Corporation. All rights
reserved.MSBUILD : error MSB1009: Project file does not exist.Switch:
ALL_BUILD.vcxproj*
Also
make all
Makefile:84: ../crypto/3rdparty/Makefile.inc: No such file or directory
make[1]: *** No rule to make target '../crypto/3rdparty/Makefile.inc'.
Stop.
Makefile:19: recipe for target 'lib' failed
make: *** [lib] Error 2
Please let me know how to resolve them and compile MBedTLS version 2.19.1
code?
Thanks in advance.
Regards,
Prakash
Hi,
I am working on an issue related to memory leak in MBedTLS. We have
integrated MBedTLS code for below 3rd party HostAPD code integration .
https://github.com/prplfoundation/hostap [Hostapd]
Please refer to the Hostapd peer code implementation as provided in
the link below:
https://github.com/prplfoundation/hostap/blob/master/eap_example/eap_exampl…https://github.com/prplfoundation/hostap/blob/master/eap_example/eap_exampl…
The main function code snippet is provided below:
https://github.com/prplfoundation/hostap/blob/master/eap_example/eap_exampl…
if (eap_example_peer_init() < 0 ||
eap_example_server_init() < 0)
return -1;
do {
printf("---[ server ]--------------------------------\n");
res_s = eap_example_server_step();
printf("---[ peer ]----------------------------------\n");
res_p = eap_example_peer_step();
} while (res_s || res_p);
Since we are implementing code for peers hence we have removed the
server step. Now we need to keep monitoring for new connections /
failed connections and act accordingly we have modified the code to
something like below -
if (eap_example_peer_init() < 0 ||
eap_example_server_init() < 0)
return -1;
do {
res_p = eap_example_peer_step();
if (eap_ctx.eapNoResp || eap_ctx.eapFail) {
eap_client_peer_deinit();
eap_client_peer_init();
}
} while (1);
We have modified the loop such that it will keep iterating for new
connections and in case of failure, re-initialization is required. Is
my understanding correct? The issue I am facing is that the client
peer deinit method is not releasing all memory allocated during
eap_example_peer_step() function ( I understand while processing the
EAP TLS server request). The deinit is purely implemented to
deallocate memory initially allocated for a new connection using TLS?
void eap_client_peer_deinit(void)
{
eap_peer_sm_deinit(eap_ctx.eap);
eap_peer_unregister_methods();
wpabuf_free(eap_ctx.eapReqData);
os_free(eap_ctx.eap_config.identity);
os_free(eap_ctx.eap_config.password);
os_free(eap_ctx.eap_config.cert.ca_cert);
os_free(eap_ctx.eap_config.cert.client_cert);
os_free(eap_ctx.eap_config.cert.private_key);
}
where
void eap_peer_sm_deinit(struct eap_sm *sm)
{
if (sm == NULL)
return;
eap_deinit_prev_method(sm, "deinit");
eap_sm_abort(sm);
if (sm->ssl_ctx2)
tls_deinit(sm->ssl_ctx2);
tls_deinit(sm->ssl_ctx);
eap_peer_erp_free_keys(sm);
os_free(sm);
}
Can you please let me know whether we are deallocating memory correctly?
Thanks in advance.
Regards,
Prakash
I am checking the certificate revocation with below scenario.
I have Root CA, Intermediate CA and device certificate is signed by Intermediate CA.
I am makeing chain certificate by combining Root CA, Intermediate CA and this chain certificate is my active CA certificate and loaded this and device certificate to the drive.
From client,
I am creating client certificate which is signed by same intermeidate CA.
Making ssl handshake. Handshake is success as expected.
Now i am revoking the intermediate CA and creating the crl which is signed by the Root CA. This crl has the serial number of intermediate CA.
Now loading the CRL to the drive and setting the crl in "mbedtls_ssl_conf_ca_chain".
Now i am establishing the ssl connection with the same client ceritificate and expecting the ssl handshake failure due to intermediate CA revoked. But i get handshake is success.
Is my understanding right about intermediate CA revocation?
I did little background debug, and my obervation is
During handshake , it goes to static int x509_crt_verify_chain function in mbedtls.
Its trying to find the parent using x509_crt_find_parent for the client certificate and get intermediate CA. During this time, parent_is_trusted is set as true.
after this x509_crt_verifycrl is called with client certificate (child), intermediate CA (parent) and crl(has the intermediate CA serial number-issued by Root CA).
During x509_crt_verifycrl check, it check for CRL issuer with ca subject and return 0, as its not matching. now in x509_crt_verify_chain , /* prepare for next iteration */ ., they are marking child_is_trusted = parent_is_trusted and child = parent, parent = NULL; and while loop continues, in loop, x509_crt_verify_chain checks for child_is_trusted is true and return as 0.
But its not checking that intermediate CA is revoked or not.
/* Stop here for trusted roots (but not for trusted EE certs) */
if( child_is_trusted )
return( 0 );
Hello,
I would like to parse certificate's SAN fields in my application. In the
documentation of the struct mbdetls_x509_crt for its member
subject_alt_names the following is stated: "Optional list of raw entries
of Subject Alternative Names extension. These can be later parsed by
mbedtls_x509_parse_subject_alt_name.".
I was using the latest development branch and tried to call the
function, however, I found out I can not, because it is defined in the
x509_internal.h private header. I later found out that the definition
was moved from the public to the private header in the commit 25b282e
<https://github.com/Mbed-TLS/mbedtls/commit/25b282ebfe5cb84e73d6194e83dc8d6c…>
(partly thanks to the issue #459
<https://github.com/Mbed-TLS/mbedtls/issues/459>).
So I switched to the 3.5.2 release and everything worked fine. Why was
this change made? Will it be kept so that I'd have to implement my own
parsing? Or was it a mistake?
Thank you for clarifying,
Roman.
Hello, list,
Release notes for Mbed TLS 3.5.2 [0] have this:
The SHA256 hashes for the archives are:
35890edf1a2c7a7e29eac3118d43302c3e1173e0df0ebaf5db56126dabe5bb05 mbedtls-3.5.2.tar.gz
55c1525e7d5de18b84a1d1e5540950b4a3bac70e02889cf309919b2877cba63b mbedtls-3.5.2.zip
However, attempting to download mbedtls-3.5.2.tar.gz yields a file with hash:
eedecc468b3f8d052ef05a9d42bf63f04c8a1c50d1c5a94c251c681365a2c723
What's going on with those hashes?
[0]: https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.5.2https://web.archive.org/web/20240126105153/https://github.com/Mbed-TLS/mbed…
--
pozdrawiam / best regards
Wojtek Porczyk
Gramine / Invisible Things Lab
I do not fear computers,
I fear lack of them.
-- Isaac Asimov
Hi folks,
This is a question about understanding changes in recent new release.
I want to understand how new release e.g. 2.28.7 fix the vulnerable described in https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-secur….
Want to check that if following commits in new release, for example 2.28.7, are the actual commits for fixing the vulnerable above:
42175031ca48e2fba62b97fc802e5df33d5221ff
4fe396f1e1aa84346e23b89435a251624c205035
aa6760d7b5d9a218eaf072f4155974f58b00986b
601bffc4cec7c78cfc6b64048379172578fce13c
In short, they are first 4 commits in I found https://github.com/Mbed-TLS/mbedtls/compare/v2.28.6...v2.28.7
Thank you for any help you can provide!
Best,
Yuxiang
Hi,
I need some clarification on Public and Private keys that a server
maintains its own side. All documents say that the client will use the
server's public key to encrypt the data while the server will make use of
its private keys to decrypt.
Is it not that the data can be decrypted using the public key itself? How
and what is encryption logic implemented in such a case?
Please do provide some logical explanation for the same - how does this
encryption / decryption work?
Regards,
Prakash
Hi Mbed TLS users,
We have released Mbed TLS versions 3.5.2 and 2.28.7.
These releases contain security fixes for: a timing side channel in private key RSA operations; and a buffer overflow in mbedtls_x509_set_extension.
Full details are available in the release notes.
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.28.7https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.5.2
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Many thanks.
Dave
Dear community,
My target is to establish a shared secret key between the PC application
(master) and (various, different, but always limited to 1 at a time)
peripheral devices.
*Each device has*:
- Device specific ECC 256-bit private key, in PEM format, well parsed
with mbedtls_pk_parse_key function when required.
- Device specific certificate that belongs to the private key.
Certificate is signed by the *TrustCA*. Parsing works well with
mbedtls_x509_crt_parse
- TrustCA’s certificate, used to validate the master device during
communication, also used to check firmware signature in a secure boot part
of the application
*PC application has*:
- Master application certificate, signed by *TrustCA*
- Private key of the PC application that belongs to master application
certificate, in PEM format
- *TrustCA*’s certificate, used to validate device certificate during
communication
Aim is to establish AES shared secret, by doing:
- Master sends authentication requests, random challenge, device
performs hash + signs with private key. Returns certificate + signature of
the challenge.
- Master uses *TrustCA*'s certificate to check device's certificate and
then checks the signature of the hash(challenge)
- Master sends its certificate to the slave, now both hold X509
certificates. At this point, device could also request authentication of
the PC application
- A computation with its respective private key is needed on both sides,
and we have common secret.
What is the correct way in mbedTLS, to get a public key from *X509*, that
can be used in the ECDH module?
The way the ECDH module inside mbedTLS seems to be designed, there is no
straight-forward way to export X5090’s public key, get its parameters and
use them in ECDH module.
Instead, ECDH expects that random keypair will be generated every-time we
want key exchange. Doing this, we risk *man in the middle* attack, since
the other party doesn’t know where the key is actually coming from.
For the moment, the solution I see (which is not THAT elegant, or is it?),
and to avoid man in the middle attack::
- Devices still exchange certificates, but only for authentication
reason + certificate verification
- Every message that is sent between devices (for instance public keys
exchange), must also be hashed & signed, so that another party can be sure
message is coming from the device which shared the certificate just before
(and certificate is signed by TrustCA)
- We need one exchange more to get shared secret.
Is this the *proposed* solution in this case? Is there a more elegant
solution with the mbedTLS library for this problem?
Thanks
--
Tilen Majerle, mag.inž.el.
Tušev Dol 11
8340 Črnomelj
Slovenia
www: http://majerle.eu
e-mail: tilen(a)majerle.eu
Mobile: +386 40 167 724
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai…>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai…>
<#m_-5461752537485879190_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
Hello,
We are considering dropping support for Visual Studio 2013 and Visual
Studio 2015 from Mbed TLS 3.6 onwards. This would make Mbed TLS 3.6
require Visual Studio 2017 or newer. (Mbed TLS 2.28 LTS is not affected.)
Per the Visual Studio product lifecycle
<https://learn.microsoft.com/en-us/visualstudio/productinfo/vs-servicing#old…>,
VS 2013 and 2015 are currently on extended support, but their support
will end during the lifetime of Mbed TLS 3.6 LTS.
Our reasons are:
* We prefer not to support products that are not supported upstream,
such as VS 2013 and 2015 will be during the lifetime of 3.6 LTS.
* Older versions of Visual Studio tend to require workarounds due to
their incomplete support for C99, and we would like to reduce those.
We may drop support for older versions of MinGW as well for this reason.
* The development branch of Mbed TLS is currently triggering an
internal compiler error in VS 2015
<https://github.com/Mbed-TLS/mbedtls/issues/8735>.
If you want to keep support for VS 2013 and 2015 in Mbed TLS 3.6, please
let us know as soon as possible and tell us why it's important.
Assistance with the internal compiler error would be appreciated.
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hi,
Please let me know if MBed TLS is designed for Security level at Transport
/ Network Level Implementation of OSI model - at network socket connection
level.
Please let us know if MBed TLS routines can be used at DataLink Layer
specifically for 802.1x protocols.
Referring to the example as provided in tutorial -
https://mbed-tls.readthedocs.io/en/latest/kb/how-to/mbedtls-tutorial/
What would be setup / config accordingly for non socket
dependent implementation.
Thanks in advance.
Regards,
Prakash
Hi,
I was referring to below URLs for understanding key exchange using
certificate in TLS framework:
https://tls12.xargs.org/https://tls13.xargs.org/
I have some confusion related to above TLS 1.2 and 1.3 flows and require
guidance from your side accordingly. I understand the key exchange using
certificates highly depends on configuration and capabilities setup.
But then how do we know what goes on a TLS connection based on
configuration and setup capabilities? What are the different configurations
and when should we set them?
I need the same details with reference to a TLS connection setup from a
client in our codebase while other for EAP TLS using the below example
available in the url below:
https://github.com/prplfoundation/hostap/blob/master/eap_example/eap_exampl…
Firstly in the above code we do see a lot of configuration and
initialization like below:
eap_cb.get_config = peer_get_config;
eap_cb.get_bool = peer_get_bool;
eap_cb.set_bool = peer_set_bool;
eap_cb.get_int = peer_get_int;
eap_cb.set_int = peer_set_int;
eap_cb.get_eapReqData = peer_get_eapReqData;
eap_cb.set_config_blob = peer_set_config_blob;
eap_cb.get_config_blob = peer_get_config_blob;
eap_cb.notify_pending = peer_notify_pending;
Whereas our client code which connects to the cloud using certificates to
obtain some data in below mentioned way:
keyman_creds_for_purpose() - get the creds read and parse the crt.pem,
key.pem and trusted_ca.pem files. It make uses of below APis:readfile() -
read the file from key storageparse_private_key() & mbedtls_pk_parse_key()
- I believe it is for parsing the keys read from file
Setup MBed TLS
mbedtls_ssl_config_init() - Initialize
mbedtls_ssl_configmbedtls_ctr_drbg_init() - CTR_DRBG context initialization
mbedtls_ctr_drbg_seed()
mbedtls_ssl_conf_rng()
mbedtls_ssl_conf_ca_chain()
mbedtls_ssl_conf_own_cert()
mbedtls_ssl_conf_authmode()
t_socket()
I am quite new to this code so could have missed or provided wrong info -
but I hope I give the overall picture of code implementation - note that
this client code is a working code with no issues.
My queries are mentioned below:
1) Does the same TLS message flow occur in both cases - our client code and
EAP TLS? If not then what's the difference in-between them?
2) How do we understand exact implementation and message flows?
3) What are the different ways to implement TLS connection using certs?
4) Any additional information that can helpful to me like - some references
to tutorials / examples / guide would be an added advantage
Thanks in advance.
Regards,
Prakash
Hi,
when upgrading MBed TLS from 2.16.x to the LTS 2.28.x version on an ARM
32 bit system,
I realized that the byte-order macros were collected to one file
(common.h) with the possibility to replace them.
After writing ARM optimized macros, I checked this topic in the 3.5.x
version where it was implemented in a similar way in alignment.h.
With this input the following solution was made for the 2.28.x branch:
https://github.com/jojwoos/MbedTLS_wrapper
A bit late, but maybe someone can still use it:)
Perhaps the 64 bit swap, build from two optimized 32bit swaps, can
provide some input for the actual 3.5.x version.
You can find it at:
"// general 64 bit optimization if only 32 bit optimization is available"
(32bit ARM systems usually don't have optimized 64bit swap functions)
Best regards,
Jürgen
Hi,
Referring to the example as in
https://mbed-tls.readthedocs.io/en/latest/kb/how-to/mbedtls-tutorial/
(secure connection) does the secret key exchange takes place in-between
server and client.
Is there any flowchart / diagram that states what happens during the server
client connection - how the keys are exchanged and what types of certs are
exchanged, I mean like .pem, X.509 etc?
Can we take this way that be it any type of certificate the code
implementation is the same for all TLS communication?
Thanks in advance.
Regards,
Prakash
Hello,
In psa_validate_key_attributes(), when the key ID is invalid for persistent keys the function returns PSA_ERROR_INVALID_ARGUMENT. See https://github.com/Mbed-TLS/mbedtls/blob/development/library/psa_crypto.c#L….
The comments for PSA_ERROR_INVALID_ARGUMENT explicitly states that this error should not be returned when key identifier is invalid, instead PSA_ERROR_INVALID_HANDLE should be returned.
For the above psa_validate_key_attributes() usecase, which is the correct return code - PSA_ERROR_INVALID_ARGUMENT or PSA_ERROR_INVALID_HANDLE?
Regards,
Archanaa
Hello,
The mbedtls docs (psa_driver_interface.md) mention that only opaque driver supports the use of built-in keys with PSA APIs. Why does a transparent driver not support built-in key feature?
Regards,
Archanaa
Hi all.
We are currently planning on improving our coverage and adding accessor functionality for members marked as MBEDTLS_PRIVATE. I have created an issue ( #8529 )<https://github.com/Mbed-TLS/mbedtls/issues/8529> to consolidate all the information and design-review the task.
It would really help to hear from the community as to which members they are still using, and what is their use-case.
Feel free to comment on the issue, or discuss it here. There may be members that we have decided not to include and are essential to your integration or are completely missing/not being considered.
Best Regards,
Minos Galanakis
Hi,
We need to integrate the TLS Code in our codebase. I have downloaded Mbed
TLS 3.5.1 @ https://github.com/Mbed-TLS/mbedtls/releases and compiled it.
I understand that we can just use the code in mbedtls-3.5.1\library
directory for the TLS functionality - can anyone please confirm. Are there
any other directories where TLS Code exists in the MbedTLS 3.5.1 repo?
Please confirm how we can only integrate MbedTLS TLS functionality code in
other applications / repo. There are so many other directories in MbedTLS
3.5.1 repo - how is the code in repo organized? Do we need all the code
in MbedTLS 3.5.1 repo?
Your valid input will help me to integrate the MbedTLS Code in our codebase?
Please provide all other details as required or will be helpful for the
same.
Thanks in advance.
Regards,
Prakash
Hi,
I downloaded Mbed TLS 3.5.1 @ https://github.com/Mbed-TLS/mbedtls/releases.
Please let me know how to configure and compile the same.
Also please let me know how to run some sample tests there or manually to
verify.
Thanks in advance.
Regards,
Prakash
I am trying to use psa_import_key() after loading private keys from PEM
files. I am succeeding when parsing an "RSA PRIVATE KEY", but no such
luck for "EC PRIVATE KEY". I assume that I am not setting attributes
correctly. A code sample would be nice!
Or, maybe I could just use mbedtls_pk_parse_keyfile(), but then I would
need to "import" a PSA key from the "mbedtls" context, ad I did not find
sample code for that either.
-- Christian Huitema
We have released Mbed TLS versions 3.5.0 and 2.8.5.
These releases of Mbed TLS address several security issues, provide bug fixes, and bring other minor changes. Full details are available in the release notes (https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-2.28.5, https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.5.0).
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Many Thanks.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
--
Mbed-tls-announce mailing list -- mbed-tls-announce(a)lists.trustedfirmware.org
To unsubscribe send an email to mbed-tls-announce-leave(a)lists.trustedfirmware.org
Hi Mbed TLS users,
We are planning to change the license for Mbed TLS shortly, from Apache 2.0 to a dual license Apache 2.0 / GPLv2-0-or-later license.
This will allow GPL-licensed projects to take Mbed TLS under a GPL license.
Projects which currently take Mbed TLS under an Apache 2.0 license may continue to do so, and therefore should not be affected by this change.
The inbound license, under which we accept contributions, is already a dual-license. There is therefore no impact for contributors, and no impact on PRs that are currently in review, or those that have previously been integrated into the library.
We hope that this will enable more projects to make use of Mbed TLS.
Dave Rodgman
We are happy to announce the publication in GitHub of the TF-PSA-Crypto repository: https://github.com/Mbed-TLS/TF-PSA-Crypto.
The TF-PSA-Crypto repository provides an implementation of the PSA Cryptography API (https://arm-software.github.io/psa-api). This encompasses the on-going extensions to the PSA Cryptography API (e.g. PAKE). The PSA Cryptography API implementation is organized around the PSA Cryptography driver interface aiming to ease the support of cryptographic accelerators and processors.
This is a significant milestone on the journey to split the PSA Cryptography API implementation and its development out of the Mbed TLS repository into TF-PSA-Crypto. This is early days though and the TF-PSA-Crypto repository should be considered as a prototype: it is read-only and mostly a mirror of the PSA Cryptography API implementation of Mbed TLS. But we believe it is a good illustration of what we are aiming at.
Thanks, Ronald Cron on behalf of the Mbed TLS team.
Hi experts,
I wanted to forward some crypto operations to an external driver that provides psa_call APIs. The mbedtls version I am using 3.4.0.
Take psa_asymmetric_encrypt as an example, The mbedtls api is
psa_status_t psa_asymmetric_encrypt(mbedtls_svc_key_id_t key,
psa_algorithm_t alg,
const uint8_t *input,
size_t input_length,
const uint8_t *salt,
size_t salt_length,
uint8_t *output,
size_t output_size,
size_t *output_length)
It gets attribute, key.data and key.byte from key_id. Then call function psa_driver_wrapper_asymmetric_encrypt without key_id as its argument:
status = psa_driver_wrapper_asymmetric_encrypt(
&attributes, slot->key.data, slot->key.bytes,
alg, input, input_length, salt, salt_length,
output, output_size, output_length);
In psa_driver_wrapper_asymmetric_encrypt, it will use different implementations according to the location value in https://github.com/Mbed-TLS/mbedtls/blob/d69d3cda34c400a55220352518e37d3d2c….
I define a new location definition(RSS_PSA_LOCATION. When the location is RSS_PSA_LOCATION, making it call
psa_status_t crypto_psa_asymmetric_encrypt(psa_key_id_t key,
psa_algorithm_t alg,
const uint8_t *input,
size_t input_length,
const uint8_t *salt,
size_t salt_length,
uint8_t *output,
size_t output_size,
size_t *output_length)
This API require key_id. Is it possible to get key_id from attribute and key_slot?
Regards,
Jiamei Xie
Hi,
I am trying to use the MACRO's defined at - https://github.com/Mbed-TLS/mbedtls/blob/development/docs/driver-only-build… to enable driver only build.
As mentioned on the page I tried to do this for SHA256. However, the code in sha256.c isn't ifdefed by "MBEDTLS_PSA_ACCEL_ALG_SHA_256" so still gets compiled ?
Can you point me to what I am missing here ?
Regards,
Ruchika
Hi all,
I have been using the old version(2.28) for a very long time, and updated to version 3.4.0 recently.
When using rsa encryption, there is a parameter 'mode' that allows to choose whether to use a public key or a private key. Why is it canceled in the new version? And how can I use the private key to perform an encryption operation?
Thank you for your help!
Hi,
For the crypto accelerator, we are developing for our SoC, we have a use-case where the same driver can support multiple/range of KEY LOCATIONS. We want a mechanism such that, the a common function in driver is called which can then take the necessary option based on the key location.
The way jsons are currently structured, what I understand is that for every key location, we will need to create a separate json with a different driver prefix. This would lead to a lot of code duplication for us.
For eg { to define 3 locations X, Y and Z , I need to create 3 json files -> these all refer to same crypto sub-system I my case}
#define TEST_DRIVER_X_OPAQUE_DRIVER_ID
#define TEST_DRIVER_Y_OPAQUE_DRIVER_ID
#define TEST_DRIVER_Z_OPAQUE_DRIVER_ID
Switch (key_location)
Case x:
Test_driver_x_ opaque_import_key();
break;
Case y:
Test_driver_y_ opaque_import_key();
break;
Case z:
Test_driver_z_ opaque_import_key();
break;
This is resulting in a lot of code duplication and overhead. What we want to have the flexibility to achieve is :
#define TEST_DRIVER_OPAQUE_DRIVER_ID
Switch (key_location)
Case x:
Case y:
Case z:
Test_driver_opaque_import_key();
If we can support multiple locations from a driver json file for a given driver, this issue would be resolved. This would give the driver writers flexibility on how and where they want to handle the locations.
Please let us know your views on the same.
Regards,
Ruchika
I am not sure I completely understand the PSA API for key exchange.
I have been creating a private key, exporting the public key, passing
that successfully to the peer, obtaining the peer's public key, and I
want to use psa_raw_key_agreement to obtain the shared secret. But it
fails in:
if (!PSA_ALG_IS_KEY_AGREEMENT(alg)) {
status = PSA_ERROR_INVALID_ARGUMENT;
goto exit;
}
The value of "alg" is 0x06000609, computed as
PSA_ALG_ECDSA(PSA_ALG_SHA_256). That's probably wrong, but I do not know
why...
-- Christian Huitema
In TLS 1.3, one half of an ECDH exchange is defined as a "key entry",
coded as:
struct {
NamedGroup group;
opaque key_exchange<1..2^16-1>;
} KeyShareEntry;
The opaque data is typically encoded as a one byte format (e.g., 0x04,
no compression), and then the encoding of either one or two points: 32
bytes for one point with CURVE25519, 64 bytes for two points with SECP256R1.
The encoding for the "public key" output of mbedtls_ecdh_make_params is
different: 1 byte of length, followed by 2 bytes of curve ID, followed
by the raw encoding of the point or points. The related encoding of the
server public key output of mbedtls_ecdh_make_public is also different:
1 byte of length, followed by 2 bytes of curve ID, followed by the raw
encoding of the point or points.
To make that work, I need some reformatting: strip out 3 bytes for the
client public key, write a single 0x04 byte instead; strip out one byte
from the key-exchange data received at the server and write 3 bytes of
length and curve ID instead. Also, make sure to reset the strings to the
unmodified value before calling mbedtls_ecdh_calc_secret, which probably
means maintaining two copies, thus twice the memory.
This is a bit messy, and probably unnecessary. The extra parameters
"length" is already passed through the API (the &olen argument) and the
"group_id" could easily be passed as well.
Or maybe I am looking at the wrong API...
-- Christian Huitema
I am developing an AWS IoT MQTT client on STM32H723 using FreeRTOS 10.3.1, LwIP 2.1.2 and MbedTLS.
My first attempt used MbedTLS 2.16.2 and it mostly works except that sometimes, seemingly related to the timing of the network I'm using, it fails when my client fails to send out anything after the Client Key Exchange message and then the server responds with a Close Notify as follows:
"Time","Source","Destination","Protocol","Length","Info"
"0.000000","10.24.108.94","54.157.158.237","TLSv1.2","418","Client Hello"
"0.016460","54.157.158.237","10.24.108.94","TLSv1.2","150","Server Hello"
"0.002777","54.157.158.237","10.24.108.94","TLSv1.2","685","Certificate"
"0.000000","54.157.158.237","10.24.108.94","TLSv1.2","438","Server Key Exchange, Certificate Request, Server Hello Done"
"0.976521","10.24.108.94","54.157.158.237","TLSv1.2","1006","Certificate, Client Key Exchange"
"0.014853","54.157.158.237","10.24.108.94","TLSv1.2","61","Alert (Level: Warning, Description: Close Notify)"
When it works it looks like this:
"Time","Source","Destination","Protocol","Length","Info"
"0.000000000","10.0.0.11","54.84.254.130","TLSv1.2","418","Client Hello"
"0.017495225","54.84.254.130","10.0.0.11","TLSv1.2","150","Server Hello"
"0.001743255","54.84.254.130","10.0.0.11","TLSv1.2","685","Certificate"
"0.000022282","54.84.254.130","10.0.0.11","TLSv1.2","392","Server Key Exchange"
"0.000004428","54.84.254.130","10.0.0.11","TLSv1.2","100","Certificate Request, Server Hello Done"
"2.606030441","10.0.0.11","54.84.254.130","TLSv1.2","1326","Certificate, Client Key Exchange, Certificate Verify, Change Cipher Spec, Encrypted Handshake Message"
"0.027421478","54.84.254.130","10.0.0.11","TLSv1.2","105","Change Cipher Spec, Encrypted Handshake Message"
"0.000971482","10.0.0.11","54.84.254.130","TLSv1.2","193","Application Data"
"0.075384354","54.84.254.130","10.0.0.11","TLSv1.2","87","Application Data"
The last two "Application Data" messages are the MQTT connect and connect ACK,
So before I filed a bug report, I upgraded to MbedTLS 2.28.4. The good news is that this client always (seems) to successfully negotiate the TLS handshake, but after receiving the first encrypted "Application Data" (connect), the broker immediately sends and "Encrypted Alert", which I'm taking to be a Close Notify because a TCP FIN follows shortly thereafter.
The Wireshark capture of the 2.28.4 handshake looks almost exactly like the successful 2.16.2 handshake:
"Time","Source","Destination","Protocol","Length","Info"
"0.000000000","10.0.0.11","44.195.98.16","TLSv1.2","336","Client Hello"
"0.018450117","44.195.98.16","10.0.0.11","TLSv1.2","150","Server Hello"
"0.000524146","44.195.98.16","10.0.0.11","TLSv1.2","685","Certificate"
"0.000003168","44.195.98.16","10.0.0.11","TLSv1.2","392","Server Key Exchange"
"0.000002995","44.195.98.16","10.0.0.11","TLSv1.2","100","Certificate Request, Server Hello Done"
"2.517148776","10.0.0.11","44.195.98.16","TLSv1.2","1329","Certificate, Client Key Exchange, Certificate Verify, Change Cipher Spec, Encrypted Handshake Message"
"0.016572792","44.195.98.16","10.0.0.11","TLSv1.2","60","Change Cipher Spec"
"0.000007326","44.195.98.16","10.0.0.11","TLSv1.2","99","Encrypted Handshake Message"
"0.001500778","10.0.0.11","44.195.98.16","TLSv1.2","193","Application Data"
"0.031014646","44.195.98.16","10.0.0.11","TLSv1.2","85","Encrypted Alert"
... except for the "Encrypted Alert" from the broker that leads to the closing of the session.
I'm hoping someone has an explanation of the behavior I'm seeing and can suggest a path forward for me. Another data point is the fact that the client with MbedTLS 2.28.4 can successfully authentic and negotiate a TLS handshake with a mosquitto broker I'm running locally using self signed certificates.
======================================================================
The information contained in this e-mail, including all of its attachments, is
confidential and proprietary information of IPG Photonics and its affiliates and
intended only for the use of the individual or entity named above. If the
reader of this message is not the intended recipient, or the employee or agent
responsible to deliver it to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is strictly
prohibited.
If you have received this communication in error, please immediately notify the
sender by telephone or e-mail, and destroy this communication and all copies.
Thank you.
=======================================================================
This Email has been scanned for all viruses by IPG Photonics Email Scanning Services.
Hi All,
A gentle reminder that the Asia-Europe timezone-friendly MBed TLS Tech
forum is *next Monday at 10:00am PM UK time.* Invite details can be found
on the online calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Dave Rodgman know. :)
Best regards,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
ReplyReply to allForward
Hi All,
Note you may have received another instance of this note but when I
attempted to send to all TF ML's simultaneously it seemed to fail, so
sending to each one at a time. Sorry about that. :/
We've created a Discord Server for real time chats/sharing. This solution
comes at no cost to the project, is set up with channels for each project,
includes a #general channel, and supports direct 1-1 chats between members,
all with the goal of improving collaboration between trustedfirmware.org
developers.
We encourage all to join! :) Instructions for joining can be found on
the TF.org
FAQ page <https://www.trustedfirmware.org/faq/>.
See you all there and please don't hesitate to reach out if you have any
questions!
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
Hi,
I am trying to use a certificate with its public key algorithm is NIST
P-384 and its signature algorithm is ED448.
I am working on ESP board with IDF framework which supports mbedtls. But
when I am trying to use that certificate, I got error message about
'MBEDTLS_ERR_X509_UNKOWN_SIG_ALG'.
So, I thought that maybe mbedtls does not support certificates which signed
with ED448.
Hi,
I am trying to use a certificate with its public key algorithm is NIST
P-384 and its signature algorithm is ED448.
I am working on ESP board with IDF framework which supports mbedtls. But
when I am trying to use that certificate, I got error message about
'MBEDTLS_ERR_X509_UNKOWN_SIG_ALG'.
So, I thought that maybe mbedtls does not support certificates which signed
with ED448.
I've got mbedTLS 3.1.4 and want to use TLS 1.3. My handshake fails very early because I don't have any Pre-Shared Keys. Does mbedTLS TLS1.3 only support PSKs, or can I still use generated session keys as does TLS 1.2? If so, how?
Jeff Thompson | Senior Electrical Engineer - Firmware
+1 704 752 6513 x1394
www.invue.com
[cid:image001.gif@01D9D729.620C6230]
Hello,
I am trying to build MbedTLS on a Mac, as part of a project to support
MbedTLS in the "picoquic" implementation of QUIC. I have a small
problem, probably something of my making. I have cloned the repo on an
"mbedtls" directory, created a "build" subdirectory, and from there
run"cmake ..", which worked fine, and then tried to run "make", which
fails in "generating psa_crypto_driver_wrapper.c" when trying the python
script "generate_driver_wrappers.py" because it cannot find the python
module "jsonschema".
I tried to solve that by installing that module using "pip", and test
programs running python3 do find the "jsonschema". Calling
print(jsonschema.__file__) shows the module is installed in my user
directory:
/users/christianhuitema/Library/python3.9/lib/python/...
Is there a simple way to fix that?
-- Christian Huitema
Hello,
I'm currently engaged in a project where I'm utilizing mbedtls for the management of certificates. Within this project, I'm aiming to integrate a revocation feature using Certificate Revocation Lists (CRLs). However, my search for resources on how to effectively implement a comprehensive certificate revocation process using mbedtls has unfortunately yielded no productive outcomes.
I am concerned about how to first create a crl file and sign it using my self-signed CA, how to revocate a certificate if we need to revocate it, and how to update the CRL, then when parsing the cert how to detect that this certificate has been revocated. ( I am using LPCXpresso55S16 as a client and raspberry pi as a server and I am doing all with coding).
Thank you in advance for your support.
Best regards,
Ahmed.
Hello,
I need some help to setup mbedtls as a CMake subproject, I added it as a subdirectory in my CMakeLists.
However, I can't figure out how to use my own config file for mbedtls (MBEDTLS_CONFIG_FILE option to the file I want as a config file).
When I put my custom config file to the include folder of mbedtls in the place of the original mbedtls_config.h file it works wel,l but it's not a future-proof option for me, is there anyone that could help me with this setup ?
Hi,
I have noticed that PSA driver wrapper function is missing for single part MAC verify function. In the current implementation, it calls the MAC compute wrapper and does the comparison using mbedtls_psa_safer_memcmp.
The hardware I am working on allows the complete process to be offloaded to it. Can we have an option for the same in wrapper layer for PSA for MAC verify ?
Regards,
Ruchika
Hi Mbed TLS users,
We are releasing Mbed TLS 3.4.1 and 2.28.4 LTS.
As the point release suggests, this is a small update which primarily addresses some expiring test certificates.
Full details are available via the release notes:
https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.4.1https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.4
We recommend all users to consider whether they are impacted, and to upgrade appropriately.
Thanks,
The Mbed TLS team
This event has been updated
Changed: time, description
MBed TLS Technical Forum - Asia
Every 4 weeks from 2am to 2:50am on Monday 3 times
Mountain Standard Time - Phoenix
Trusted Firmware is inviting you to a scheduled Zoom meeting.Topic: MBed
TLS - AsisTime: Aug 14, 2023 10:00 AM London Every 4 weeks on Mon,
20 occurrence(s) Aug 14, 2023 10:00 AM Sep 11, 2023 10:00
AM Oct 9, 2023 10:00 AM Nov 6, 2023 10:00 AM Dec 4,
2023 10:00 AM Jan 1, 2024 10:00 AM Jan 29, 2024 10:00
AM Feb 26, 2024 10:00 AM Mar 25, 2024 10:00 AM Apr 22,
2024 10:00 AM May 20, 2024 10:00 AM Jun 17, 2024 10:00
AM Jul 15, 2024 10:00 AM Aug 12, 2024 10:00 AM Sep 9,
2024 10:00 AM Oct 7, 2024 10:00 AM Nov 4, 2024 10:00
AM Dec 2, 2024 10:00 AM Dec 30, 2024 10:00 AM Jan 27,
2025 10:00 AMPlease download and import the following iCalendar (.ics)
files to your calendar system.Weekly:
https://linaro-org.zoom.us/meeting/tJEpcOivrT4jGtzyd1M9ASL221VfGUYcCKhw/ics…
Zoom
Meetinghttps://linaro-org.zoom.us/j/95471735908?pwd=WStaaWhEVXNqcWx1S2pEQU13cHU2UT09Meeting
ID: 954 7173 5908Passcode: 300608---One tap
mobile+13462487799,,95471735908# US (Houston)+16694449171,,95471735908#
US---Dial by your location• +1 346 248 7799 US (Houston)• +1 669 444 9171
US• +1 669 900 9128 US (San Jose)• +1 719 359 4580 US• +1 253 205 0468 US•
+1 253 215 8782 US (Tacoma)• +1 305 224 1968 US• +1 309 205 3325 US• +1 312
626 6799 US (Chicago)• +1 360 209 5623 US• +1 386 347 5053 US• +1 507 473
4847 US• +1 564 217 2000 US• +1 646 558 8656 US (New York)• +1 646 931 3860
US• +1 689 278 1000 US• +1 301 715 8592 US (Washington DC)• 877 853 5247 US
Toll-free• 888 788 0099 US Toll-freeMeeting ID: 954 7173 5908Find your
local number: https://linaro-org.zoom.us/u/aEkjrvuAZ
Guests
Don Harbin - creator
nnac123(a)gmail.com
santosdanillo(a)gmail.com
schoenle.thomas(a)googlemail.com
psa-crypto(a)lists.trustedfirmware.org
mbed-tls(a)lists.trustedfirmware.org
kris.kwiatkowski(a)pqshield.com
View all guest info
https://calendar.google.com/calendar/event?action=VIEW&eid=MzE1cHJuZGxwMDFo…
Reply for mbed-tls(a)lists.trustedfirmware.org and view more details
https://calendar.google.com/calendar/event?action=VIEW&eid=MzE1cHJuZGxwMDFo…
Your attendance is optional.
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event. To
stop receiving future updates for this event, decline this event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
This event has been updated
Changed: time
MBed TLS Technical Forum - Asia
Every 4 weeks from 3am to 3:50am on Monday from Monday Jan 30 to Sunday Aug
13
Mountain Standard Time - Phoenix
Trusted Firmware is inviting you to a scheduled Zoom meeting.
Topic: MBed TLS Technical Forum - Asia
Time: Nov 8, 2021 10:00 AM London
Every 4 weeks on Mon, 20 occurrence(s)
Nov 8, 2021 10:00 AM
Dec 6, 2021 10:00 AM
Jan 3, 2022 10:00 AM
Jan 31, 2022 10:00 AM
Feb 28, 2022 10:00 AM
Mar 28, 2022 10:00 AM
Apr 25, 2022 10:00 AM
May 23, 2022 10:00 AM
Jun 20, 2022 10:00 AM
Jul 18, 2022 10:00 AM
Aug 15, 2022 10:00 AM
Sep 12, 2022 10:00 AM
Oct 10, 2022 10:00 AM
Nov 7, 2022 10:00 AM
Dec 5, 2022 10:00 AM
Jan 2, 2023 10:00 AM
Jan 30, 2023 10:00 AM
Feb 27, 2023 10:00 AM
Mar 27, 2023 10:00 AM
Apr 24, 2023 10:00 AM
Please download and import the following iCalendar (.ics) files to your
calendar system.
Weekly:
https://linaro-org.zoom.us/meeting/tJ0kc-GsqDktHNGa8CWl6wJ7je6CKD-5zgh8/ics…
Join Zoom Meeting
https://linaro-org.zoom.us/j/99948462765?pwd=SGlHYlF1Z2owUDNFWWppaGlSRDh5UT…
Meeting ID: 999 4846 2765
Passcode: 196117
One tap mobile
+12532158782,,99948462765# US (Tacoma)
+13462487799,,99948462765# US (Houston)
Dial by your location
+1 253 215 8782 US (Tacoma)
+1 346 248 7799 US (Houston)
+1 669 900 9128 US (San Jose)
+1 301 715 8592 US (Washington DC)
+1 312 626 6799 US (Chicago)
+1 646 558 8656 US (New York)
888 788 0099 US Toll-free
877 853 5247 US Toll-free
Meeting ID: 999 4846 2765
Find your local number: https://linaro-org.zoom.us/u/anpWWkRdt
Guests
Don Harbin - creator
nnac123(a)gmail.com
santosdanillo(a)gmail.com
schoenle.thomas(a)googlemail.com
psa-crypto(a)lists.trustedfirmware.org
mbed-tls(a)lists.trustedfirmware.org
kris.kwiatkowski(a)pqshield.com
View all guest info
https://calendar.google.com/calendar/event?action=VIEW&eid=MzE1cHJuZGxwMDFo…
Reply for mbed-tls(a)lists.trustedfirmware.org and view more details
https://calendar.google.com/calendar/event?action=VIEW&eid=MzE1cHJuZGxwMDFo…
Your attendance is optional.
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event. To
stop receiving future updates for this event, decline this event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
This event has been updated
Changed: title, description
MBed TLS Technical Forum - US
Every 4 weeks from 8:30am to 9:30am on Monday
Mountain Standard Time - Phoenix
Trusted Firmware is inviting you to a scheduled Zoom meeting.Trusted
Firmware is inviting you to a scheduled Zoom meeting.Topic: MBed TLS Tech
Forum - USTime: Aug 28, 2023 04:30 PM London Every 4 weeks on Mon,
20 occurrence(s) Aug 28, 2023 04:30 PM Sep 25, 2023 04:30
PM Oct 23, 2023 04:30 PM Nov 20, 2023 04:30 PM Dec 18,
2023 04:30 PM Jan 15, 2024 04:30 PM Feb 12, 2024 04:30
PM Mar 11, 2024 04:30 PM Apr 8, 2024 04:30 PM May 6,
2024 04:30 PM Jun 3, 2024 04:30 PM Jul 1, 2024 04:30
PM Jul 29, 2024 04:30 PM Aug 26, 2024 04:30 PM Sep 23,
2024 04:30 PM Oct 21, 2024 04:30 PM Nov 18, 2024 04:30
PM Dec 16, 2024 04:30 PM Jan 13, 2025 04:30 PM Feb 10,
2025 04:30 PMPlease download and import the following iCalendar (.ics)
files to your calendar system.Weekly:
https://linaro-org.zoom.us/meeting/tJ0udu2spj0vHtbQtlCmHwhHCT7ECtJI39J4/ics…
Zoom
Meetinghttps://linaro-org.zoom.us/j/99314486542?pwd=Q1ZjaFhQeDRrQWxsa3MvT1Mwditqdz09Meeting
ID: 993 1448 6542Passcode: 628327---One tap
mobile+13462487799,,99314486542# US (Houston)+16694449171,,99314486542#
US---Dial by your location• +1 346 248 7799 US (Houston)• +1 669 444 9171
US• +1 669 900 9128 US (San Jose)• +1 719 359 4580 US• +1 253 205 0468 US•
+1 253 215 8782 US (Tacoma)• +1 360 209 5623 US• +1 386 347 5053 US• +1 507
473 4847 US• +1 564 217 2000 US• +1 646 558 8656 US (New York)• +1 646 931
3860 US• +1 689 278 1000 US• +1 301 715 8592 US (Washington DC)• +1 305 224
1968 US• +1 309 205 3325 US• +1 312 626 6799 US (Chicago)• 877 853 5247 US
Toll-free• 888 788 0099 US Toll-freeMeeting ID: 993 1448 6542Find your
local number: https://linaro-org.zoom.us/u/adSjuOyMhI
Guests
psa-crypto(a)lists.trustedfirmware.org
mbed-tls(a)lists.trustedfirmware.org
nnac123(a)gmail.com
View all guest info
https://calendar.google.com/calendar/event?action=VIEW&eid=ZGExMnNqcDB1MDFm…
Reply for mbed-tls(a)lists.trustedfirmware.org and view more details
https://calendar.google.com/calendar/event?action=VIEW&eid=ZGExMnNqcDB1MDFm…
Your attendance is optional.
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event. To
stop receiving future updates for this event, decline this event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
This event has been updated
MBed TLS Technical Forum
Every 4 weeks from 9:30am to 10:30am on Monday
Mountain Standard Time - Phoenix
Trusted Firmware is inviting you to a scheduled Zoom meeting.
Topic: MBed TLS Technical Forum
Time: Oct 25, 2021 04:30 PM London
Every 4 weeks on Mon, 20 occurrence(s)
Oct 25, 2021 04:30 PM
Nov 22, 2021 04:30 PM
Dec 20, 2021 04:30 PM
Jan 17, 2022 04:30 PM
Feb 14, 2022 04:30 PM
Mar 14, 2022 04:30 PM
Apr 11, 2022 04:30 PM
May 9, 2022 04:30 PM
Jun 6, 2022 04:30 PM
Jul 4, 2022 04:30 PM
Aug 1, 2022 04:30 PM
Aug 29, 2022 04:30 PM
Sep 26, 2022 04:30 PM
Oct 24, 2022 04:30 PM
Nov 21, 2022 04:30 PM
Dec 19, 2022 04:30 PM
Jan 16, 2023 04:30 PM
Feb 13, 2023 04:30 PM
Mar 13, 2023 04:30 PM
Apr 10, 2023 04:30 PM
Please download and import the following iCalendar (.ics) files to your
calendar system.
Weekly:
https://linaro-org.zoom.us/meeting/tJEkceuurT4sGdaksikbUn6FARB9Kuk3ac2o/ics…
Join Zoom Meeting
https://linaro-org.zoom.us/j/95962635632?pwd=STFkQVltejAzRDJ6NmoxZjhmZC9RUT…
Meeting ID: 959 6263 5632
Passcode: 018366
One tap mobile
+13462487799,,95962635632# US (Houston)
+16699009128,,95962635632# US (San Jose)
Dial by your location
+1 346 248 7799 US (Houston)
+1 669 900 9128 US (San Jose)
+1 253 215 8782 US (Tacoma)
+1 312 626 6799 US (Chicago)
+1 646 558 8656 US (New York)
+1 301 715 8592 US (Washington DC)
877 853 5247 US Toll-free
888 788 0099 US Toll-free
Meeting ID: 959 6263 5632
Find your local number: https://linaro-org.zoom.us/u/aewUpnQu5y
Guests
psa-crypto(a)lists.trustedfirmware.org
mbed-tls(a)lists.trustedfirmware.org
nnac123(a)gmail.com
View all guest info
https://calendar.google.com/calendar/event?action=VIEW&eid=ZGExMnNqcDB1MDFm…
Reply for mbed-tls(a)lists.trustedfirmware.org and view more details
https://calendar.google.com/calendar/event?action=VIEW&eid=ZGExMnNqcDB1MDFm…
Your attendance is optional.
~~//~~
Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee on the event. To
stop receiving future updates for this event, decline this event.
Forwarding this invitation could allow any recipient to send a response to
the organizer, be added to the guest list, invite others regardless of
their own invitation status, or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
Hi All,
A gentle reminder that the US-Europe timezone-friendly MBed TLS Tech forum
is next Monday at 4:30 PM UK time. Invite details can be found on the
online calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Dave Rodgman know. :)
Best regards,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
When `mbedtls_pk_verify` is used to verify digital signatures generated by openssl, the MBEDTLS_ERR_RSA_VERIFY_FAILED error occurs, openssl Specifies the command used to generate a certificate:
```bash
openssl md5 -sign private.key -out sign test.md
```
But when I use `mbedtls_pk_sign(&pk_pri_ctx, MBEDTLS_MD_MD5, md, 0, sign_info, sizeof(sign_info), &size, mbedtls_ctr_drbg_random, &ctrl_drbg)` Generating the signature and using `mbedtls_pk_verify` results are successful, Print the signatures generated by mbedtls are not found to be the same as those generated by openssl. Please help。
mbedtls version:
```c
#define MBEDTLS_VERSION_STRING "3.4.0"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 3.4.0"
```
openssl version:
```c
OpenSSL 1.1.1 11 Sep 2018
```
Hi,
I am currently working on PSA driver for our SoC's security crypto-processor. This processor needs to do some handling when a key is destroyed.
In the current implementation in mbedTLS, I don't see a driver wrapper function available in psa_destroy_key(). Is there a specific reason for not having wrapper for driver function available for psa_destroy_key() ?
Another query pertaining to the tests in the testsuite in mbedTLS. I was exploring if I could reuse the tests for the crypto-processor implementation. Have these been written with this kind of reuse in mind ?
Basically I would like the ability to add driver location to the cases. The few cases I have looked at for psa seem to be very specific. Any pointers/suggestions if anyone is reusing this test suite to test their specific PSA drivers?
Regards,
Ruchika
Hi All,
Thank you for sharing the MBED-TLS open source platform.
I need help with on of the crashes that I am observing right now. Below are my setup details:
Below are my setup details:
System information
Client side setup
Platform : Micro controller based platform stm32
OS : FreeRTOS
Compiler: gcc-arm-none-eabi-8-2019-q3-update
Below is the backtrace:
(gdb) bt
#0 panicCB (file=0xc94d7 "memory", line=734, message=0x2000ff50 <sli_wisun_event_loop_task_stack+4224> "Ajay Malloc Failed 88")
at build/3pp/freertos/FreeRTOS/Source/include/../../Source/portable/GCC/ARM_CM3/portmacro.h:237
#1 0x0003b2ae in panicHalt_ (file=file@entry=0xc94d7 "memory", line=line@entry=734, message=<optimized out>) at src/platform/core/assert.c:34
#2 0x0003bf0a in reallocInternal (p=<optimized out>, size=68, zeroFill=<optimized out>, file=0xc94d7 "memory", line=734) at src/platform/core/memory.c:317
#3 0x0003c2d8 in reallocWrapper (p=p@entry=0x0, size=<optimized out>, zeroFill=zeroFill@entry=true, file=file@entry=0xc94d7 "memory", line=line@entry=734) at src/platform/core/memory.c:673
#4 0x0003c350 in platformCalloc (n=<optimized out>, size=<optimized out>) at src/platform/core/memory.c:734
#5 0x00043dac in mbedtls_mpi_grow (nblimbs=17, X=0x2001001c <sli_wisun_event_loop_task_stack+4428>) at build/3pp/mbedtls/library/bignum.c:125
#6 mbedtls_mpi_grow (X=0x2001001c <sli_wisun_event_loop_task_stack+4428>, nblimbs=17) at build/3pp/mbedtls/library/bignum.c:115
#7 0x0004414a in mbedtls_mpi_shift_l (X=X@entry=0x2001001c <sli_wisun_event_loop_task_stack+4428>, count=count@entry=256) at build/3pp/mbedtls/library/bignum.c:1016
#8 0x00044818 in mbedtls_mpi_div_mpi (Q=Q@entry=0x0, R=R@entry=0x200100bc <sli_wisun_event_loop_task_stack+4588>, A=A@entry=0x200100bc <sli_wisun_event_loop_task_stack+4588>,
B=B@entry=0x200101d0 <sli_wisun_event_loop_task_stack+4864>) at build/3pp/mbedtls/library/bignum.c:1812
#9 0x00044a46 in mbedtls_mpi_mod_mpi (R=R@entry=0x200100bc <sli_wisun_event_loop_task_stack+4588>, A=A@entry=0x200100bc <sli_wisun_event_loop_task_stack+4588>,
B=B@entry=0x200101d0 <sli_wisun_event_loop_task_stack+4864>) at build/3pp/mbedtls/library/bignum.c:1917
#10 0x00046486 in ecdsa_verify_restartable (grp=grp@entry=0x20010184 <sli_wisun_event_loop_task_stack+4788>,
buf=buf@entry=0x200102a4 <sli_wisun_event_loop_task_stack+5076> "c;\371\274\231xF\004 \207\005\271\257\177\266\224\234\212\205Є\331\366D\304L<\243\303f\246j\250\370\001 ", blen=blen@entry=32,
Q=Q@entry=0x2001020c <sli_wisun_event_loop_task_stack+4924>, r=r@entry=0x20010120 <sli_wisun_event_loop_task_stack+4688>, s=s@entry=0x2001012c <sli_wisun_event_loop_task_stack+4700>, rs_ctx=0x0)
at build/3pp/mbedtls/library/ecdsa.c:649
#11 0x00046660 in mbedtls_ecdsa_read_signature_restartable (ctx=ctx@entry=0x20010184 <sli_wisun_event_loop_task_stack+4788>,
hash=hash@entry=0x200102a4 <sli_wisun_event_loop_task_stack+5076> "c;\371\274\231xF\004 \207\005\271\257\177\266\224\234\212\205Є\331\366D\304L<\243\303f\246j\250\370\001 ", hlen=hlen@entry=32,
sig=sig@entry=0x2001d2e1 "0D\002 r\203\237\331\v\346J*m\312\326\346\004+\a\377\373bX\016\233خ\346\030\356\311Nk\270\341L\002 h;\b\301\206\215\346\005\021c\"|\026\353𦕟\327\300ģ\221\\\324s\n^GW", <incomplete sequence \314>, slen=slen@entry=70, rs_ctx=rs_ctx@entry=0x0) at build/3pp/mbedtls/library/ecdsa.c:881
#12 0x0004668e in mbedtls_ecdsa_read_signature (ctx=ctx@entry=0x20010184 <sli_wisun_event_loop_task_stack+4788>,
hash=hash@entry=0x200102a4 <sli_wisun_event_loop_task_stack+5076> "c;\371\274\231xF\004 \207\005\271\257\177\266\224\234\212\205Є\331\366D\304L<\243\303f\246j\250\370\001 ", hlen=hlen@entry=32,
sig=sig@entry=0x2001d2e1 "0D\002 r\203\237\331\v\346J*m\312\326\346\004+\a\377\373bX\016\233خ\346\030\356\311Nk\270\341L\002 h;\b\301\206\215\346\005\021c\"|\026\353𦕟\327\300ģ\221\\\324s\n^GW", <incomplete sequence \314>, slen=slen@entry=70) at build/3pp/mbedtls/library/ecdsa.c:832
#13 0x0004a830 in ecdsa_verify_wrap (ctx=ctx@entry=0x20010184 <sli_wisun_event_loop_task_stack+4788>, md_alg=md_alg@entry=MBEDTLS_MD_SHA256,
hash=hash@entry=0x200102a4 <sli_wisun_event_loop_task_stack+5076> "c;\371\274\231xF\004 \207\005\271\257\177\266\224\234\212\205Є\331\366D\304L<\243\303f\246j\250\370\001 ", hash_len=hash_len@entry=32,
sig=sig@entry=0x2001d2e1 "0D\002 r\203\237\331\v\346J*m\312\326\346\004+\a\377\373bX\016\233خ\346\030\356\311Nk\270\341L\002 h;\b\301\206\215\346\005\021c\"|\026\353𦕟\327\300ģ\221\\\324s\n^GW", <incomplete sequence \314>, sig_len=sig_len@entry=70) at build/3pp/mbedtls/library/pk_wrap.c:633
#14 0x0004a872 in eckey_verify_wrap (ctx=<optimized out>, md_alg=<optimized out>,
hash=0x200102a4 <sli_wisun_event_loop_task_stack+5076> "c;\371\274\231xF\004 \207\005\271\257\177\266\224\234\212\205Є\331\366D\304L<\243\303f\246j\250\370\001 ", hash_len=32,
sig=0x2001d2e1 "0D\002 r\203\237\331\v\346J*m\312\326\346\004+\a\377\373bX\016\233خ\346\030\356\311Nk\270\341L\002 h;\b\301\206\215\346\005\021c\"|\026\353𦕟\327\300ģ\221\\\324s\n^GW", <incomplete sequence \314>, sig_len=70) at build/3pp/mbedtls/library/pk_wrap.c:252
#15 0x0004a3de in mbedtls_pk_verify (ctx=ctx@entry=0x2001ce48, md_alg=<optimized out>, hash=<optimized out>, hash_len=<optimized out>,
sig=0x2001d2e1 "0D\002 r\203\237\331\v\346J*m\312\326\346\004+\a\377\373bX\016\233خ\346\030\356\311Nk\270\341L\002 h;\b\301\206\215\346\005\021c\"|\026\353𦕟\327\300ģ\221\\\324s\n^GW", <incomplete sequence \314>, sig_len=70) at build/3pp/mbedtls/library/pk.c:326
#16 0x0004a55c in mbedtls_pk_verify_ext (type=<optimized out>, options=<optimized out>, ctx=ctx@entry=0x2001ce48, md_alg=<optimized out>, hash=<optimized out>,
hash@entry=0x200102a4 <sli_wisun_event_loop_task_stack+5076> "c;\371\274\231xF\004 \207\005\271\257\177\266\224\234\212\205Є\331\366D\304L<\243\303f\246j\250\370\001 ", hash_len=<optimized out>,
hash_len@entry=32,
sig=0x2001d2e1 "0D\002 r\203\237\331\v\346J*m\312\326\346\004+\a\377\373bX\016\233خ\346\030\356\311Nk\270\341L\002 h;\b\301\206\215\346\005\021c\"|\026\353𦕟\327\300ģ\221\\\324s\n^GW", <incomplete sequence \314>, sig_len=70) at build/3pp/mbedtls/library/pk.c:390
#17 0x0004feb4 in x509_crt_check_signature (rs_ctx=<optimized out>, parent=0x2001cd7c, child=0x2001f8a8) at build/3pp/mbedtls/library/x509_crt.c:2474
#18 x509_crt_find_parent_in (rs_ctx=<optimized out>, self_cnt=<optimized out>, path_cnt=<optimized out>, top=<optimized out>, r_signature_is_good=<optimized out>, r_parent=<optimized out>, candidates=<optimized out>,
child=<optimized out>) at build/3pp/mbedtls/library/x509_crt.c:2612
#19 x509_crt_find_parent (rs_ctx=<optimized out>, self_cnt=<optimized out>, path_cnt=<optimized out>, signature_is_good=<optimized out>, parent_is_trusted=<optimized out>, parent=<optimized out>,
trust_ca=<optimized out>, child=<optimized out>) at build/3pp/mbedtls/library/x509_crt.c:2709
#20 x509_crt_verify_chain (f_ca_cb=0x0, p_ca_cb=0x0, rs_ctx=0x0, ver_chain=0x200102c4 <sli_wisun_event_loop_task_stack+5108>, profile=0xcd08c <mbedtls_x509_crt_profile_default>, ca_crl=0x0, trust_ca=0x2001cd7c,
crt=0x2001f8a8) at build/3pp/mbedtls/library/x509_crt.c:2919
#21 x509_crt_verify_restartable_ca_cb (crt=crt@entry=0x2001f8a8, trust_ca=trust_ca@entry=0x2001cd7c, ca_crl=0x0, profile=0xcd08c <mbedtls_x509_crt_profile_default>, cn=0x0, flags=0x2001dd30,
f_vrfy=0x695f1 <tls_sec_prot_lib_x509_crt_verify>, p_vrfy=0x2001c8a0, rs_ctx=0x0, p_ca_cb=0x0, f_ca_cb=0x0) at build/3pp/mbedtls/library/x509_crt.c:3150
--Type <RET> for more, q to quit, c to continue without paging--
#22 0x00050090 in mbedtls_x509_crt_verify_restartable (crt=crt@entry=0x2001f8a8, trust_ca=trust_ca@entry=0x2001cd7c, ca_crl=<optimized out>, profile=<optimized out>, cn=0x0, flags=0x2001dd30,
f_vrfy=0x695f1 <tls_sec_prot_lib_x509_crt_verify>, p_vrfy=0x2001c8a0, rs_ctx=rs_ctx@entry=0x0) at build/3pp/mbedtls/library/x509_crt.c:3258
#23 0x00058f7c in ssl_parse_certificate_verify (rs_ctx=0x0, chain=0x2001f8a8, authmode=<optimized out>, ssl=0x2001c918) at build/3pp/mbedtls/library/ssl_tls.c:2542
#24 mbedtls_ssl_parse_certificate (ssl=ssl@entry=0x2001c918) at build/3pp/mbedtls/library/ssl_tls.c:2795
#25 0x00051d1c in mbedtls_ssl_handshake_client_step (ssl=0x2001c918) at build/3pp/mbedtls/library/ssl_cli.c:4295
#26 0x00058210 in mbedtls_ssl_handshake_step (ssl=0x2001c918) at build/3pp/mbedtls/library/ssl_tls.c:5668
#27 0x00069922 in tls_sec_prot_lib_process ()
#28 0x0006b442 in client_tls_sec_prot_state_machine ()
#29 0x00069af8 in tls_sec_prot_receive ()
#30 0x00068072 in supp_eap_tls_sec_prot_state_machine ()
#31 0x000627b8 in supp_eap_tls_sec_prot_receive ()
#32 0x0006d28c in kmp_eapol_pdu_if_receive ()
#33 0x0007d602 in ws_eapol_pdu_mpx_data_indication ()
#34 0x00080f2e in ws_llc_mac_indication_cb.lto_priv ()
#35 0x000a8df6 in mac_mcps_sap_data_tasklet.lto_priv ()
#36 0x000ae3f8 in event_loop_thread.lto_priv ()
#37 0x000414c0 in xEventGroupSetBitsFromISR (xEventGroup=<optimized out>, uxBitsToSet=<optimized out>, pxHigherPriorityTaskWoken=<optimized out>) at build/3pp/freertos/FreeRTOS/Source/event_groups.c:724
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
(gdb)
I see a crash while my node is trying to authenticate using EAP-TLS to a gateway.
I am able to consistently reproduce observe this issue.
Is this something that has been already solved or is seen by anybody ?
Any inputs on this will help.
With regards,
Ajay.
Hi,
i wanted to ask if the hardware accelerators and TRNG of the Hardware
Security Engine (HSE) of NXP S32K3XX microcontrollers are supported by the
mbedTLS Library ? because i can't find it in the "MBEDTLS HARDWARE
CRYPTOGRAPHY SUPPORT" list.
Best regards,
Ben
+ Mbed TLS mailing list for visibility…
Regards,
Shebu
From: Rehan Malak via TF-M <tf-m(a)lists.trustedfirmware.org>
Sent: Monday, July 10, 2023 9:44 AM
To: Antonio De Angelis <Antonio.DeAngelis(a)arm.com>; tf-m(a)lists.trustedfirmware.org
Subject: [TF-M] Re: [EXTERNAL] Re: mbedtls_platform_setup/teardown in TF-M ?
Hi Antonio,
Thanks a lot for your answer !
Looking at the MbedTLS github link you sent (and the one therein)
- https://github.com/Mbed-TLS/mbedtls/issues/6228 PSA: separate driver initialization with a nicer fixed ordering
- https://github.com/Mbed-TLS/mbedtls/issues/6007 Define the PSA subsystem initialization interface in Mbed TLS
it seems that for the best would be indeed to provide feedback to the MbedTLS/PSA team such that TF-M could just run the adequate psa_* functions.
Thanks !
Rehan
Intrinsic ID
________________________________
From: Antonio De Angelis <Antonio.DeAngelis(a)arm.com<mailto:Antonio.DeAngelis@arm.com>>
Sent: Saturday, July 8, 2023 12:13 AM
To: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org> <tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>>; Rehan Malak <Rehan.Malak(a)intrinsic-id.com<mailto:Rehan.Malak@intrinsic-id.com>>
Subject: [EXTERNAL] Re: mbedtls_platform_setup/teardown in TF-M ?
Hi Rehan,
This looks like a non-PSA standardized feature specific to mbed TLS. We don't have any platform in TF-M that requires such setup/teardown so I can't comment from experience, but to me it looks like this would be an mbed TLS specific feature that needs to be hooked underneath the service and into the library. The most natural choice would be indeed to have them as part of the psa_crypto_init() and lower functions, but at this stage I think is not possible to implement this without patching the source code (i.e. there are no options to allow this at build time in TF-M, at least).
Note also that mbed TLS has a on open ongoing issue to better define the initialisation sequence for the various operations in psa_crypto_init(): PSA: separate driver initialization with a nicer fixed ordering · Issue #6228 · Mbed-TLS/mbedtls (github.com)<https://github.com/Mbed-TLS/mbedtls/issues/6228> It might be a good place to start to provide feedback regarding this particular aspect of custom platform initialisation if is not being considered there.
To conclude, if you want to propose a patch for TF-M to allow such functions to be plugged in (in the meantime that mbed TLS agrees on the long term course of action), I will be happy to review it.
Thanks,
Antonio
________________________________
From: Rehan Malak via TF-M <tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>>
Sent: Friday, July 7, 2023 13:15
To: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org> <tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>>
Subject: [TF-M] mbedtls_platform_setup/teardown in TF-M ?
Dear TF-M developers,
I am currently adapting a basic MbedTLS / PSA Crypto example such that it would run on the NS side with TF-M doing the crypto.
At the end, this is very similar to this psa_sign_verify_message_test from the NS crypto test suite :
https://git.trustedfirmware.org/TF-M/tf-m-tests.git/tree/test/secure_fw/sui…
But my build config of MbedTLS has MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT enabled because I have a custom mbedtls_platform_setup / mbedtls_platform_teardown.
And I can't see any place in TF-M where mbedtls_platform_setup/mbedtls_platform_teardown are called :
? -> mbedtls_platform_setup
? -> mbedtls_platform_teardown
At first, I tried to put this code into the psa_driver_wrapper_init/psa_driver_wrapper_free but I have a similar problem :
tfm_crypto_engine_init -> psa_crypto_init -> psa_driver_wrapper_init
? -> mbedtls_psa_crypto_free -> psa_driver_wrapper_free
Is there any cmake/Kconfig option or any C macros to hook TF-M initialization/shutdown with mbedtls_platform_setup/mbedtls_platform_teardown without patching TF-M ?
If not, could mbedtls_platform_setup be called here ? https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/secure_fw/…
or is there a nicer way of doing this ?
(btw, I am currently experimenting on qemu mps2-an521)
Thanks for any advice ! 🙂
Best regards,
Rehan MALAK
Intrinsic ID
Hello,
This is a question for integrators and packagers of Mbed TLS, especially
if you're integrating the library in some embedded OS or BSP.
To build, configure and test Mbed TLS, we use Python for several purposes:
* To configure the library with scripts/config.py, unless you use the
default configuration or write your own configuration from scratch.
* To generate some configuration-independent library source files, but
only if you use the development branch, not if you use a release or
an LTS branch.
* To generate some glue code for PSA drivers, if you use PSA drivers
and don't write the glue code by hand.
* To generate the unit test source files.
* (We have many more maintenance and test scripts but they're out of
scope here.)
(Python is not necessary, and will remain unnecessary, to configure and
build the library with a given set of hardware drivers, so that a
typical BSP will not have to depend on Python.)
For each of these purposes, how problematic is it if we require a recent
version of Python? We're currently planning to drop support for older
versions of Python as soon as they become unsupported upstream (so
officially dropping 3.8 now — although right now all scripts still work
on 3.5). This includes versions of Python that are still shipped in e.g.
Linux distributions that are themselves officially supported. Is there
demand for supporting older Python versions for some scripts?
Also, how problematic is it if some of these purposes require
third-party Python packages?
Best regards,
--
Gilles Peskine
Mbed TLS developer
Hi All,
A gentle reminder that the US-Europe timezone-friendly MBed TLS Tech forum
is next Monday at 4:30 PM UK time. Invite details can be found on the
online calendar here <https://www.trustedfirmware.org/meetings/>.
If you have any topics, please let Dave Rodgman know. :)
Best regards,
Don Harbin
TrustedFirmware Community Manager
don.harbin(a)linaro.org
FYI to all TF dev teams leveraging Open CI.
Best regards,
Don
---------- Forwarded message ---------
From: Glen Valante via Tf-openci-triage <
tf-openci-triage(a)lists.trustedfirmware.org>
Date: Fri, 23 Jun 2023 at 08:41
Subject: [Tf-openci-triage] FYI; Cambridge Lab Down
To: tf-openci-triage(a)lists.trustedfirmware.org <
tf-openci-triage(a)lists.trustedfirmware.org>
Hello All;
FYI; the Cambridge lab took a serious power hit and is down. They are
scrambling to get things back up, but it may take all weekend.
Expect LAVA failures and other strange results.
Thanks;
-g
--
[image: Linaro] <http://www.linaro.org>
Glen Valante | *Director Program & Project Management*
T: +1.508.517.3461 <1617-320-5000>
glen.valante(a)linaro.org | Skype: gvalante <callto:gvalante>
--
Tf-openci-triage mailing list -- tf-openci-triage(a)lists.trustedfirmware.org
To unsubscribe send an email to
tf-openci-triage-leave(a)lists.trustedfirmware.org
Dear sir/madam,
Hope you are doing good!
We are working on a lightweight TLS implementation for embedded hardware
and want to add our own algorithm inside mbedTLS. As per my knowledge, we
have to add a .h file in mbedtls/include/mbedtls and .c file in the
library. Also, we have to list our algorithm in library/CMakeLists.txt.
Except these, what should be the procedure?
Also, our task is during handshake, the receiver chooses our algorithm
instead of the default one for encryption and decryption. If someone could
help us regarding this then it would be great.
Thanks in advance.
Regards,
--
*Dr. Vishal J. Rathod*
*(Member - IEEE, ACM, IET)*
*Senior Project Engineer (SPE),*
*IoT R & D Group,*
*C-DAC, Electronic City,*
*Bengaluru, Karnataka, India.*
*Email ID: rathodvishal78(a)gmail.com <rathodvishal78(a)gmail.com> and *
vishalrathod(a)ieee.org
*Mobile - 9879957770*
Hi!
I am a new MbedTLS user and would like to say thanks to devs first!
From my point of view mbedtls_net_connect() could handle binding socket to a specified local client port.
Although it does not seem to be a common requirement and bloats API a little bit but otherwise user has to throw away mbedtls_net_connect()
and implement connection function by their hands.
Best,
Alex
Hi Ruchika,
as an addition to the previous answers, there is also the SecureMark-TLS benchmark from EEMBC that "Analyzes the costs associated with implementing TLS on an edge device using a common IoT cyphersuite comprised of ECC & ECDSA on the NIST secp256r1 curve, SHA256, and AES128-CCM/ECB", see: https://www.eembc.org/securemark/
It provides profiles to run benchmarks against Mbed TLS API, PSA Crypto API, and wolfSSL, see sources here: https://github.com/eembc/securemark-tls/tree/main/examples/selfhosted/profi…
The chosen cipher-suite is similar to the TF-M medium profile and it allows estimates of speed and power consumption for TLS on microcontrollers. It also allows to add - manually - footprint data.
Best
Stephan
From: Ruchika Gupta via psa-crypto <psa-crypto(a)lists.trustedfirmware.org>
Reply to: Ruchika Gupta <ruchika.gupta_1(a)nxp.com>
Date: Tuesday, 16 May 2023 at 13:40
To: "mbed-tls(a)lists.trustedfirmware.org" <mbed-tls(a)lists.trustedfirmware.org>, "psa-crypto(a)lists.trustedfirmware.org" <psa-crypto(a)lists.trustedfirmware.org>
Subject: [psa-crypto] Benchmark application for PSA crypto API's
Hi,
For mbedtls API’s, there is a benchmark application available. Are there any plans to implement benchmark application for PSA crypto APIs ?
Regards,
Ruchika
Hi,
For mbedtls API's, there is a benchmark application available. Are there any plans to implement benchmark application for PSA crypto APIs ?
Regards,
Ruchika
Hello,
In mbedLS v3.4.0, I came across a build error that there are no members for type and flag in psa_core_keyattributes_t structure.
The following functions in psa_crypto_core.h access private members type and flag of psa_core_keyattributes_t structure without the MBEDTLS_PRIBATE() private access.
* psa_is_key_slot_occupied()
* psa_key_slot_get_flags()
* psa_key_slot_set_flags()
* psa_key_slot_set_bits_in_flags()
* psa_key_slot_clear_bits()
Updating to private access for attribute struct members in psa_crypto_core.h fixed the build errors.
Regards,
Archanaa