PKCS11Interop with WCF Service

52 views
Skip to first unread message

giorgi.ja...@gmail.com

unread,
Oct 30, 2018, 4:56:23 AM10/30/18
to Pkcs11Interop
hi
i have some problem to pkcs11interop library.
i created wcf service (framework 4.5), but when i call this service from windowsform(framework 4) service shutdown

problem is when i call this method in service

session.Login(CKU.CKU_USER, pkcs11Pin);

return this error

"attempted to read or write protected memory. This is often an indication that other memory is corrupt"

i dont understend which library i must use for WCF Service

"netstandard1.3"
"net20"
"net40"
"net45"


i tried "netstandard1.3","net45" but not work

Jaroslav Imrich

unread,
Oct 30, 2018, 6:04:33 AM10/30/18
to pkcs11...@googlegroups.com, giorgi.ja...@gmail.com
Hello,
 
problem is when i call this method in service

session.Login(CKU.CKU_USER, pkcs11Pin);

return this error

"attempted to read or write protected memory. This is often an indication that other memory is corrupt"

My "expert opinion" is that your unmanaged PKCS#11 causes segfault and you will need to contact its vendor support.
However to confirm this theory you'll need to use PKCS11-LOGGER and collect logs from you WCF service.

 
i dont understend which library i must use for WCF Service

"netstandard1.3"
"net20"
"net40"
"net45"

You don't need to worry about that. You just add a reference to Pkcs11Interop nuget package in Visual Studio and that's it. Visual Studio will pick correct platform.
If you are not familiar with nuget then you can read this guide: https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio

Regards, Jaroslav

Jaroslav Imrich

unread,
Oct 30, 2018, 7:05:33 AM10/30/18
to pkcs11...@googlegroups.com, jabsona gio
Understood but we still need to see logs produced by PKCS11-LOGGER in order to continue the investigation.
BTW I'm aware of quite a few WCF services that use Pkcs11Interop and they're all working fine.

Regards, Jaroslav


On Tue, 30 Oct 2018 at 11:51, jabsona gio <giorgi.ja...@gmail.com> wrote:
this library work fine in console application (Framework 4.0) but in wcf have problem.

Jaroslav Imrich

unread,
Oct 31, 2018, 3:11:14 AM10/31/18
to pkcs11...@googlegroups.com, jabsona gio
I'm CC-ing public mailing list so this answer is added to your original post there and available for future reference to other users as well.
The last entry in your log file indicates that segfault happened in PKCS#11 library provided by your HSM vendor:

0x00004c94 : 0x00004b64 : ****************************** 2018-10-31 10:49:04 ***
0x00004c94 : 0x00004b64 : Calling C_Login
0x00004c94 : 0x00004b64 : Input
0x00004c94 : 0x00004b64 :  hSession: 1
0x00004c94 : 0x00004b64 :  userType: 1 (CKU_USER)
0x00004c94 : 0x00004b64 :  pPin: 000001BD59BF37B8
0x00004c94 : 0x00004b64 :  *pPin: *** Intentionally hidden ***
0x00004c94 : 0x00004b64 :  ulPinLen: 19

We have already discussed this SafeNet issue at https://groups.google.com/d/msg/pkcs11interop/EZxRh6eA3ww/7vMem7t5AgAJ so you will find more detailed explanation there.
You can either update your HSM software (PKCS#11 library) to newer version (that seemed to help the previous user) or contact SafeNet support for further assistance.
Hope this helps.

Regards, Jaroslav


On Wed, 31 Oct 2018 at 07:51, jabsona gio <giorgi.ja...@gmail.com> wrote:
this is my log from start to exception 

exception line:  session.Login(CKU.CKU_USER, pkcs11Pin);

Maxi Cesán

unread,
Oct 31, 2018, 9:09:43 AM10/31/18
to pkcs11...@googlegroups.com
My little opinion...
U cant use Digital Signing Server-Side.

--
You received this message because you are subscribed to the Google Groups "Pkcs11Interop" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pkcs11intero...@googlegroups.com.
To post to this group, send email to pkcs11...@googlegroups.com.
Visit this group at https://groups.google.com/group/pkcs11interop.


--
  !    Maximiliano Cesán Herrera  !   

jabsona gio

unread,
Nov 20, 2018, 3:41:59 AM11/20/18
to pkcs11...@googlegroups.com
hello Haroslav,

Gemalto support tell me that i must sent  log file   of  hsm , but when i configurated hsm log, log text does not save in HSM log file from pkcs11Interop library. 



You received this message because you are subscribed to a topic in the Google Groups "Pkcs11Interop" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pkcs11interop/DweMl7crVQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pkcs11intero...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages