]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 11 Jun 2012 01:08:56 +0000 (01:08 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 11 Jun 2012 01:08:56 +0000 (01:08 +0000)
MagickCore/cipher.c

index 314e83ae13206a80436a7cea1f3f692b9c5a6ebb..ca8086b860b8577e87baeef13edadd299e6ddf47 100644 (file)
@@ -613,7 +613,9 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image,
       ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
         image->filename);
     }
-  nonce=SplitStringInfo(key,GetStringInfoLength(key)/2);
+  SetAESKey(aes_info,key);
+  key=DestroyStringInfo(key);
+  nonce=AcquireStringInfo(0);
   if (nonce == (StringInfo *) NULL)
     {
       key=DestroyStringInfo(key);
@@ -622,10 +624,7 @@ MagickExport MagickBooleanType PasskeyDecipherImage(Image *image,
       ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
         image->filename);
     }
-  SetAESKey(aes_info,key);
-  key=DestroyStringInfo(key);
   signature_info=AcquireSignatureInfo();
-  UpdateSignature(signature_info,nonce);
   SetStringInfoLength(nonce,sizeof(quantum_info->extent));
   SetStringInfoDatum(nonce,(const unsigned char *) &quantum_info->extent);
   UpdateSignature(signature_info,nonce);
@@ -814,7 +813,9 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image,
       ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
         image->filename);
     }
-  nonce=SplitStringInfo(key,GetStringInfoLength(key)/2);
+  SetAESKey(aes_info,key);
+  key=DestroyStringInfo(key);
+  nonce=AcquireStringInfo(0);
   if (nonce == (StringInfo *) NULL)
     {
       key=DestroyStringInfo(key);
@@ -823,10 +824,7 @@ MagickExport MagickBooleanType PasskeyEncipherImage(Image *image,
       ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
         image->filename);
     }
-  SetAESKey(aes_info,key);
-  key=DestroyStringInfo(key);
   signature_info=AcquireSignatureInfo();
-  UpdateSignature(signature_info,nonce);
   SetStringInfoLength(nonce,sizeof(quantum_info->extent));
   SetStringInfoDatum(nonce,(const unsigned char *) &quantum_info->extent);
   UpdateSignature(signature_info,nonce);