Library error on Windows 8 , Windows 8.1.

8/25/2014 8:25:36 AM
Gravatar
Total Posts 5

Library error on Windows 8 , Windows 8.1.

hi, I can't use library on Windows 8 , Windows 8.1. Library return
 

Attempted to read or write protected memory.This is often an indication that

other memory is corrupt

 

 

it can run  on other windows

 

Thank you.

8/25/2014 9:26:01 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

NCryptoki works on any Windows OS from Windows XP to Windows 8.1.

We have thousands of customers that are using NCryptoki and noone has got such a problem.

What PKCS#11 module (dll) are you loading?

NCryptoki loads a PKCS#11 dll to work. The problem may be due to such PKCS#11.

8/25/2014 10:17:01 AM
Gravatar
Total Posts 5

Re: Library error on Windows 8 , Windows 8.1.

 

digitalSigner = new DigitalSigner("C:\\Program Files\\LunaSA\\cryptoki.dll");
digitalSigner.OpenSession(1);

digitalSingner.Login("pass")      <<<< error

 

I develop with C# in VS.2012

 

Thank you for support

8/25/2014 10:22:51 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

You called OpenSession(1), this means that you are tryng to connect to the Slot 1. Are you sure you have two slots available (0 and 1).

Did you try to call OpenSession(0)?

8/25/2014 10:42:36 AM
Gravatar
Total Posts 5

Re: Library error on Windows 8 , Windows 8.1.

I have tryied have the same problem

8/25/2014 10:56:57 AM
Gravatar
Total Posts 5

Re: Library error on Windows 8 , Windows 8.1.

I can run this code in .NET FW 3.5 on Windows 8 , but I can't run this code in .NET FW 4.0 on Windows 8.

And

I can run this code in .NET FW 4.0 on other Windows (7,server2008 R2).

8/25/2014 11:19:06 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

I guess the problem is related to cryptoki.dll that you are using on that Windows 8.1 installation.

Are you working on 32 or 64bit system?

On a 64bit system your .net application runs as 64bit and can load only a 64bit dll. check this.

 

8/25/2014 12:33:03 PM
Gravatar
Total Posts 5

Re: Library error on Windows 8 , Windows 8.1.

I use 64bit all windows only . I don't have NCrytoki Library for 64 bit

 

Thank you for support

8/25/2014 4:24:45 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

NCryptoki is a .NET assembly and it can work on both 32 and 64bit OS.

I mean cryptoki.dll, the dll of your PKCS#11 module.

Are you sure you are using the 64bit one?

8/26/2014 10:08:05 AM
Gravatar
Total Posts 6

Re: Library error on Windows 8 , Windows 8.1.

Hello

cryptoki.dll we are using is from x64 driver, so it should be 64-bit. Basically, if we run the project using .NET Framework 3.5, it works without such error. However, when we attempt to use .NET Framework 4.0 or higher, we received the following error:

An unhandled exception of type 'System.AccessViolationException' occurred in NCryptoki.dll

Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

8/26/2014 10:10:20 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

It's very strange. We never seen this error till now.

Can you send us the stack trace of the exception?

8/26/2014 10:26:19 AM
Gravatar
Total Posts 6

Re: Library error on Windows 8 , Windows 8.1.

   at . (Int32 , Int32 , Byte[] , Int32 )
   at .C_Login(Int32 , Int32 , String )
   at Cryptware.NCryptoki.Session.Login(Int32 userType, String pin)
   at Cryptware.NDigitSign.DigitalSigner.Login(String pin)
   at FullTestNDigitSign.Form1.button4_Click(Object sender, EventArgs e) in d:\Users\Tito\Documents\Projects\TKS\Digital\FullTestNDigitSign\Form1.cs:line 45
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at FullTestNDigitSign.Program.Main() in d:\Users\Tito\Documents\Projects\TKS\Digital\FullTestNDigitSign\Program.cs:line 17
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

8/26/2014 10:32:11 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

Which PIN are you passing?

Which is your language encoding?

8/26/2014 10:43:22 AM
Gravatar
Total Posts 6

Re: Library error on Windows 8 , Windows 8.1.

Not exactly sure about your question, but there is no pin being passed. There is also no code that sets the encoding. The certificates are pre-configured as a mean of authentication between the client and the server.

8/26/2014 10:50:54 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

I don't understand.

In your code you call:

Cryptware.NDigitSign.DigitalSigner.Login(String pin)

 

Which PIN are you passing to this method?

 

The stacktrace says that the exception is raised by the PKCS#11 function C_Login in your cryptoki.dll. So the problem is the PIN

8/26/2014 10:54:05 AM
Gravatar
Total Posts 6

Re: Library error on Windows 8 , Windows 8.1.

Sorry, it is .NET string hardcoded into the sourcecode. It contains @ sign, English letters, and number

8/26/2014 12:27:52 PM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: Library error on Windows 8 , Windows 8.1.

Ok. I don't know why it happens.

The stack trace says that the exception is raised by C_Login inside your cryptoki.dll.

Try to change another PIN to test if it works

 

8/28/2014 7:51:32 AM
Gravatar
Total Posts 6

Re: Library error on Windows 8 , Windows 8.1.

I tried to input other PIN number such as 1234 or even left blank, but got the same error. 

10/13/2014 10:27:13 AM
Gravatar
Total Posts 6

Re: Library error on Windows 8 , Windows 8.1.

Any potential suggestions or follow-up regarding this matter? Can you please help look into it?

10/13/2014 4:05:23 PM
Gravatar
Total Posts 13

Re: Library error on Windows 8 , Windows 8.1.

Try:

digitalSigner = new DigitalSigner(@"C:\\Progra~1\\LunaSA\\cryptoki.dll");