Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ValidateLength()

static LengthValidity System.Formats.Asn1.AsnDecoder.ValidateLength ( ReadOnlySpan< byte > source,
AsnEncodingRules ruleSet,
Asn1Tag localTag,
int? encodedLength,
out int actualLength,
out int bytesConsumed )
inlinestaticprivate

Definition at line 229 of file AsnDecoder.cs.

230 {
231 if (localTag.IsConstructed)
232 {
233 if (ruleSet == AsnEncodingRules.CER && encodedLength.HasValue)
234 {
236 return LengthValidity.CerRequiresIndefinite;
237 }
238 }
239 else if (!encodedLength.HasValue)
240 {
242 return LengthValidity.PrimitiveEncodingRequiresDefinite;
243 }
244 if (encodedLength.HasValue)
245 {
246 int value = encodedLength.Value;
247 int num = value;
248 if (num > source.Length)
249 {
251 return LengthValidity.LengthExceedsInput;
252 }
255 return LengthValidity.Valid;
256 }
259 return LengthValidity.Valid;
260 }
static int SeekEndOfContents(ReadOnlySpan< byte > source, AsnEncodingRules ruleSet)

References System.Formats.Asn1.AsnDecoder.SeekEndOfContents(), System.source, and System.value.

Referenced by System.Formats.Asn1.AsnDecoder.ReadEncodedValue(), and System.Formats.Asn1.AsnDecoder.TryReadEncodedValue().