Dear Madam/Sir,
We are working on a project which requires IEC 62351 standards.
For that we had developed a TLS server in C language and we had the
requirement of developing a TLS client in Java language. We had used
the *mbedTLS
library for server* and *OpenMUC libraries for client*. But we are getting
exception while certificate exchange phase and all. We had attached the
listed exceptions and errors. Kindly provide necessary support for the
same. Also please confirm whether we can develop above specified
architecture, ie TLS based server in C language and client in Java. If
available please share some sample programs also. Please reply ASAP.
We have debugged the code and the following are the messages we have got in
mbedtls java server and OPENMUC java tls client . During certificate
exchange from client to server (MBEDTLS_SSL_CLIENT_CERTIFICATE case in
server), the function returns a nonzero value and the alert shows in
server is 49 (ie, MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED). *Please check Fig
1 and Fig 2* for the messages displayed during connection
establishment.Kindly help us to solve the issues.
[image: image.png]
Fig 1- case:MBEDTLS_SSL_CLIENT_CERTIFICATE fails
[image: image.png]
Fig 2-OPENMUC java client error when connecting to mbedtlsserver
ReplyForward
<https://drive.google.com/u/0/settings/storage?hl=en&utm_medium=web&utm_sour…>
<https://www.google.com/intl/en/policies/terms/>
<https://www.google.com/intl/en/policies/privacy/>
<https://www.google.com/gmail/about/policy/>
Hi,
I would like to announce the Mbed TLS Tech Forum, a regular engineering call to discuss topics of interest to the Mbed TLS community.
The call is currently planned to take place every two weeks, alternating between US-friendly and China-friendly times (16:30 and 10:00 UK time), starting on the 25th October at 16:30 BST.
Please reply to the list if you have any agenda topics to raise. As a starting point, we will cover:
Format – check if times & cadence are suitable
TLS 1.3 – high-level update on progress & direction
PSA Cryptoprocessor Driver Interface – code generation for driver dispatch as per https://github.com/ARMmbed/mbedtls/pull/5067
Zoom details below. The call will be recorded and made available on the TF website: https://www.trustedfirmware.org/meetings/
Dave Rodgman
Mbed TLS tech lead
--
Dave Rodgman is inviting you to a scheduled Zoom meeting.
Join Zoom Meeting
https://armltd.zoom.us/j/93259847316?pwd=N0d4Z0o5RXRLKzZFaE1sd044bm14dz09&f…
Meeting ID: 932 5984 7316
Passcode: 991642 One tap mobile
+442034815240,,93259847316#,,,,*991642# United Kingdom
Dial by your location
+44 203 481 5240 United Kingdom
+1 346 248 7799 US (Houston)
+1 408 638 0968 US (San Jose)
+1 646 518 9805 US (New York)
+91 116 480 2722 India
+91 224 879 8012 India
+91 406 480 2722 India
+91 806 480 2722 India
+852 5803 3730 Hong Kong SAR
+46 8 4468 2488 Sweden
+972 3 978 6688 Israel
+353 1 536 9320 Ireland
+36 1 408 8456 Hungary
+33 1 7037 2246 France
+358 3 4109 2129 Finland
+45 32 70 12 06 Denmark
+1 438 809 7799 Canada
+65 3158 7288 Singapore
+27 87 550 3946 South Africa
+32 1579 5132 Belgium
+48 22 307 3488 Poland
+386 1600 3102 Slovenia
+60 3 3099 2229 Malaysia
+886 (2) 7741 7473 Taiwan
Meeting ID: 932 5984 7316
Passcode: 991642 Find your local number: https://armltd.zoom.us/u/adTMafG7oQ
Join by SIP
93259847316(a)zoomcrc.com
Join by H.323
162.255.37.11 (US West)
162.255.36.11 (US East)
115.114.131.7 (India Mumbai)
115.114.115.7 (India Hyderabad)
213.19.144.110 (Amsterdam Netherlands)
213.244.140.110 (Germany)
103.122.166.55 (Australia Sydney)
103.122.167.55 (Australia Melbourne)
209.9.211.110 (Hong Kong SAR)
149.137.40.110 (Singapore)
64.211.144.160 (Brazil)
69.174.57.160 (Canada Toronto)
65.39.152.160 (Canada Vancouver)
207.226.132.110 (Japan Tokyo)
149.137.24.110 (Japan Osaka)
Meeting ID: 932 5984 7316
Passcode: 991642
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
https://lists.trustedfirmware.org/mailman/listinfo/mbed-tls-announce
I'm hoping to make the switch from libressl to MbedTLS. I'm working
on a Linux from scratch style project. Curl works fine with MbedTLS
and most of the utilities I work with use libcurl. I'm also using
libtomcrypt for some of its hash and cryptographic functionality. The
only place I'm having a problem making the switch at present is when I
follow the LFS logic to make certificates (make-ca). There's a
openssl/libressl command in the script that looks like the following:
openssl x509 -hash -noout -in "$1"
Is there a way to replace this functionality with a command or
procedure or function from another program so that libressl or openssl
isn't needed to perform this step?
Thanks.
Hello,
I'm using mbedTLS on baremetal lwip+stm32f4 system as a Server. TLS working
successfully with the TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 but when I
receive the Client Hello message than my receive proccess function in
ethernetif_input: err = netif->input(p, netif); takes 300ms time. This
function normaly takes 1ms. I need to reduce this time. How Can I do that ?
This is my config file: https://paste.ofcode.org/Bdt4FapskKY7M5ggm3uViJ
Best Regards.
--
Embeded System Engineer
Dear Madam/Sir
We need to establish connection with security between
MMS client application in java(OPENMUC java client) and MMS server
(tls_server_example
in mbedtls).The java client application uses keystore.jks and
truststore.jks (*jks format* ) instead of certificate in *cer *format.Is it
possible to establish connection between OPENMUC java mms client and
libiec61850 1.5 with mbedtls-2.16.6* ?* . We have added the *root.cer
details *(certificate in the sample mbedtls server program ) to
* truststore.jks* in client (openmuc java) and *client1.cer details*
(client1 certificate in the sample mbedtls server program ) *to
keystore.jks* .When trying to establish connection server hello messages
are completed ,but showing the following error:
*MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE.*
* Please help...*
*Regards*
*Lekshmi G*
Hi Roman,
My understanding is that you would like to add features to the Crypto
service API, but the features which you would like to add are not
cryptographic in nature.
Have you considered creating your own service for those features, instead of
modifying the Crypto service? Or is there anything makes this not a viable
option?
If you are thinking about adding hardware acceleration for some Crypto
features, that's indeed covered in Shebu's link.
Greetings,
Fabian Schmidt
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of Shebu
Varghese Kuriakose via TF-M
Sent: Dienstag, 12. Oktober 2021 11:46
To: David Hu <David.Hu(a)arm.com>; Roman.Mazurak(a)infineon.com;
tf-m(a)lists.trustedfirmware.org; mbed-tls(a)lists.trustedfirmware.org
Cc: nd <nd(a)arm.com>
Subject: [EXT] Re: [TF-M] Adding platform specific functions to Crypto
Service.
Caution: EXT Email
Hi Roman,
I also might not have understood the question completely.
As you mention crypto HAL API, here is the specification which defines a
standardized mechanism for PSA Crypto implementations to interface with
Secure elements and crypto accelerators -
https://github.com/ARMmbed/mbedtls/blob/development/docs/proposed/psa-driver
-interface.md
<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.co
m%2FARMmbed%2Fmbedtls%2Fblob%2Fdevelopment%2Fdocs%2Fproposed%2Fpsa-driver-in
terface.md&data=04%7C01%7Cfabian.schmidt%40nxp.com%7C17489158b6384ef5caa308d
98d654ead%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637696288543072051%7C
Unknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLC
JXVCI6Mn0%3D%7C1000&sdata=uKX4sUH37jNx1%2BvACuN8tBQl05OaXPPnMT9FqMwbhdU%3D&r
eserved=0>
Also adding mbed-tls mailing list as the thread is crypto related..
Regards,
Shebu
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org
<mailto:tf-m-bounces@lists.trustedfirmware.org> > On Behalf Of David Hu via
TF-M
Sent: Tuesday, October 12, 2021 4:18 AM
To: Roman.Mazurak(a)infineon.com <mailto:Roman.Mazurak@infineon.com> ;
tf-m(a)lists.trustedfirmware.org <mailto:tf-m@lists.trustedfirmware.org>
Cc: nd <nd(a)arm.com <mailto:nd@arm.com> >
Subject: Re: [TF-M] Adding platform specific functions to Crypto Service.
Hi Roman,
Are you asking about adding platform specific HAL API to implement PSA
Crypto API function?
Please correct me if I misunderstand your question.
Best regards,
Hu Ziji
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org
<mailto:tf-m-bounces@lists.trustedfirmware.org> > On Behalf Of Roman Mazurak
via TF-M
Sent: Monday, October 11, 2021 9:45 PM
To: tf-m(a)lists.trustedfirmware.org <mailto:tf-m@lists.trustedfirmware.org>
Subject: [TF-M] Adding platform specific functions to Crypto Service.
Hi all,
We would like to add a number of platform specific functions to Crypto
Service API. Is it ok if such functions will not be related to cryptographic
service, but such approach allows us to optimize platform design? Is there
any initiative to create a Crypto Service HAL API to extend Crypto with
custom functions?
Best regards,
Roman.
Hi Roman,
I also might not have understood the question completely.
As you mention crypto HAL API, here is the specification which defines a standardized mechanism for PSA Crypto implementations to interface with Secure elements and crypto accelerators - https://github.com/ARMmbed/mbedtls/blob/development/docs/proposed/psa-drive…
Also adding mbed-tls mailing list as the thread is crypto related..
Regards,
Shebu
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org> On Behalf Of David Hu via TF-M
Sent: Tuesday, October 12, 2021 4:18 AM
To: Roman.Mazurak(a)infineon.com; tf-m(a)lists.trustedfirmware.org
Cc: nd <nd(a)arm.com>
Subject: Re: [TF-M] Adding platform specific functions to Crypto Service.
Hi Roman,
Are you asking about adding platform specific HAL API to implement PSA Crypto API function?
Please correct me if I misunderstand your question.
Best regards,
Hu Ziji
From: TF-M <tf-m-bounces(a)lists.trustedfirmware.org<mailto:tf-m-bounces@lists.trustedfirmware.org>> On Behalf Of Roman Mazurak via TF-M
Sent: Monday, October 11, 2021 9:45 PM
To: tf-m(a)lists.trustedfirmware.org<mailto:tf-m@lists.trustedfirmware.org>
Subject: [TF-M] Adding platform specific functions to Crypto Service.
Hi all,
We would like to add a number of platform specific functions to Crypto Service API. Is it ok if such functions will not be related to cryptographic service, but such approach allows us to optimize platform design? Is there any initiative to create a Crypto Service HAL API to extend Crypto with custom functions?
Best regards,
Roman.
Hello,
I am using this example for the source of the my main purpose :
https://github.com/straight-coding/LPC407x-NoOS-LWIP-MBEDTLS-HTTPD-KEIL/blo…
This example using https but I'm trying to use this example on Modbus
Server.
This is init function for the server tcp connections:
BOOL
xMBTCPPortInit( USHORT usTCPPort )
{
struct altcp_pcb *pxPCBListenNew, *pxPCBListenOld;
BOOL bOkay = (BOOL)FALSE;
USHORT usPort;
extern struct altcp_tls_config* getTlsConfig(void);
tls_config = getTlsConfig();
mbedtls_ssl_conf_dbg(tls_config, my_debug, NULL);
mbedtls_debug_set_threshold(5);
if( usTCPPort == 0 )
{
usPort = MB_TCP_DEFAULT_PORT;
}
else
{
usPort = ( USHORT ) usTCPPort;
}
if( ( pxPCBListenNew = pxPCBListenOld = altcp_tls_new(
tls_config,IPADDR_TYPE_ANY) ) == NULL )
{
/* Can't create TCP socket. */
bOkay = (BOOL)FALSE;
}
else
if( altcp_bind( pxPCBListenNew, IP_ANY_TYPE, ( u16_t ) usPort ) !=
ERR_OK )
{
/* Bind failed - Maybe illegal port value or in use. */
( void )altcp_close( pxPCBListenOld );
bOkay = (BOOL)FALSE;
}
else if( ( pxPCBListenNew = altcp_listen( pxPCBListenNew ) ) == NULL )
{
( void )altcp_close( pxPCBListenOld );
bOkay = (BOOL)FALSE;
}
else
{
// altcp_tls_new(pxPCBListenNew, IP_GET_TYPE(ip_addr))*/;
/* Register callback function for new clients. */
altcp_accept( pxPCBListenNew, prvxMBTCPPortAccept );
/* Everything okay. Set global variable. */
pxPCBListen = pxPCBListenNew;
#ifdef MB_TCP_DEBUG
vMBPortLog( MB_LOG_DEBUG, "MBTCP-ACCEPT", "Protocol stack
ready.\r\n" );
#endif
SerialPrint("MBTCTP-ACCEPT");
}
bOkay = (BOOL)TRUE;
return bOkay;
}
struct altcp_tls_config* getTlsConfig(void)
{
struct altcp_tls_config* conf;
size_t privkey_len = strlen(privkey) + 1;
size_t privkey_pass_len = strlen(privkey_pass) + 1;
size_t cert_len = strlen(cert) + 1;
conf = altcp_tls_create_config_server_privkey_cert((u8_t*)privkey,
privkey_len, (u8_t*)privkey_pass, privkey_pass_len, (u8_t*)cert, cert_len);
return conf;
}
And I am using basic python tls client example to show successful mbedtls
handshake.
This is my client.py codes:
import time
from socket import create_connection
from ssl import SSLContext, PROTOCOL_TLS_CLIENT
import ssl
hostname='example.org'
ip = '192.168.1.2'
port = 502
context = SSLContext(PROTOCOL_TLS_CLIENT)
context.options |= ssl.OP_NO_SSLv3
context.options |= ssl.OP_NO_TLSv1
context.options |= ssl.OP_NO_TLSv1_1
context.load_verify_locations('cert.pem')
with create_connection((ip, port)) as client:
with context.wrap_socket(client, server_hostname=hostname) as tls:
print(f'Using {tls.version()}\n')
tls.sendall(b'Hello world')
data = tls.recv(1024)
print(f'Server says: {data}')
When I try to start communication I get below outputs on wireshark:
[image: image.png]
When the server send hello message I've this error on the line:
[image: image.png]
When I checked the low_level_output functions I get sending data bytes 150
byte but Ipv4 length shows us 576 byte, opt.h file set as default but if I
changed TCP_MSS as a 250 byte so I can send 136 byte and Ipv4 packet
lenght shows me 136. But does not make sense. I couldnt do successful
handshaking.
My mbedtls debug outputs in this link
https://paste.ofcode.org/PP3zFmrLcKqPdRMT3LzETz How cna I solve this
problem ? What is the reason for the lenght problem ?
Best Regards.
--
Embeded System Engineer
Hello,
I am very sorry about last email by mistakes. I have some questions about multiplication on ecp curves.
I add an ecp curve parameter in ecp_curve.c form SM2 algorithm standard, and the parameter is as follow:
Then I followed the loading method of secp256r1 to load, but I don’t know how to perform fast calculations, so I commented NIST_MODP( p256 ).
#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
caseMBEDTLS_ECP_DP_SECP256R1:
NIST_MODP( p256 );
return( LOAD_GROUP( secp256r1 ) );
#endif
#if defined(MBEDTLS_ECP_DP_SM256_ENABLED)
caseMBEDTLS_ECP_DP_SM256:
//NIST_MODP( p256 );
return( LOAD_GROUP_A( sm256 ) );
#endif
Then I call the functional interface mbedtls_ecp_mul to perform the multiplication operation, but the heap memory keeps increasing .
voidtest()
{
intret;
mbedtls_mpiUd;
mbedtls_ecp_groupgrp;
mbedtls_ecp_pointT_Q;
mbedtls_mpi_init(&Ud);
mbedtls_ecp_group_init( &grp );
mbedtls_ecp_point_init( &T_Q );
ret=mbedtls_mpi_read_binary(&Ud, arrUd, sizeof(arr_U_d));
// ret = mbedtls_ecp_group_load(&grp,MBEDTLS_ECP_DP_SECP256R1);
ret=mbedtls_ecp_group_load(&grp,MBEDTLS_ECP_DP_SM256);
ret=mbedtls_ecp_mul(&grp, &T_Q, &Ud, &(grp.G), NULL, NULL) ;
printf("%x\n", -ret);
mbedtls_mpi_free(&Ud);
mbedtls_ecp_group_free( &grp );
mbedtls_ecp_point_free( &T_Q );
}
intmain()
{
for(inti=0; i<10; i++)
test();
return0;
}
The heap memory is mesaured by massif( valgring tools),
Can someone tell me what this is because of and how to fix this problem ?
Best Regards.
Shudong Zhang