login about faq

The following code fails in 9.5.0.41, but used to work fine (eg. in 9.5.0.36):

CkPrivateKey key1;
assert (key1.LoadRsaDerFile (“demo512.der”));  // ok, 512 bit rsa DER key loaded 
assert (key1.SavePkcs8EncryptedFile (“secret”, ”demo512.enc”)); // ok, saved an encrypted copy
CkPrivateKey key2;
assert (key2.LoadPkcs8EncryptedFile(“demo512.enc”, “secret”); // assertion fails with 9.5.0.41

The error text says:

algorithm; des
keyLength: 192
outputSize: 22
invalid ASN.1 for unencrypted PKCS8…
Password may be incorrect.
Error_Code: 64

The demo512.enc file created using 9.5.0.41 is too small; only 94 bytes vs 426 bytes when using the 9.5.0.36 library. (The original demo512.der file was 319 bytes.) So it seems :SavePkcs8EncryptedFile is to blame here.

Please take a look at this,

Thanks! /Sune

asked Jul 28 '14 at 09:36

sune's gravatar image

sune
1234


Thanks! I'm investigating...

link

answered Jul 28 '14 at 16:40

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

This is fixed. What build do you need (programming language, operating system, 32-bit/64-bit, etc.)?

PS> Each time a problem is fixed, the test case is added to the internal QA suite, and all tests in the QA suite must pass prior to new version releases.

PS> Also, this error was caused by improvements in keeping private keys encrypted and non-exposed when in memory.

link

answered Jul 28 '14 at 17:59

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Great!

I use Chilkat C/C++ Libs for VC++ 11.0 (Platform Toolset v110_xp), both 32 + 64 bit versions.

Thanks, Sune

(Jul 29 '14 at 00:34) sune

The fix is available in v9.5.0.43 here: http://www.chilkatsoft.com/downloads_vcpp.asp#downloads

link

answered Jul 31 '14 at 09:43

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3
×1
×1

Asked: Jul 28 '14 at 09:36

Seen: 671 times

Last updated: Jul 31 '14 at 09:43

powered by OSQA