summary refs log tree commit diff
path: root/crypto/src/asn1/Asn1InputStream.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--crypto/src/asn1/Asn1InputStream.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/src/asn1/Asn1InputStream.cs b/crypto/src/asn1/Asn1InputStream.cs
index d7edae9e0..1791e5356 100644
--- a/crypto/src/asn1/Asn1InputStream.cs
+++ b/crypto/src/asn1/Asn1InputStream.cs
@@ -392,7 +392,8 @@ namespace Org.BouncyCastle.Asn1
                 case Asn1Tags.Enumerated:
                     return DerEnumerated.FromOctetString(GetBuffer(defIn, tmpBuffers));
                 case Asn1Tags.ObjectIdentifier:
-                    return DerObjectIdentifier.FromOctetString(GetBuffer(defIn, tmpBuffers));
+                    // TODO Ideally only clone if we used a buffer
+                    return DerObjectIdentifier.CreatePrimitive(GetBuffer(defIn, tmpBuffers), true);
             }
 
             byte[] bytes = defIn.ToArray();