Skip to content
This repository has been archived by the owner on Mar 1, 2021. It is now read-only.

Commit

Permalink
Check if save_iv is not null in CryptoDevTransform before copying. Us…
Browse files Browse the repository at this point in the history
…ing PtrToStringAuto in OpenSslUtil.
  • Loading branch information
Bassam Tabbara committed Sep 25, 2013
1 parent 937ed08 commit bdec80a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -104,7 +104,7 @@ protected override void Transform (byte[] input, int inputOffset, byte[] output,
fixed (byte *v = iv)
fixed (byte *i = &input [inputOffset])
fixed (byte *o = &output [outputOffset]) {
if (iv != null) {
if (save_iv != null) {
context.iv = (IntPtr) v;

if (!encrypt) {
Expand All @@ -127,7 +127,7 @@ protected override void Transform (byte[] input, int inputOffset, byte[] output,
}
}

if (iv != null) {
if (save_iv != null) {
if (encrypt)
Buffer.BlockCopy (output, outputOffset + size - BlockSizeByte, iv, 0, BlockSizeByte);
else
Expand Down
2 changes: 1 addition & 1 deletion class/Crimson.OpenSsl/Crimson.OpenSsl/OpenSslUtil.cs
Expand Up @@ -55,7 +55,7 @@ public static void EnsureAvailability()

public static string GetVersionInfo()
{
return Marshal.PtrToStringUni(Native.SSLeay_version (Native.SSLEAY_VERSION));
return Marshal.PtrToStringAuto(Native.SSLeay_version (Native.SSLEAY_VERSION));
}
}
}

0 comments on commit bdec80a

Please sign in to comment.