diff options
-rw-r--r-- | crypto/src/asn1/Asn1OutputStream.cs | 5 | ||||
-rw-r--r-- | crypto/src/asn1/ConstructedILEncoding.cs | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/crypto/src/asn1/Asn1OutputStream.cs b/crypto/src/asn1/Asn1OutputStream.cs index 78cb8e0a8..745674930 100644 --- a/crypto/src/asn1/Asn1OutputStream.cs +++ b/crypto/src/asn1/Asn1OutputStream.cs @@ -173,6 +173,11 @@ namespace Org.BouncyCastle.Asn1 return GetLengthOfIdentifier(tagNo) + GetLengthOfDL(contentsLength) + contentsLength; } + internal static int GetLengthOfEncodingIL(int tagNo, IAsn1Encoding[] contentsEncodings) + { + return GetLengthOfIdentifier(tagNo) + 3 + GetLengthOfContents(contentsEncodings); + } + internal static int GetLengthOfIdentifier(int tagNo) { if (tagNo < 31) diff --git a/crypto/src/asn1/ConstructedILEncoding.cs b/crypto/src/asn1/ConstructedILEncoding.cs index 1934c6f48..a609e1e46 100644 --- a/crypto/src/asn1/ConstructedILEncoding.cs +++ b/crypto/src/asn1/ConstructedILEncoding.cs @@ -27,9 +27,7 @@ namespace Org.BouncyCastle.Asn1 int IAsn1Encoding.GetLength() { - return Asn1OutputStream.GetLengthOfIdentifier(m_tagNo) - + 3 - + Asn1OutputStream.GetLengthOfContents(m_contentsElements); + return Asn1OutputStream.GetLengthOfEncodingIL(m_tagNo, m_contentsElements); } } } |