summary refs log tree commit diff
path: root/crypto/src/asn1/BEROctetStringGenerator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src/asn1/BEROctetStringGenerator.cs')
-rw-r--r--crypto/src/asn1/BEROctetStringGenerator.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/src/asn1/BEROctetStringGenerator.cs b/crypto/src/asn1/BEROctetStringGenerator.cs
index de039014b..4a7f1e8e5 100644
--- a/crypto/src/asn1/BEROctetStringGenerator.cs
+++ b/crypto/src/asn1/BEROctetStringGenerator.cs
@@ -112,6 +112,8 @@ namespace Org.BouncyCastle.Asn1
 					    DerOctetString.Encode(_derOut, _buf, 0, _off);
 				    }
 
+                    _derOut.FlushInternal();
+
 				    _gen.WriteBerEnd();
                 }
                 base.Dispose(disposing);
@@ -124,7 +126,9 @@ namespace Org.BouncyCastle.Asn1
 					DerOctetString.Encode(_derOut, _buf, 0, _off);
 				}
 
-				_gen.WriteBerEnd();
+                _derOut.FlushInternal();
+
+                _gen.WriteBerEnd();
 				base.Close();
 			}
 #endif