diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-08 17:21:22 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2015-11-08 17:21:22 +0700 |
commit | 4198486935e8b5b7f83734ea9347cb6fc00a9802 (patch) | |
tree | 0de15e0a7e9c3eca2f1fd707733a581c55333d34 /crypto | |
parent | Merge branch 'master' of git.bouncycastle.org:bc-csharp (diff) | |
download | BouncyCastle.NET-ed25519-4198486935e8b5b7f83734ea9347cb6fc00a9802.tar.xz |
Some more PORTABLE updates
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/src/crypto/tls/DtlsReliableHandshake.cs | 10 | ||||
-rw-r--r-- | crypto/src/crypto/tls/HeartbeatMessage.cs | 9 | ||||
-rw-r--r-- | crypto/src/crypto/tls/TlsProtocol.cs | 11 |
3 files changed, 27 insertions, 3 deletions
diff --git a/crypto/src/crypto/tls/DtlsReliableHandshake.cs b/crypto/src/crypto/tls/DtlsReliableHandshake.cs index 7f3f832a1..18a41769a 100644 --- a/crypto/src/crypto/tls/DtlsReliableHandshake.cs +++ b/crypto/src/crypto/tls/DtlsReliableHandshake.cs @@ -419,7 +419,15 @@ namespace Org.BouncyCastle.Crypto.Tls internal void SendToRecordLayer(DtlsRecordLayer recordLayer) { - recordLayer.Send(GetBuffer(), 0, (int)Length); +#if PORTABLE + byte[] buf = ToArray(); + int bufLen = buf.Length; +#else + byte[] buf = GetBuffer(); + int bufLen = (int)Length; +#endif + + recordLayer.Send(buf, 0, bufLen); Platform.Dispose(this); } } diff --git a/crypto/src/crypto/tls/HeartbeatMessage.cs b/crypto/src/crypto/tls/HeartbeatMessage.cs index f64a7baa4..3f22f7e1d 100644 --- a/crypto/src/crypto/tls/HeartbeatMessage.cs +++ b/crypto/src/crypto/tls/HeartbeatMessage.cs @@ -95,7 +95,14 @@ namespace Org.BouncyCastle.Crypto.Tls int minimumCount = payloadLength + 16; if (Length < minimumCount) return null; - return Arrays.CopyOf(GetBuffer(), payloadLength); + +#if PORTABLE + byte[] buf = ToArray(); +#else + byte[] buf = GetBuffer(); +#endif + + return Arrays.CopyOf(buf, payloadLength); } } } diff --git a/crypto/src/crypto/tls/TlsProtocol.cs b/crypto/src/crypto/tls/TlsProtocol.cs index 51178a473..99168b883 100644 --- a/crypto/src/crypto/tls/TlsProtocol.cs +++ b/crypto/src/crypto/tls/TlsProtocol.cs @@ -1310,7 +1310,16 @@ namespace Org.BouncyCastle.Crypto.Tls TlsUtilities.CheckUint24(length); this.Position = 1; TlsUtilities.WriteUint24((int)length, this); - protocol.WriteHandshakeMessage(GetBuffer(), 0, (int)Length); + +#if PORTABLE + byte[] buf = ToArray(); + int bufLen = buf.Length; +#else + byte[] buf = GetBuffer(); + int bufLen = (int)Length; +#endif + + protocol.WriteHandshakeMessage(buf, 0, bufLen); Platform.Dispose(this); } } |