Hello Guys!
AFter a week of debugging yesterday I was able to solve the issues on my
PR, but the ABI-API failure is still on. I was told that based on my
changes it is OK, I should not worry.
Does this mean that my PR is ready for review or it should have disappeared
by now? In the second case could someone provide me the jenkins reports and
some idea where should I start searching?
This is my PR:
https://github.com/ARMmbed/mbedtls/pull/4161
Thank you in advance!
BR,
Gábor
Helló János!
Yes I tried that one (and plenty of other stuff). Finally I just reset the
branch and recommited the changes solving this particular issue.
Unfortunately I had to create a new PR, because git did not let me reopen
it, but that is another topic.
Thank you for the help!
BR,
Gábor
Janos Follath <Janos.Follath(a)arm.com> ezt írta (időpont: 2021. febr. 22.,
H, 13:17):
> Hi Gábor,
>
>
>
> Have you tried running `git commit --amend` (without --no-edit --signoff)
> and adding the “Signed-off-by: toth92g <toth92g(a)gmail.com>" line by hand?
>
>
>
> Best regards,
>
> Janos
>
>
>
> *From: *Gábor Tóth <toth92g(a)gmail.com>
> *Date: *Monday, 22 February 2021 at 11:44
> *To: *Janos Follath <Janos.Follath(a)arm.com>
> *Subject: *Re: [mbed-tls] Failing signoff (DCO) on:
> https://github.com/ARMmbed/mbedtls/pull/4140
>
> Helló János!
>
>
>
> Yes, I know which one, but I do not know how to change the commit message
> in git. I have used the provided commands (amend), but it did not correct
> the error.
>
>
>
> Do you know how to change it manually?
>
>
>
> BR,
>
> Gábor
>
>
>
> Janos Follath <Janos.Follath(a)arm.com> ezt írta (időpont: 2021. febr. 22.,
> H, 12:38):
>
> Hi Gábor,
>
>
>
> If you click on the “details” link on the DCO check it will tell you which
> commits are missing the sign-off:
>
> https://github.com/ARMmbed/mbedtls/pull/4140/checks?check_run_id=1950600200
>
>
>
> In this case you have one commit that is not signed off:
>
>
> https://github.com/ARMmbed/mbedtls/pull/4140/commits/fdd3c65ee47ab80f69cfa4…
>
>
>
> Best regards,
>
> Janos
>
>
>
> *From: *mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org> on behalf
> of Gábor Tóth via mbed-tls <mbed-tls(a)lists.trustedfirmware.org>
> *Date: *Monday, 22 February 2021 at 11:05
> *To: *mbed-tls(a)lists.trustedfirmware.org <
> mbed-tls(a)lists.trustedfirmware.org>
> *Subject: *[mbed-tls] Failing signoff (DCO) on:
> https://github.com/ARMmbed/mbedtls/pull/4140
>
> Hello Guys!
>
>
>
> I know it is a newbie question, but I am not able to pass this freaking
> DCO test...I have used the provided commands to signoff all the commits and
> as I see all of them has signoff, but it still failes on one. Do you have
> any idea what's wrong or how could I correct it?
>
>
>
> Till now I was able to correct it, but now it seems to be bugged.
>
>
>
> Thank you!
>
>
>
> BR?
> Gábor
>
> 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 Gábor,
If you click on the “details” link on the DCO check it will tell you which commits are missing the sign-off:
https://github.com/ARMmbed/mbedtls/pull/4140/checks?check_run_id=1950600200
In this case you have one commit that is not signed off:
https://github.com/ARMmbed/mbedtls/pull/4140/commits/fdd3c65ee47ab80f69cfa4…
Best regards,
Janos
From: mbed-tls <mbed-tls-bounces(a)lists.trustedfirmware.org> on behalf of Gábor Tóth via mbed-tls <mbed-tls(a)lists.trustedfirmware.org>
Date: Monday, 22 February 2021 at 11:05
To: mbed-tls(a)lists.trustedfirmware.org <mbed-tls(a)lists.trustedfirmware.org>
Subject: [mbed-tls] Failing signoff (DCO) on: https://github.com/ARMmbed/mbedtls/pull/4140
Hello Guys!
I know it is a newbie question, but I am not able to pass this freaking DCO test...I have used the provided commands to signoff all the commits and as I see all of them has signoff, but it still failes on one. Do you have any idea what's wrong or how could I correct it?
Till now I was able to correct it, but now it seems to be bugged.
Thank you!
BR?
Gábor
Hello Guys!
I know it is a newbie question, but I am not able to pass this freaking DCO
test...I have used the provided commands to signoff all the commits and as
I see all of them has signoff, but it still failes on one. Do you have any
idea what's wrong or how could I correct it?
Till now I was able to correct it, but now it seems to be bugged.
Thank you!
BR?
Gábor
Hi Gilles,
thank you for your detailled answer.
Honestly I was in fear that your answer would look like this. ;-)
Do you maybe know of any plans of any software project to use mbed TLS
together with a secure element?
I asked SoftHSM because it looks much promising for our goals but they
answered that they don't have any plans to use different ssl libs.
cheers,
Frank
On 08.02.21 23:07, Gilles Peskine via mbed-tls wrote:
> Hi Frank,
>
> Support for HSM keys in Mbed TLS is a work in progress. The way it will
> work eventually is by plugging an HSM driver under the PSA crypto API,
> which supports both transparent and opaque keys.
>
> The TLS code can already use the PSA crypto API for some things,
> including client signature. Enable MBEDTLS_USE_PSA_CRYPTO, call
> mbedtls_pk_setup_opaque() to create a PK object for the key, and declare
> the key to the TLS code with mbedtls_ssl_conf_own_cert() as usual.
>
> To create the key, you will need to write a PKCS#11 secure element
> driver. ("Secure element" = "HSM" for this purpose.) I think it would
> make sense to have one in Mbed TLS, but I don't know when we might get
> around to writing one.
>
> There are two secure element driver interfaces in Mbed TLS right now:
> MBEDTLS_PSA_CRYPTO_SE_C (dynamic secure element interface) and
> MBEDTLS_PSA_CRYPTO_DRIVERS (unified driver interface). Both are still
> experimental: we can't guarantee API stability at this stage.
> MBEDTLS_PSA_CRYPTO_SE_C was the first proposal, and its development is
> currently frozen and may be abandonned, so I don't recommend investing
> any effort in it at the moment, but if you need something fast (e.g. for
> a demo/proof-of-concept), it's your best bet. MBEDTLS_PSA_CRYPTO_DRIVERS
> is the way of the future, but it's an active work in progress.
>
> If you're creating the key from your application, just call
> psa_generate_key. If the key was provisioned externally, it's
> unfortunately not so easy. With MBEDTLS_PSA_CRYPTO_SE_C, you can
> register a key that's already present in the secure element with
> mbedtls_psa_register_se_key(). The corresponding facility in the
> MBEDTLS_PSA_CRYPTO_DRIVERS interface is a "get_builtin_key" entry point,
> but this is not implemented yet. (There's a prototype at
> https://github.com/ARMmbed/mbedtls/pull/3822 but nobody is working on
> it. The specification is in docs/proposed/psa-driver-interface.md.)
>
> There's an example application with a MBEDTLS_PSA_CRYPTO_SE_C driver at
> https://github.com/ARMmbed/mbed-os-example-atecc608a . We don't have
> example code for MBEDTLS_PSA_CRYPTO_DRIVERS yet, or good documentation,
> or an easy-to-use build system — those are still a few months in the future.
>
> If you write a driver in the next few months, I recommend that you stay
> in touch with the Mbed TLS development team and follow the development
> branch of Mbed TLS closely, since it's a very active area of development
> at the moment.
>
--
Frank Bergmann, Pödinghauser Str. 5, D-32051 Herford, Tel. +49-5221-9249753
SAP Hybris & Linux LPIC-3, E-Mail tx2014(a)tuxad.de, USt-IdNr DE237314606
http://tdyn.de/freel -- Redirect to profile at freelancermap
http://www.gulp.de/freiberufler/2HNKY2YHW.html -- Profile at GULP
Hi Gábor,
To reproduce locally, the correct invocation would be
tests/scripts/all.sh test_memory_buffer_allocator
Specifically, the failing tests are SSL tests. To reproduce those tests,
build the right configuration and run
tests/ssl-opt.sh -f 'DTLS fragmenting: proxy MTU, * renego'
I've posted the relevant logs on the GitHub issue.
It's unusual for the memory_buffer tests to fail when memory sanitizers
are passing, so I don't know what's going on.
--
Gilles Peskine
Mbed TLS developer
On 16/02/2021 11:13, Gábor Tóth via mbed-tls wrote:
> Hello Guys!
>
> I have an error related to test_memory_buffer_allocator on the server
> in my PR (https://github.com/ARMmbed/mbedtls/pull/4140). Tried to find
> the issue locally on both the latest Ubuntu and on version 16.04 (same
> as on the server), but without success.
> All the tests pass if I run "make test" command (of course I changed
> config.h based on the component in all.sh)..
> I have also tried:
> "./tests/scripts/all.sh component_test_memory_buffer_allocator", but
> it does not do anything, just lists some tools. Maybe I am not using
> it right...
>
> The memory allocation/freeing mechanism was not touched by my changes
> except that in the function that frees a CRT I added a small part to
> free the new dynamic field.
>
> Do you have any idea what's wrong with my PR, how could I solve it or
> find out the cause?
>
> Thank you guys!
>
> BR,
> Gábor
>
Hello Guys!
I have an error related to test_memory_buffer_allocator on the server in my
PR (https://github.com/ARMmbed/mbedtls/pull/4140). Tried to find the issue
locally on both the latest Ubuntu and on version 16.04 (same as on the
server), but without success.
All the tests pass if I run "make test" command (of course I changed
config.h based on the component in all.sh)..
I have also tried:
"./tests/scripts/all.sh component_test_memory_buffer_allocator", but it
does not do anything, just lists some tools. Maybe I am not using it
right...
The memory allocation/freeing mechanism was not touched by my changes
except that in the function that frees a CRT I added a small part to free
the new dynamic field.
Do you have any idea what's wrong with my PR, how could I solve it or find
out the cause?
Thank you guys!
BR,
Gábor
Hello,
Sorry to bother with a noob question. I am trying to understand how
bignum.c works. For that, I'm trying to write a program to add two numbers.
Here is what I have https://pastebin.com/mbRaE5i5, I'm not sure if this is
the correct approach. I use the following to compile the code,
* gcc -o mpi_example mpi_example.c bignum.c*
But get the following error,
/tmp/ccMo7DMW.o: In function `main':
mpi_example.c:(.text+0x2d): undefined reference to `mbedtls_mpi_init'
mpi_example.c:(.text+0x39): undefined reference to `mbedtls_mpi_init'
mpi_example.c:(.text+0x45): undefined reference to `mbedtls_mpi_init'
mpi_example.c:(.text+0x6c): undefined reference to `mbedtls_mpi_add_int'
mpi_example.c:(.text+0x9a): undefined reference to `mbedtls_mpi_free'
mpi_example.c:(.text+0xa6): undefined reference to `mbedtls_mpi_free'
mpi_example.c:(.text+0xb2): undefined reference to `mbedtls_mpi_free'
collect2: error: ld returned 1 exit status
Any help what I'm doing wrong here? Or any sample code and how to compile
it?
Thanks,
~ Shariful
Hi,
I am working on adding HW acceleration to a NXP Kinetis MCU, but the HW accelerator happens to implement many operations which are defined in bignum.c, like "mbedtls_mpi_exp_mod", "mbedtls_mpi_gcd", "mbedtls_mpi_inv_mod" and so on. The bignum clients for me would be ecp.c and ecp_curves.c (as well as ecdh and ecdsa), and while I can override some of those using _ALT macros, for bignum it seems not possible to do so, short of not defining MBEDLTS_BIGNUM_C and all associated dependency issues.
Also bignum itself also has other call paths that happen to use the functions I am trying to accelerate, which are themselves called by other files. Since I am using an open-source OSS and can't just override stuff in a fork, so I would like to know if there is some technical reason for an option like "MBEDTLS_BIGNUM_ALT" not being available and if such change would be acceptable?
Fabio
Hi Manu,
f_entropy is the argument passed to mbedtls_ctr_drbg_seed, which is
mbedtls_entropy_func. This function obtains entropy from all configured
sources, which depends on the library configuration. Check if it might
be calling other sources (see what sources are added in
mbedtls_entropy_init in library/entropy.c).
I think there's a bug in your mbedtls_hardware_poll implementation. It's
receiving a buffer ent_buf with room for count BYTES, but you're filling
it with count WORDS. You need to pass the exact number of bytes. In
practice, unless the library is configured in a weird way, count will be
a multiple of 4, which can make your code a bit simpler.
--
Gilles Peskine
Mbed TLS developer
On 17/08/2020 19:16, Manu Abraham via mbed-tls wrote:
> 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);work
> 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