Repository navigation
mbedtls: expose mbedtls_pk_load_file() for our use - #1421
orangepizza wants to merge 3 commits into
Conversation
|
I limited this patch only enabled in mbedtls 3.6.x , so any version newer than that 4.x or 3.7 etc, someone need to test/look at upstream code if patch is still appropriate |
|
My concern is that the lazy fix just postpones this tech debt invisibly into the future. Is there a way to reimplement this call using supported APIs? |
to do that it looks like you need to manually set ecdsa curve parameter from ecp.h (don't think it'd safe) or grab or write raw byte fileread function form somewhere else and tose it into _libssh2_mbedtls_ecdsa_new_private_frommemory (this drops support for pem though) |
|
Using low-level crypto (or alternate internals?) would of course not be an ideal solution. @gilles-peskine-arm suggested |
|
that returns mbedtls_pk_context, ecp.h needed to convert it into mbedtls_ecdsa_context (which is rename of mbedtls_ecp_keypair) https://github.com/Mbed-TLS/mbedtls/blob/f974bff38c958f1f3ca997253f002a7b179952ab/tf-psa-crypto/drivers/builtin/include/mbedtls/ecdsa.h#L67 |
|
tried mimicing what rsa function did, but ecdsa_context isn't something able to copied by public (no mbedtls_ecdsa_keypair_copy) |
|
I'm still bummed why mbedTLS is removing a function with no replacement. This combined with no notice or a line in the ChangeLog is causing unnecessary pain. |
mbedtls_pk_load_file() for our use
|
Thanks. Would you mind rebasing to master? And delete the |
while it's moved to pk_internal, it won't removed in mbedtls 3.6 LTS so it's safe to redeclare it on our side to find it
|
rebased: should I squash those too? |
|
No need, thanks. |
|
Merged now, thanks you for the PR! |
While it's moved to pk_internal, it won't removed in mbedTLS 3.6 LTS so it's safe to redeclare it on our side to find it. This is implementing emergency fix suggested from libssh2@2e4c5ec#commitcomment-141379351 Follow-up to e973493 libssh2#1393 Follow-up to 2e4c5ec libssh2#1349 Closes libssh2#1421
Fix regression with commit from #1421
Fix regression with commit from #1421
while it's moved to pk_internal, it won't removed in mbedtls 3.6 LTS
so it's safe to redeclare it on our side to find it
this is implementing emergency fix suggested from
2e4c5ec#commitcomment-141379351