Re: Wrapper CSP
From: Doug Barlow (soft_pedal_at_hotmail.com)
Date: 09/23/05
- Previous message: Anne Kästner: "Re: MSV1_0 while Kerberos expected"
- In reply to: sbardhan_at_adelphia.net: "Wrapper CSP"
- Next in thread: sbardhan_at_adelphia.net: "Re: Wrapper CSP"
- Reply: sbardhan_at_adelphia.net: "Re: Wrapper CSP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 23 Sep 2005 09:07:07 -0700
a) A 0x57 return means your CSP had an exception violation; CryptoAPI
caught it, and blamed it on the caller, assuming they passed a bad buffer.
I get these error codes a lot when I forget to take hardcoded breakpoints
out of my new CSP code, and run the CSP outside of the debugger for the
first time.
b) Creating your own context structure lets you maintain information that
your CSP needs to do its job. If it doesn't need to maintain any
information, then there's no need to create your own structure.
c) I've done both, and they both work fine. I tend to use the Crypt*
calls, so that my CSP is independent of any changes Microsoft may make in
the underlying infrastructure (like the name of the DLL, or where to find
the name of the DLL). On the other hand, the CP* calls save one level of
indirection, and add a bit of speed to your implementation. (Not much, but
some.)
Doug Barlow
The Soft Pedal Shop
CSP Design & Development Consulting
http://www.SoftPedal.net
-- <sbardhan@adelphia.net> wrote in message news:1127424231.043023.207800@g14g2000cwa.googlegroups.com... >I am supposed to write a custom CSP and was thinking of starting with > wrapping rsaenh.dll by doing a loadLibrary from within my code and then > calling the appropriate function (CPxx). I have read several posts on > this subject and very very helpful pointers by Laszlo Elteto including > his XP advapi32.dll patching instructions!!! > > a) I think I have got most of the preparation work like signing etc > done. But when I run the SDK sample test program and point to my CSP > which calles rsaenh.dll, I get back a 57 (parameter wrong) from within > the base CSP. Anybody faced this? > > b) My trivial (not that trivial after all since I cant get this to > work) CSP dll, simply passes the parameters down to the MS CSP. In a > post Laszlo has mentioned that I need to create my own context and pass > that back to the client and hold on to the MS CSP context. What is the > reason for that? > > c) I am seeing 2 general ideas of doing the wrapper. Call CryptXXX from > within my CPxxx or call CPxxx (of Base CSP) from my CPxxx. Which is the > correct one? Is one preferred over the other? > > Thanks for any pointes. >
- Previous message: Anne Kästner: "Re: MSV1_0 while Kerberos expected"
- In reply to: sbardhan_at_adelphia.net: "Wrapper CSP"
- Next in thread: sbardhan_at_adelphia.net: "Re: Wrapper CSP"
- Reply: sbardhan_at_adelphia.net: "Re: Wrapper CSP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|