RE: How to debug a custom CSP?

From: lelteto (lelteto_at_discussions.microsoft.com)
Date: 02/03/05


Date: Thu, 3 Feb 2005 00:47:02 -0800

When you say 'signed the CSP" I assume it's not signed by Microsoft but
test-signed (by you). In newer Windows versions that will not help, ie.
Windows will not load your CSP - unless a Kernel debugger is loaded on your
system. Note that it is not required to USE the kernel debugger - you can use
your app-level debugger - only that it is present on your system.
An alternative solution is to patch advapi32.dll to disable this checking.
Search for posts in this forum with keyword "advapi32" and you will find
posts for various versions of that dll to be patched for CSP testing.

Laszlo Elteto
SafeNet, Inc.

"Phoebe" wrote:

> I am writing a custom CSP in Visual C++ win2k sp4. I want to debug the DLL
> under VC++ environment. How do I do it?
>
> I have tried the following steps, but they don't work at all. Do I need to
> use Kernel debugger to debug CSP DLL?
> 1. sign the csp.dll
> 2. Right click the project, in the project properties page dialog
> Choose "Configuration Properties\Debugging", and input the client EXE name
> in the "Command" edit box.
> 3. Set a breakpoint in the function CPAcquireContext in csp.dll
> 4. Right click the project again. Select Debug->start new instance. The
> client EXE is running. The CryptAcquireContext is called in the client EXE.
> 5. However the breakpoint in CPAcquireContext of csp.dll never get hit.
>
> Could you shed some lights how to debug CSP dll? Thank you very much
>
> Phoebe
>
>
>



Relevant Pages

  • Re: debugging CSP in kernel debuggin mode
    ... The livekd utility that was shipped with Inside Windows 2000 is also ... >> You need a second computer with a serial cable attached to run a kernel ... > kernel debugger (just to avoid csp signature verification process). ...
    (microsoft.public.platformsdk.security)
  • Re: Coredll patch Windows CE 4.21
    ... you first create a Windows CE project based on the ARM emulator. ... Debugging a CSP is similar to debugging ... windows ce images/apps using platform builder and arm emulator. ... > the platform builder and activating the flag "Enable Kernel Debugger" ...
    (microsoft.public.windowsce.platbuilder)
  • RE: How to install and test custom CSP
    ... I use WinDbg's kernel mode on two computers, host and target, ... and I can use un-signed CSP on target computer. ... "hamilton" wrote: ... the SAME machine as the kernel debugger is running. ...
    (microsoft.public.platformsdk.security)
  • Re: How to connect to the target system to debug CSP
    ... Have you configured the Kernel Debugger on the other machine? ... then set Baud rate and COM port and then restart the other machine. ... > of my CSP or CSP test suite). ... > I have set the communication between both systems and both are XP SP1. ...
    (microsoft.public.platformsdk.security)
  • Re: advapi32.dll patch for Win2003 SP1
    ... You don't have to actually USE the Kernel debugger - you are free to use your ... be LOADED in order to allow your CSP be used by the system. ... > to use the kernel debugger when I test unsigned CSPs. ...
    (microsoft.public.platformsdk.security)