summary refs log tree commit diff
path: root/crypto/src/bcpg
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2017-09-04 18:33:23 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2017-09-04 18:33:23 +0700
commita2e097a4029d8ac7e1345d7569a4ad5d466ea2db (patch)
treecc84c4b0d6ed50b040c6dc4c23ef0df9a465d5be /crypto/src/bcpg
parentUpdate handling of implicitly-tagged OIDs (from bc-java) (diff)
downloadBouncyCastle.NET-ed25519-a2e097a4029d8ac7e1345d7569a4ad5d466ea2db.tar.xz
Fix ResetHeaders to preserve the existing version as intended
Diffstat (limited to 'crypto/src/bcpg')
-rw-r--r--crypto/src/bcpg/ArmoredOutputStream.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/bcpg/ArmoredOutputStream.cs b/crypto/src/bcpg/ArmoredOutputStream.cs
index 7a5066ec3..82e7cc1f0 100644
--- a/crypto/src/bcpg/ArmoredOutputStream.cs
+++ b/crypto/src/bcpg/ArmoredOutputStream.cs
@@ -147,13 +147,13 @@ namespace Org.BouncyCastle.Bcpg
          */
         public void ResetHeaders()
         {
-            string version = (string)headers[HeaderVersion];
+            string existingVersion = (string)headers[HeaderVersion];
 
             headers.Clear();
 
-            if (version != null)
+            if (existingVersion != null)
             {
-                headers[HeaderVersion] = Version;
+                headers.Add(HeaderVersion, existingVersion);
             }
         }