Hi everyone, I think you all are fine.
I am a beginner on mbedtls, and I wanted to set a dhm context. So, at first, I just want to set the value of the prime P, and the generator G. So to that I wrote the function below : [cid:image001.png@01D67AF5.D43FDE60]
To check if it is correctly set, I wanted to print it to see. However, it is not the case. Do you know how to set and print the value ?
Thanks, and have a good day
Best regards, YS
Hello everybody, I hope you are going well
I am creating a diffie Hellman key exchange program, so I am using functions like « mbedtls_dhm_init() » or « mbedtls_ctr_drbg_init() « for example. However, even if I defined the CTR_DRBG & the DHM_C module in the config.h file, and the header in my C file, I Always have error like that :
[cid:image002.png@01D6770C.20370D40]
Can someone help me to find out where does it come from ? Because I don’t know at all.
Thanks, and have a good day
Hi all,
I am placing into review a patch (
https://github.com/ARMmbed/mbedtls/pull/3579) which replaces some
invalid size printf format specifiers, mostly for size_t. This patch
utilises %zu and %hhu, both of which were only introduced in C99, which
I know caused some issues with compiler compatibility at the time. The
problem with printf and size_t as most will know, is that its a
different size in 32 bit and 64 bit, which is what %z was introduced to
safely fix.
My question is to whether there is anyone on the list that is using a
compiler that might not handle these specifiers, for whom this patch
would presumably be something of an issue. I am admittedly hoping this
is not the case, given the age of the spec, but thought it best to ask.
Thanks in advance,
Paul.
Hi Murat
What you request may be possible with invasive changes but it is not a design goal for the PSA Cryptography API implementation in Mbed TLS to be completely replaced with an alternative implementation, while allowing re-use of the Mbed TLS build system and tests.
The focus instead is to develop and implement a PSA Cryptoprocessor Driver Interface, which will allow drivers for custom secure environments to be plugged into the core PSA Cryptography API implementation in Mbed TLS. An early version of the specification of that interface can be found here:
https://github.com/ARMmbed/mbedtls/blob/development/docs/proposed/psa-drive…
That specification and its implementation is under active development. Let us know if you would like to get involved.
Regards
Dan.
From: mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org> On Behalf Of Murat Cakmak via mbed-tls
Sent: 14 August 2020 13:34
To: mbed-tls(a)lists.trustedfirmware.org
Subject: [mbed-tls] Custom PSA API Implementation for mbedTLS tests
Hi all,
We have implemented the PSA Functional API for a custom secure environment which passes PSA Arch tests.
Now we would like to run mbedtls tests (make check) on the PSA API if possible.
When we run "make check", it includes and compiles library/psa_crypto.c file for mbedTLS's PSA API Implementation.
Herein, we would like to compile our own psa_crypto.c implementation, does mbedtls build system allow us to include custom PSA API Implementation to run tests?
Thank you.
Murat
Greetings,
I am new to the list, please do excuse me, in case of any list
specific etiquette issues.
Trying to use a 1.6.1 release with a Cortex M7 port, specifically a STM32H7.
After enabling MBEDTLS_ENTROPY_HARDWARE_ALT, did implement
mbedtls_hardware_poll()
It looks thus, and it does appear to work from a hardware perspective:
/**
* mbedtls_hardware_poll()
* Read random data from the Hardware RNG for entropy applications
*/
int mbedtls_hardware_poll(void *arg,
unsigned char *ent_buf,
size_t count,
size_t *ent_len)
{
register uint8_t i = 0;
uint32_t rand;
if (!LL_RNG_IsEnabled(RNG))
LL_RNG_Enable(RNG); /* Enable Random Number Generator */
for (i = 0; i < count; i++) {
while (!LL_RNG_IsActiveFlag_DRDY(RNG)) { } /* Wait for DRDY
flag to be raised */
if ((LL_RNG_IsActiveFlag_CECS(RNG)) ||
(LL_RNG_IsActiveFlag_SECS(RNG))) { /* Check error, if any */
/* Clock or Seed Error detected. Set Error */
printf(" (%d) %s: Clock/Seed Error!\r\n", __LINE__, __FUNCTION__);
}
rand = LL_RNG_ReadRandData32(RNG); /* Read RNG data */
memcpy(&(ent_buf[i * 4]), &rand, 4); /* *ent_len += 4 */
}
LL_RNG_Disable(RNG); /* Stop random numbers generation */
*ent_len = ((i + 1) * 4);
printf(" (%d) %s: Random Words: %d Word: %04d\r\n",
__LINE__,
__FUNCTION__,
count,
rand);
return 0;
}
The code which causes the problem is this, in my tls_init()
int tls_init(void)
{
int ret;
/* inspired by https://tls.mbed.org/kb/how-to/mbedtls-tutorial */
const char *pers = "SYS-LWH7";
printf(" (%d) %s: Initializing\r\n", __LINE__, __FUNCTION__);
/* initialize descriptors */
mbedtls_ssl_init(&ssl);
printf(" (%d) %s: SSL initialize\r\n", __LINE__, __FUNCTION__);
mbedtls_ssl_config_init(&conf);
printf(" (%d) %s: SSL Config initialized\r\n", __LINE__, __FUNCTION__);
mbedtls_x509_crt_init(&cacert);
printf(" (%d) %s: x509 CRT initialized\r\n", __LINE__, __FUNCTION__);
mbedtls_ctr_drbg_init(&ctr_drbg);
printf(" (%d) %s: DRBG initialized\r\n", __LINE__, __FUNCTION__);
mbedtls_entropy_init(&entropy);
printf(" (%d) %s: Entropy initialized\r\n", __LINE__, __FUNCTION__);
ret = mbedtls_ctr_drbg_seed(&ctr_drbg,
mbedtls_entropy_func,
&entropy,
(const unsigned char *) pers,
strlen(pers));
if (ret) {
LWIP_DEBUGF(MQTT_APP_DEBUG_TRACE,
("failed !\n mbedtls_ctr_drbg_seed returned %d\n",
ret));
printf(" (%d) %s: DRBG seed failed, ret=%d\r\n", __LINE__,
__FUNCTION__, ret);
return -1;
}
printf(" (%d) %s: DRBG seed returned:%d\r\n", __LINE__, __FUNCTION__, ret);
/**
* The transport type determines if we are using
* TLS (MBEDTLS_SSL_TRANSPORT_STREAM) or
* DTLS (MBEDTLS_SSL_TRANSPORT_DATAGRAM).
*/
ret = mbedtls_ssl_config_defaults(&conf,
MBEDTLS_SSL_IS_CLIENT,
MBEDTLS_SSL_TRANSPORT_STREAM,
MBEDTLS_SSL_PRESET_DEFAULT);
if (ret) {
LWIP_DEBUGF(MQTT_APP_DEBUG_TRACE,
("failed !\n mbedtls_ssl_config_defaults returned %d\n\n",
ret));
printf("(%d) %s: SSL config defaults failed, ret=%d\r\n",
__LINE__, __FUNCTION__, ret);
return -1;
}
printf("(%d) %s: SSL config defaults returned:%d\r\n", __LINE__,
__FUNCTION__, ret);
ret = mbedtls_x509_crt_parse(&cacert,
(const unsigned char *)test_ca_crt,
test_ca_crt_len);
if (ret)
printf(" (%d) %s: failed!\n mbedtls_x509_crt_parse returned
%d\r\n", __LINE__, __FUNCTION__, ret);
else
printf(" (%d) %s: mbedtls_x509_crt_parse returned %d\r\n",
__LINE__, __FUNCTION__, ret);
mbedtls_ssl_conf_ca_chain(&conf, &cacert, NULL);
mbedtls_ssl_conf_authmode(&conf, MBEDTLS_SSL_VERIFY_REQUIRED);
/**
* The library needs to know which random engine
* to use and which debug function to use as callback.
*/
mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);
mbedtls_ssl_conf_dbg(&conf, my_debug, stdout);
mbedtls_ssl_setup(&ssl, &conf);
}
The output of which looks thus, in a serial terminal:
(1217) print_dhcp_state: Try connect to Broker
(174) tls_init: Initializing
(178) tls_init: SSL initialize
(181) tls_init: SSL Config initialized
(184) tls_init: x509 CRT initialized
(187) tls_init: DRBG initialized
(190) tls_init: Entropy initialized
(1027) mbedtls_hardware_poll: Random Words: 128 Word: -558876895
Any thoughts/ideas, what could be wrong ?
Any kind soul in here ?
Thanks,
Manu
Hi Simon,
Indeed while the migration is underway things can be a bit confusing, so let me try to clarify:
* releases can be found at: https://github.com/ARMmbed/mbedtls/releases - near the top you'll alwys find the latest development release followed by the latest LTS releases. At this point it is unclear if releases are going to stay on github or if they would move to trustedfrimware.org in the future, but if anything changes, we'll announce it.
* announcements about new releases and other important project events are made on the new Mbed-tls-announce mailing-list: https://github.com/ARMmbed/mbedtls/releases - if you're already subscribed to mbed-tls (this list), you don't need to subscribe to the "announce" mailing list in addition, as any post to "announce" is automatically cross-posted here ("announce" is for people who want a lower volume list).
* I don't think we're currently making announcements about upcoming releases, but I know we considered that. Unfortunately I don't remember the details and the colleague who was working on improving our release process is on leave now. But it we start making such announcements, they'll be on the "announce" list.
* We're currently planning 2.16.8 early in September.
* If you have a large number of products deployed that depend on Mbed TLS (or indeed any other tf.org project) and would like to be notified in advance of upcoming security fixes, please see the following pages: https://developer.trustedfirmware.org/w/mbed-tls/security-center/https://developer.trustedfirmware.org/w/collaboration/security_center/repor…https://developer.trustedfirmware.org/w/collaboration/security_center/trust…
I hope this answers your questions, and feel free to ask otherwise.
Manuel.
________________________________
From: mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org> on behalf of Simon Leet via mbed-tls <mbed-tls(a)lists.trustedfirmware.org>
Sent: 14 August 2020 15:13
To: mbed-tls(a)lists.trustedfirmware.org <mbed-tls(a)lists.trustedfirmware.org>
Subject: [mbed-tls] LTS roadmap and announcement channel?
Hi folks,
I understand that https://tls.mbed.org/ has migrated under the umbrella of https://www.trustedfirmware.org/ but it’s not clear where I should turn to for information about the updates to the LTS versions. The https://tls.mbed.org/tech-updates blog used to announce LTS branch updates but seems defunct as of 2.16.7, and I can’t find equivalent information in https://developer.trustedfirmware.org/w/mbed-tls/roadmap/, https://github.com/ARMmbed/mbedtls/projects/2 or the generic https://www.trustedfirmware.org/blog/.
Is there a new channel for information about upcoming LTS mbedtls releases so that users can plan their appropriate upgrade cycles? E.g. when is 2.16.8 roughly expected to be released? Is the new model for monitoring release announcements reliably going to be as a new tag on https://github.com/ARMmbed/mbedtls/tags?
-Simon
Hi everyone,
Hope you are still going well
I am now working on MbedTLS to establish a key exchange with a BGM which has a TRNG
, and I read that I have to implement myself a function called «mbedTLS_hardware_poll »
But I have no idea to know how I can implement this function zlthough I read articles on the mbedtls.com about entropy site…. Can you help me, to know how I can implement this function ?
Hi all,
We have implemented the PSA Functional API for a custom secure environment
which passes PSA Arch tests.
Now we would like to run mbedtls tests (make check) on the PSA API if
possible.
When we run "make check", it includes and compiles library/psa_crypto.c file
for mbedTLS's PSA API Implementation.
Herein, we would like to compile our own psa_crypto.c implementation, does
mbedtls build system allow us to include custom PSA API Implementation to
run tests?
Thank you.
Murat
Hello,
The interface of the Diffie-Hellman (DHM) module is modeled on the way
it's used in TLS, which is a bit different from the classical
presentation. You can find code examples in programs/pkey/dh_client.c
and programs/pkey/dh_server.c .
Elliptic-curve Diffie-Hellman (provided by the ECDH module) has similar
security properties and is significantly faster. If you don't need
interoperability with legacy software that only supports classical
(finite-field) Diffie-Hellman, you should use ECDH rather than DHM. With
the ECDH module, you can use either the same TLS-inspired interface as
the DHM module, or a more classical interface for which there is a usage
example in psa_crypto.c in the function psa_key_agreement_ecdh.
Hope this helps,
--
Gilles Peskine
Mbed TLS developer
You can find an example of the TLS-like inter
On 12/08/2020 14:02, youssouf sokhona via mbed-tls wrote:
>
> Hello, I hope you are going well during this Covid crisis.
>
>
>
> I'm sending you this message to find out how to generate a Diffie
> Hellman key using MbedTLS. Indeed, with all the documentation, I'm a
> bit lost.
>
>
>
> I think, you have to use the int mbedtls_dhm_set_group function to
> create p and g. And then, I don't know how to use which function...
> Moreover, I can't find any function that allows to set a and b,
> whereas they are 2 fundamental elements
>
> Can you help me? Thank you!
>
>
>
> Best regards, YS
>
>
>
Hello,
Short version: to use the official tools to configure Mbed TLS, or to
run the unit tests, you need Python. If we start requiring Python 3.5,
is this going to be a problem?
Detailed version:
Mbed TLS includes four Python scripts that are of interest to users,
with a fifth one in preparation:
* scripts/config.py : compile-time configuration (unless you prefer to
edit config.h directly).
* scripts/generate_psa_constants.py : to build
programs/psa/psa_constant_names (we have a pending task to commit the
result instead of requiring it during the build).
* tests/scripts/generate_test_code.py : necessary to build the unit tests.
* tests/scripts/mbedtls_test.py : does anyone use this? It's for testing
on platforms with Greentea, but some of the automation is missing.
* upcoming: a script to generate glue code for accelerator and secure
element drivers. We'll also provide a manual way, but it won't be as
convenient.
This is a question to everyone who's building Mbed TLS and using some of
these scripts: is it ok if they require Python 3.5?
Currently:
* scripts/config.py requires Python 3.5.
* scripts/generate_psa_constants.py requires Python 3.3.
* tests/scripts/generate_test_code.py still works with Python 2.7.
* tests/scripts/mbedtls_test.py still works with Python 2.7.
* the driver glue code generation script will require Python 3.5, or
Python 3.4 + typing.
Is there any demand for versions of Python before 3.5?
--
Gilles Peskine
Mbed TLS developer
Hello, I hope you are going well during this Covid crisis.
I'm sending you this message to find out how to generate a Diffie Hellman key using MbedTLS. Indeed, with all the documentation, I'm a bit lost.
I think, you have to use the int mbedtls_dhm_set_group function to create p and g. And then, I don't know how to use which function... Moreover, I can't find any function that allows to set a and b, whereas they are 2 fundamental elements
Can you help me? Thank you!
Best regards, YS
Hi Frank,
We have now updated the links both on the download-archive and releases site and now they point to https://github.com/ARMmbed/mbedtls/releases, where all the releases are available.
We also have added checksums to the release notes on github and fixed the archive structure.
Thank you very much for pointing these issues out!
Cheers,
Janos
(Mbed TLS developer)
On 04/08/2020, 19:06, "mbed-tls on behalf of Frank Bergmann via mbed-tls" <mbed-tls-bounces(a)lists.trustedfirmware.org on behalf of mbed-tls(a)lists.trustedfirmware.org> wrote:
Hi,
2.16.7 was released on github more than one month ago (2020-07-01).
But it is not listed on
- download archive at https://tls.mbed.org/download-archive
- release news at https://tls.mbed.org/tech-updates/releases
Questions about that:
- Is it an "official" release even if it is not mentioned on release news?
- When will it be available in download archive?
- If there will be no more addings to download archive because now we'll
have to use github:
* Will there be separate releases GPL/Apache available?
* Will a signed/unsigned check sum be provided?
* Will the "new structure" as provided by tarball on github be kept
in future or was it just an accident? (e.g. main dir is named
"mbedtls-mbedtls-2.16.7")
I started using mbed TLS with 2.16.6 but now I am confused. ;-)
cheers,
Frank
--
mbed-tls mailing list
mbed-tls(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/mbed-tls
Hi Frank,
I confirm that 2.16.7 is an official release of the 2.16 long-time
support branch of Mbed TLS, alongside 2.7.16 for the 2.7 branch and
2.23.0 for the latest features. Everyone should update to one of these
versions since they fix security issues and other bugs.
We're progressively transitioning the project from Arm infrastructure to
TrustedFirmware infrastructure. Eventually we'll decommission the
existing tls.mbed.org, and we intend to distribute releases via
trustedfirmware.org. We no longer intend to reference new releases
directly on https://tls.mbed.org/download-archive . For the time being,
we're distributing via GitHub. However, it isn't right that
https://tls.mbed.org/download-archive links to
https://github.com/ARMmbed/mbedtls/releases/ which doesn't list LTS
branches. We need to link from https://tls.mbed.org/download-archive to
the place that has the latest LTS releases one way or the other.
There are no longer separate archives with Apache and GPL licenses.
These archives were always identical except for license headers. Now LTS
releases are distributed as a single archive in which the files are
dual-licensed.
The naming with mbedtls-mbedtls- must be a bug in our release script.
Thanks for noticing.
I don't think we made a conscious decision not to provide official
checksums. I can see the value of having them so let's try to
incorporate those in our new release process.
--
Gilles Peskine
Mbed TLS developer
On 04/08/2020 19:05, Frank Bergmann via mbed-tls wrote:
> Hi,
>
> 2.16.7 was released on github more than one month ago (2020-07-01).
> But it is not listed on
> - download archive at https://tls.mbed.org/download-archive
> - release news at https://tls.mbed.org/tech-updates/releases
>
> Questions about that:
> - Is it an "official" release even if it is not mentioned on release news?
> - When will it be available in download archive?
> - If there will be no more addings to download archive because now we'll
> have to use github:
> * Will there be separate releases GPL/Apache available?
> * Will a signed/unsigned check sum be provided?
> * Will the "new structure" as provided by tarball on github be kept
> in future or was it just an accident? (e.g. main dir is named
> "mbedtls-mbedtls-2.16.7")
>
> I started using mbed TLS with 2.16.6 but now I am confused. ;-)
>
> cheers,
> Frank
>
>
Hi,
2.16.7 was released on github more than one month ago (2020-07-01).
But it is not listed on
- download archive at https://tls.mbed.org/download-archive
- release news at https://tls.mbed.org/tech-updates/releases
Questions about that:
- Is it an "official" release even if it is not mentioned on release news?
- When will it be available in download archive?
- If there will be no more addings to download archive because now we'll
have to use github:
* Will there be separate releases GPL/Apache available?
* Will a signed/unsigned check sum be provided?
* Will the "new structure" as provided by tarball on github be kept
in future or was it just an accident? (e.g. main dir is named
"mbedtls-mbedtls-2.16.7")
I started using mbed TLS with 2.16.6 but now I am confused. ;-)
cheers,
Frank
Hi Youssouf,
This is Steven with Silicon Labs. It sounds like you have questions that are very device-specific, and relate to Silicon Labs products. We do provide TRNG drivers for mbed TLS through Simplicity Studio and our software SDK. Please contact our support staff at www.silabs.com/support<http://www.silabs.com/support>, and they’ll do their best to help you out with your questions.
Regards,
-- Steven
From: mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org> on behalf of youssouf sokhona via mbed-tls <mbed-tls(a)lists.trustedfirmware.org>
Reply to: youssouf sokhona <youssouf.sokhona(a)hotmail.fr>
Date: Tuesday, 4 August 2020 at 12:59
To: "mbed-tls(a)lists.trustedfirmware.org" <mbed-tls(a)lists.trustedfirmware.org>
Subject: [mbed-tls] Entropy & TRNG on the BGM13P32
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hi, everyone,
First of all, I hope you are all healthy during this difficult time.
I am working with Simplicity Studio IDE with MbedTLS and I am currently working on a project with a BGM13P32. I plan to perform a key exchange via bluetooth with the Diffie Hellman protocol. To start my project, I need an entropy source. I read the following on the BGM13P32 documentation "The TRNG is a non-deterministic random number generator based on a full hardware solution. The TRNG is validated with NIST800-22and AIS-31 test suites as well as being suitable for FIPS 140-2 certification (for the purposes of cryptographic key generation)."
And I also read about the Random Number Generator "The Frame Controller (FRC) implements a random number generator that uses entropy gathered from noise in the RF receive chain.The data is suitable for use in cryptographic applications.Output from the random number generator can be used either directly or as a seed or entropy source for software-based random num-ber generator algorithms such as Fortuna"
Knowing this, how can we use this to create entropy and then create a sequence of random numbers? I need to implement the MbedTLS_hardware_poll() function? Do I have to add another entropy, like real timing for example
As you can see I am a bit confused actually. Can you help me out?
Thanks in advance, and take care of yourself !
Hi, everyone,
First of all, I hope you are all healthy during this difficult time.
I am working with Simplicity Studio IDE with MbedTLS and I am currently working on a project with a BGM13P32. I plan to perform a key exchange via bluetooth with the Diffie Hellman protocol. To start my project, I need an entropy source. I read the following on the BGM13P32 documentation "The TRNG is a non-deterministic random number generator based on a full hardware solution. The TRNG is validated with NIST800-22and AIS-31 test suites as well as being suitable for FIPS 140-2 certification (for the purposes of cryptographic key generation)."
And I also read about the Random Number Generator "The Frame Controller (FRC) implements a random number generator that uses entropy gathered from noise in the RF receive chain.The data is suitable for use in cryptographic applications.Output from the random number generator can be used either directly or as a seed or entropy source for software-based random num-ber generator algorithms such as Fortuna"
Knowing this, how can we use this to create entropy and then create a sequence of random numbers? I need to implement the MbedTLS_hardware_poll() function? Do I have to add another entropy, like real timing for example
As you can see I am a bit confused actually. Can you help me out?
Thanks in advance, and take care of yourself !
Morning,
First of all, I hope you are all healthy during this difficult time.
I am working with Simplicity Studio IDE and with Mbed TLS and I am currently working on a project with a BGM13P32. I plan to write in a file some parameters that will allow a key exchange by bluetooth (Diffie Hellman Protocol). I intend to make the BGM13P32 read this file, and these data to allow a key exchange. Is it possible to do that? If yes, how?
Because I'm a total beginner
Thank you, and take care of yourself !
Hi all,
I have configured the max fragment length at the client and server to both 512. With this setting when I try to reconnect using a saved session at the client side, the ssl handshake doesn’t seem to happen.
Below is the comment in the server code.
/* We don't support fragmentation of ClientHello (yet?) */
The mbedtls code I am using is version 2.16.6. Are there any plans to support fragmentation of clienthello? Do let me know
Regards,
Fariya
Hi,
I do not quite have enough knowledge on DTLS session resumption .. nevertheless here's my question:
a) Difference between the features: MBEDTLS_SSL_COOKIE_C and MBEDTLS_SSL_SESSION_TICKETS?
b) Enabling the feature MBEDTLS_SSL_SESSION_TICKETS would be sufficient to resume an earlier established DTLS session quickly (i.e avoid the whole TLS handshake done the last time)?
c) How do I test this - i.e initiate connection from client and server, break the connection and then make the client connect to the server again? Not sure what additional steps are required on client side. Any callbacks to be registered in the code?
Regards,
Fariya
Hi Gilles,
I checked one you recommended and looks like it is very complicated.
Do you have any sample project(SSH client) based on MbedTLS+LWIP?
Thanks,
Christie
-----Original Message-----
From: mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org> On Behalf Of mbed-tls-request(a)lists.trustedfirmware.org
Sent: July-22-20 11:35 AM
To: mbed-tls(a)lists.trustedfirmware.org
Subject: mbed-tls Digest, Vol 5, Issue 15
Send mbed-tls mailing list submissions to
mbed-tls(a)lists.trustedfirmware.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.trustedfirmware.org/mailman/listinfo/mbed-tls
or, via email, send a message with subject or body 'help' to
mbed-tls-request(a)lists.trustedfirmware.org
You can reach the person managing the list at
mbed-tls-owner(a)lists.trustedfirmware.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of mbed-tls digest..."
Today's Topics:
1. Problem with decrypt aes 128 in ecb mode. HELP ME!
(dany_banik2000(a)yahoo.com)
2. Re: SSH client sample (Gilles Peskine)
3. Re: patches for low memory (Gilles Peskine)
----------------------------------------------------------------------
Message: 1
Date: Wed, 22 Jul 2020 14:42:33 +0000 (UTC)
From: "dany_banik2000(a)yahoo.com" <dany_banik2000(a)yahoo.com>
To: mbed-tls(a)lists.trustedfirmware.org
Subject: [mbed-tls] Problem with decrypt aes 128 in ecb mode. HELP ME!
Message-ID: <1371131400.5486983.1595428953399(a)mail.yahoo.com>
Content-Type: text/plain; charset="utf-8"
I developed a server application that obtains the data from a dht11 sensor, I encrypt it with aes 128 and publish it on the server. The client application makes a request to the server, and I would like to decrypt the answer.
When I want to display decrypted message, it shows garbage
The message retrieved from the server is in hex. I think that must to convert hex in binary, but i don’t know how can do it…
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.trustedfirmware.org/pipermail/mbed-tls/attachments/20200722/a5…>
------------------------------
Message: 2
Date: Wed, 22 Jul 2020 17:10:18 +0200
From: Gilles Peskine <gilles.peskine(a)arm.com>
To: mbed-tls(a)lists.trustedfirmware.org
Subject: Re: [mbed-tls] SSH client sample
Message-ID: <4a7265ac-7b3e-33ef-7222-4cd29c3cda08(a)arm.com>
Content-Type: text/plain; charset=windows-1252
Hi Christie,
Libssh2 (https://github.com/libssh2/libssh2) supports Mbed TLS.
I've never used it or investigated it, so I can't vouch for it, I just know that it's there.
--
Gilles Peskine
Mbed TLS developer
On 21/07/2020 18:40, Christie Su via mbed-tls wrote:
>
> Hi,
>
> �
>
> I am using FRDM-K64F with LWIP+mbedTLS for our control system. Now, I
> want to develop the SSH client(or telnet 22) to access my SSH server.
>
> �
>
> Could you give me some indications how to do it? Or do you have any
> sample project?
>
> �
>
> Thanks,
>
> �
>
> Christie
>
>
------------------------------
Message: 3
Date: Wed, 22 Jul 2020 17:34:44 +0200
From: Gilles Peskine <gilles.peskine(a)arm.com>
To: mbed-tls(a)lists.trustedfirmware.org
Subject: Re: [mbed-tls] patches for low memory
Message-ID: <152f6571-6972-8262-c38d-d200dcc7c0b7(a)arm.com>
Content-Type: text/plain; charset=utf-8
Hi Nick,
A TLS stack in 6kB of RAM sounds impressive, congratulations!
We'd certainly be interested in all the improvements you can contribute.
The process is documented in CONTRIBUTING.md (https://github.com/ARMmbed/mbedtls/blob/development/CONTRIBUTING.md). I just need to warn you that the limiting factor is reviewers' time. For a significant contribution, it may take a while before the Mbed TLS team can look at it in detail. Small patches are usually easier than large
ones: if something only takes half an hour to review, someone will probably do it when they're stuck on some other task. If a review takes several days, it needs to be scheduled.
It would probably be better to discuss the general nature of the changes on this mailing list first. Is a new compilation option needed? Is an API change needed? What is the risk that the change might break existing code? How is the new code tested? etc.
Which version of Mbed TLS have you been using? We've made a few changes that are of interest to low-memory platforms recently, such as the option MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH to resize SSL buffers after the handshake (new in 2.22).
I don't know what the issue with the incoming SSL packet header length could be. If you could give precise steps to reproduce the issue, this would be very helpful. Eventually we'd want to construct a test in tests/ssl-opt.sh for this.
--
Gilles Peskine
Mbed TLS developer
On 17/07/2020 21:00, Nick Setzer via mbed-tls wrote:
>
> Hi, I have been working with Mbed TLS for the last 6 months in an
> extremely low memory use case. This library has been an absolute joy
> to work with because of how flexible it is. I have an interesting use
> case with how little RAM I have to work with (around 6kb on one
> microprocessor) and I have made some changes that I thought would be
> of interest. I'm not sure if I should submit them as a single
> changeset or a set of changes. I'll describe the changes and if there
> is interest I can clean them up for submission.
>
> The first change that I made was for a scenario with two
> microprocessors communicating over a UART. I was already using TLS
> offloading so that the private key was on one processor (with only 6kb
> of RAM free) and the SSL context stored on the other. I required
> generating a CSR and thus made some changes to the CSR code to be able
> to generate the CSR using a similar private key offloading strategy.
>
> I found an issue with downloading firmware for OTA from openssl web
> servers. This is a little tricky to describe. The server was not
> responsive to requests for reducing the max fragment length, which
> forced me to use MBEDTLS_SSL_MAX_CONTENT_LEN set to 16384. But I
> needed to have multiple ssl sessions open for other activities and did
> not have enough RAM to hold multiple large buffers. I have made a set
> of changes to allow setting the content length when the ssl context is
> initialized, as well as setting different IN and OUT content lengths
> to save memory. This change allowed me to set up one session with 16kb
> for the IN content length, and then 4kb for OUT content length, while
> a second session could use 2kb for a total of 24kb instead of 64kb.
>
> Related to the openssl issue, I found that the incoming ssl packet
> header length can sometimes be 8 or 16 bytes larger than expected
> depending on which AES method is selected. I'm not actually sure what
> the best way to solve this is. One way may be to change
> MBEDTLS_SSL_HEADER_LEN from 13 to 29 bytes. However I ended up solving
> it by adding 16 to both MBEDTLS_SSL_IN_BUFFER_LEN and
> MBEDTLS_SSL_OUT_BUFFER_LEN. This way I could handle the larger ssl
> header as well as receive the content body.
>
> If these three changes sound interesting I can start work on cleaning
> up the code to be less specific to my company and then submit the
> changes. Also I would like to know if there is any process I should be
> following when submitting these changes.
>
> Thanks,
>
> Nick Setzer
> SimpliSafe, Inc.
> 294 Washington Street, 9th Floor
> Boston, MA 02108
>
------------------------------
Subject: Digest Footer
mbed-tls mailing list
mbed-tls(a)lists.trustedfirmware.org
https://lists.trustedfirmware.org/mailman/listinfo/mbed-tls
------------------------------
End of mbed-tls Digest, Vol 5, Issue 15
***************************************
On 20/07/2020 12:21, Scott Branden via mbed-tls wrote:
> Although this particular change doesn't affect me - rewriting history is a
> bad idea.
>
> Why not simply commit a revert back to a cleaner point on "master" branch
> and then commit the new changes you want from there?
>
> Then history is not lost on master branch.
Mbed TLS used to follow the Git Flow model: day-to-day work happens on
the 'development' branch, and there's a 'master' branch which always
points to the latest commit on master that's a tagged release. A release
is done by tagging a commit on 'development' and fast-forwarding
'master' to it.
But after the 2.16 LTS release, we made 'master' follow the 2.16 LTS
branch rather than 'development'. I think this was a mistake, but it's
too late to change this, the question is what we do now with the
existing situation.
A force-push on 'master' would not erase history from the face of the
world. The history is still there in 'mbedtls-2.16'.
It is no longer possible to fast-forward 'master' to any commit on
'development'. No amount of revert or merge commits on 'master' will
make it be the same commit as some a release made from 'development'.
Without a force-push, all we can hope is to have 'master' have the same
content as a release. This means that getting the same release would
give you the same content, but different history, depending on whether
tyou get it from 'master' or 'development'. This would also mean a more
complicated release process.
Another solution would be to do a merge of 'master' into 'development',
ignoring all changes from the 'master' side. But this would mess up the
history on 'development'.
Is this more complicated release process, or this messy history, worth
it, just to avoid a force-push?
> Or, with the BLM movement some repos are stopping use of master branch.
> github seems to be encourage it going forware:
> https://www.zdnet.com/article/github-to-replace-master-with-alternative-ter…
>
> So another option: stop using "master" branch. You could even create a
> tag/rename and then delete the branch name to avoid any confusions. History
> won't be rewritten then, just a little "hidden".
> And start using a new "main" branch. You can push you entire commit series
> there without revering anything on master branch.
Sure, we can create a new branch name. But then we'd still have to keep
a branch with the old name, for the sake of existing setups that pull
from 'master'. Or else we should make a commit on 'master' that removes
every file and instead adds a README that says "pull from 'main' instead".
--
Gilles Peskine
Mbed TLS developer
On 22/07/2020 17:35, Gilles Peskine via mbed-tls wrote:
> I just need to warn you that the limiting factor is reviewers' time. For a
> significant contribution, it may take a while before the Mbed TLS team
> can look at it in detail. Small patches are usually easier than large
> ones: if something only takes half an hour to review, someone will
> probably do it when they're stuck on some other task. If a review takes
> several days, it needs to be scheduled.
As an aside, Mbed TLS is under the governance of TrustedFirmware.
Currently, only Arm employees are consider trusted reviewers, but this
is not by policy, it's only due to the history of the project (until a
few months ago, Mbed TLS was governed by Arm). We (as in, the Arm
employees working on Mbed TLS) welcome design and code reviews from
everyone.
We don't yet have a formal process for becoming a “trusted” reviewer,
beyond the general principles of TrustedFirmware. But a required part of
that process will undoubtedly be to have done some reviews before.
As every project, there is an informal, unwritten culture. If there's
interest, we can try to document our review culture in writing. If I had
to sum it up in one sentence, I'd say that if a reviewer should reject
code that they don't understand: it's the job of the patch author to
convince reviewers that the patch is good. “I don't see anything wrong”
is not a good enough standard.
--
Gilles Peskine
Mbed TLS developer