Thanks for the response Ben!

We are targeting TLS1.2. For testing, we have one server that has both 
callbacks enabled. On the client side, we have two clients, 1 establishing SRP 
connections with the usual calls (set_srp_username,set_srp_password) and it 
works. The other client establishes connections via PSK. 

Running callback only for SRP on the server with a client connecting via SRP 
works. Its just that when you try to add a PSK callback on the server with the 
SRP callback, the SRP callbacks don't work anymore for SRP clients when PSK 
clients are still able to with both callbacks being triggered/registered. 

Here is a quick summary of the test scenarios we have:
1. SRP client with SRP callback only - works
2. PSK client with PSK callback only - works
3. SRP client with SRP+PSK callbacks - doesn't work
4. PSK client with SRP+PSK callbacks - works

Main issue is that the SRP callback doesn't seem to play well with PSK 
callback. Let me know if there is any other information I may have not supplied 
so I can try to explain further.

Raffy
 
-----Original Message-----
From: Benjamin Kaduk <bka...@akamai.com> 
Sent: Tuesday, June 22, 2021 1:39 PM
To: Revestual, Raffy [AUTOSOL/PSS/MNL] <raffy.revest...@emerson.com>
Cc: openssl-users@openssl.org
Subject: [EXTERNAL] Re: Can OpenSSL handle multiple authentication mechanisms 
on the same SSL context?

On Tue, Jun 22, 2021 at 04:18:25AM +0000, Revestual, Raffy [AUTOSOL/PSS/MNL] 
wrote:
> Also asked this question in stackoverflow.com
> 
> https://urldefense.com/v3/__https://stackoverflow.com/questions/680774
> 19/can-openssl-handle-multiple-authentication-mechanisms-on-the-same-s
> sl-context__;!!GjvTz_vk!DeBGhsJS1c6OIusGcUpz3NpRsG2S3kReo2omn1ch1-B6mJ
> 1ZvmGuj5awlkmShw$
> 
> We are trying to support a server that would support PSK and SRP 
> authentication mechanisms. However, when we run to try to run callbacks for 
> both on the same context, only the PSK callbacks are being detected:
> 
> SSL_CTX_set_psk_server_callback(m_ctx, psk_out_of_bound_serv_cb);
> 
> SSL_CTX_set_srp_username_callback(m_ctx, srp_server_param_cb);
> 
> SRP and PSK works currently in our code if you only set one callback or the 
> other. I tried to register SRP first but doing this didn't change the fact 
> the only PSK was working. So an alternative would be to set these 
> individually on the SSL context. I have also confirmed that SRP and PSK 
> cipher suites when combined when being set is a non-issue.
> 
> Would multiple callbacks for different mechanisms work simultaneously on the 
> same SSL context?

The situation is somewhat different between TLS 1.3 and prior versions (e.g., 
TLS 1.2).
Since there isn't currently a defined SRP option for TLS 1.3, I assume you are 
targeting TLS 1.2

I think you need to say more about your testing -- whether SRP or PSK is being 
attempted for TLS 1.2 is at the control of the client, as the ClientKeyExchange 
protocol message will have a different structure for using SRP vs using PSK.  
If your client is never trying SRP, then of course your SRP callback will never 
be called.

So, how are you testing the various scenarios?

-Ben

Reply via email to