Allow to suppress zero nonce error (#1184)

- in addition to duplicate nonce this change allows to suppress zero nonce
This commit is contained in:
Martin Regen
2020-11-14 11:10:10 +01:00
committed by GitHub
parent 346c4e30c5
commit ebe7e26a75
+3 -2
View File
@@ -334,9 +334,10 @@ namespace Opc.Ua.Client
// the server nonce should be validated if the token includes a secret.
if (!Utils.Nonce.ValidateNonce(serverNonce, MessageSecurityMode.SignAndEncrypt, (uint)m_configuration.SecurityConfiguration.NonceLength))
{
if (channelSecurityMode == MessageSecurityMode.SignAndEncrypt)
if (channelSecurityMode == MessageSecurityMode.SignAndEncrypt ||
m_configuration.SecurityConfiguration.SuppressNonceValidationErrors)
{
Utils.Trace((int)TraceMasks.Security, "Warning: The server nonce has not the correct length or is not random enough. The error is suppressed because the channel is encrypted.");
Utils.Trace((int)TraceMasks.Security, "Warning: The server nonce has not the correct length or is not random enough. The error is suppressed by user setting or because the channel is encrypted.");
}
else
{