Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CryptGenKey and CryptImportKey with existing HANDLE specified

4 views
Skip to first unread message

TemporalBeing

unread,
May 15, 2006, 7:26:42 PM5/15/06
to
I am working with a codebase that was written by another developer who
is no longer available to answer questions about it. In the code we
implement the Diffie-Hellman key exchange algorithm. I am currently
looking at DH Phase 3, and it seems he used the key handle from DH
Phase 1 when calling CryptGenKey() and again when calling
CryptImportKey() shortly after in DH Phase 3. However, the
documentation makes no note of what would happen if the HANDLE is a
valid handle. Does anyone know anything about what happens in this
case?

The codebase is quite stable, but the documentation for the
CryptGenKey() and CryptImportKey() functions just doesn't say what
should or shouldn't happen - or even if it is not guaranteed to do
anything with it. CryptGenKey() just says the pointer to the handle
will receive the HANDLE value on output; and CryptImportKey() just says
basically the same thing, though not saying anything about writing to
it. (Info from msdn.microsoft.com/library, under the Security, not
wince security docs).

Any one have any suggestions/warnings? I'm leary of reimplementing the
code in the same way that he had it. (We're cleaning up the code for a
number of reasons and its getting all rewritten.)

TIA,

Ben

0 new messages