summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2019-08-01 20:21:37 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2019-08-01 20:21:37 +0700
commit655bca08d85db23f6df082603713b5885cef2634 (patch)
treed94f4bac8635ec72886d1d147ae8def30bfbfc35
parentInline BuildEncodableVector to shrink recursive call stacks (diff)
downloadBouncyCastle.NET-ed25519-655bca08d85db23f6df082603713b5885cef2634.tar.xz
PCL fixes
-rw-r--r--crypto/src/asn1/x500/style/IetfUtilities.cs4
-rw-r--r--crypto/src/cmp/ProtectedPkiMessage.cs2
-rw-r--r--crypto/src/crmf/EncryptedValueBuilder.cs2
-rw-r--r--crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs5
4 files changed, 7 insertions, 6 deletions
diff --git a/crypto/src/asn1/x500/style/IetfUtilities.cs b/crypto/src/asn1/x500/style/IetfUtilities.cs

index e3236aaec..2c0ab45bc 100644 --- a/crypto/src/asn1/x500/style/IetfUtilities.cs +++ b/crypto/src/asn1/x500/style/IetfUtilities.cs
@@ -33,7 +33,7 @@ namespace Org.BouncyCastle.Asn1.X500.Style } catch (IOException e) { - throw new ArgumentException("Other value has no encoded form", "value", e); + throw new ArgumentException("Other value has no encoded form", e); } } @@ -85,7 +85,7 @@ namespace Org.BouncyCastle.Asn1.X500.Style while (endBuf >= 0 && vBuf[endBuf] == ' ') { - vBuf.Insert(endBuf, '\\'); + vBuf.Insert(endBuf, "\\"); endBuf--; } diff --git a/crypto/src/cmp/ProtectedPkiMessage.cs b/crypto/src/cmp/ProtectedPkiMessage.cs
index bb5b5dc14..770fe5443 100644 --- a/crypto/src/cmp/ProtectedPkiMessage.cs +++ b/crypto/src/cmp/ProtectedPkiMessage.cs
@@ -120,7 +120,7 @@ namespace Org.BouncyCastle.Cmp streamCalculator.Stream.Write(enc, 0, enc.Length); streamCalculator.Stream.Flush(); - streamCalculator.Stream.Close(); + Platform.Dispose(streamCalculator.Stream); return streamCalculator.GetResult(); } diff --git a/crypto/src/crmf/EncryptedValueBuilder.cs b/crypto/src/crmf/EncryptedValueBuilder.cs
index 8f220330e..d95896959 100644 --- a/crypto/src/crmf/EncryptedValueBuilder.cs +++ b/crypto/src/crmf/EncryptedValueBuilder.cs
@@ -121,7 +121,7 @@ namespace Org.BouncyCastle.Crmf try { eOut.Write(data, 0, data.Length); - eOut.Close(); + Platform.Dispose(eOut); } catch (IOException e) { diff --git a/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs b/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
index 49d10a6bf..b7a3ae01a 100644 --- a/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs +++ b/crypto/src/crmf/ProofOfPossessionSigningKeyBuilder.cs
@@ -5,6 +5,7 @@ using Org.BouncyCastle.Asn1.Crmf; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Operators; +using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Crmf { @@ -40,7 +41,7 @@ namespace Org.BouncyCastle.Crmf byte[] d = _pubKeyInfo.GetDerEncoded(); calc.Stream.Write(d, 0, d.Length); calc.Stream.Flush(); - calc.Stream.Close(); + Platform.Dispose(calc.Stream); this._publicKeyMAC = new PKMacValue( (AlgorithmIdentifier)fact.AlgorithmDetails, @@ -80,7 +81,7 @@ namespace Org.BouncyCastle.Crmf } calc.Stream.Flush(); - calc.Stream.Close(); + Platform.Dispose(calc.Stream); DefaultSignatureResult res = (DefaultSignatureResult)calc.GetResult(); return new PopoSigningKey(popo, (AlgorithmIdentifier)signer.AlgorithmDetails, new DerBitString(res.Collect())); }