Complex types fixes (#978)

fix #940 and #975 
- add namespace qualifier to complex type name
- improve handling of known subtypes
- fix Pss detection on .Net 462
- stronger check of valid DataTypeDefinition for servers which expose invalid structure (nodejs)
This commit is contained in:
Martin Regen
2020-05-15 12:54:20 +02:00
committed by GitHub
parent 946f402e87
commit f53f71f8a4
8 changed files with 139 additions and 38 deletions
@@ -388,7 +388,7 @@ namespace Opc.Ua
/// Lazy helper to allow runtime to check for Pss support.
/// </summary>
internal static readonly Lazy<bool> IsSupportingRSAPssSign = new Lazy<bool>(() => {
#if NET46 || NET461 || NET47
#if NET46 || NET461 || NET462 || NET47
// The Pss check returns false on .Net4.6/4.7, although it is always supported with certs.
// but not supported with Mono
return !Utils.IsRunningOnMono();
@@ -417,6 +417,6 @@ namespace Opc.Ua
rsa.Dispose();
}
}
#endregion
#endregion
}
}
+33 -1
View File
@@ -514,8 +514,40 @@ namespace Opc.Ua
case DataTypes.Number: { return typeof(Variant); }
case DataTypes.Integer: { return typeof(Variant); }
case DataTypes.UInteger: { return typeof(Variant); }
case DataTypes.UtcTime: { return typeof(DateTime); }
case DataTypes.Enumeration: { return typeof(Int32); }
// subtype of DateTime
case DataTypes.Date:
case DataTypes.UtcTime: goto case DataTypes.DateTime;
// subtype of ByteString
case DataTypes.ApplicationInstanceCertificate:
case DataTypes.AudioDataType:
case DataTypes.ContinuationPoint:
case DataTypes.Image:
case DataTypes.ImageBMP:
case DataTypes.ImageGIF:
case DataTypes.ImageJPG:
case DataTypes.ImagePNG: goto case DataTypes.ByteString;
// subtype of NodeId
case DataTypes.SessionAuthenticationToken: goto case DataTypes.NodeId;
// subtype of Double
case DataTypes.Duration: goto case DataTypes.Double;
// subtype of UInt32
case DataTypes.IntegerId:
case DataTypes.Index:
case DataTypes.VersionTime:
case DataTypes.Counter: goto case DataTypes.UInt32;
// subtype of UInt64
case DataTypes.BitFieldMaskDataType: goto case DataTypes.UInt64;
// subtype of String
case DataTypes.DateString:
case DataTypes.DecimalString:
case DataTypes.DurationString:
case DataTypes.LocaleId:
case DataTypes.NormalizedString:
case DataTypes.NumericRange:
case DataTypes.Time:
case DataTypes.TimeString: goto case DataTypes.String;
}
return factory.GetSystemType(datatypeId);