Click here to Skip to main content
15,892,643 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Visual c++ 6 doesn't show variables Pin
Stuart Dootson15-Jul-09 21:57
professionalStuart Dootson15-Jul-09 21:57 
AnswerRe: Visual c++ 6 doesn't show variables Pin
Iain Clarke, Warrior Programmer15-Jul-09 7:31
Iain Clarke, Warrior Programmer15-Jul-09 7:31 
AnswerRe: Visual c++ 6 doesn't show variables Pin
Joe Woodbury15-Jul-09 20:09
professionalJoe Woodbury15-Jul-09 20:09 
GeneralRe: Visual c++ 6 doesn't show variables Pin
mariano_7617-Jul-09 3:04
mariano_7617-Jul-09 3:04 
GeneralRe: Visual c++ 6 doesn't show variables Pin
Joe Woodbury17-Jul-09 6:04
professionalJoe Woodbury17-Jul-09 6:04 
QuestionCryptography trying to set hash (message digest) to encoded message using Crypto API Pin
Lilach4215-Jul-09 5:31
Lilach4215-Jul-09 5:31 
AnswerRe: Cryptography trying to set hash (message digest) to encoded message using Crypto API Pin
Randor 15-Jul-09 13:19
professional Randor 15-Jul-09 13:19 
GeneralRe: Cryptography trying to set hash (message digest) to encoded message using Crypto API Pin
Lilach4219-Jul-09 13:22
Lilach4219-Jul-09 13:22 
Hi David,

I added a call to CryptMsgUpdate() as you suggested. The problem is that when I decode the resulted message, the content contains different message digest. In fact, I think it is the digest of an empty message.

Here is the message digest I got:
DA 39 A3 EE 5E 6B 4B 0D 32 55 BF EF 95 60 18 90 AF D8 07 09

Here is the relevant code:

CMSG_SIGNED_ENCODE_INFO signedEncodedInfo;
HCRYPTPROV hHash = NULL;

// ... here singedEncodedInfo is initiated

// create a hash object.
if (!CryptCreateHash(d_hCryptProv, CALG_SHA1, 0, 0, &hHash))
{
throw( GetLastError());
}

// set hash data to hash handle
// pHashBytes is a pointer to bytes array containing
// hashed data
if (!CryptSetHashParam(hHash, HP_HASHVAL, pHashBytes, 0))
{
throw(GetLastError());
}

// initiate encoded message
d_hMsg = CryptMsgOpenToEncode(MY_ENCODING_TYPE,
CMSG_DETACHED_FLAG | MSG_AUTHENTICATED_ATTRIBUTES_FLAG,
MSG_SIGNED,
&SignedEncodedInfo,
0,
NULL);

if (!CryptMsgUpdate( d_hMsg, NULL, 0, TRUE ))
{
throw(GetLastError());
}

Do you have an idea what is wrong?

Thanks,
Lilach
QuestionRe: Cryptography trying to set hash (message digest) to encoded message using Crypto API Pin
Randor 21-Jul-09 5:20
professional Randor 21-Jul-09 5:20 
QuestionHow to add controls to a splitted pane using CSSplitter class in a CDialog. (Or if you know a better class) [modified] Pin
Netc15-Jul-09 4:41
Netc15-Jul-09 4:41 
QuestionMount file to a folder Pin
gospel56715-Jul-09 4:14
gospel56715-Jul-09 4:14 
AnswerRe: Mount file to a folder Pin
Michael Schubert15-Jul-09 4:58
Michael Schubert15-Jul-09 4:58 
GeneralRe: Mount file to a folder Pin
gospel56715-Jul-09 5:10
gospel56715-Jul-09 5:10 
AnswerRe: Mount file to a folder Pin
Stuart Dootson15-Jul-09 5:32
professionalStuart Dootson15-Jul-09 5:32 
GeneralRe: Mount file to a folder Pin
gospel56715-Jul-09 5:59
gospel56715-Jul-09 5:59 
GeneralRe: Mount file to a folder Pin
Randor 15-Jul-09 13:37
professional Randor 15-Jul-09 13:37 
AnswerRe: Mount file to a folder Pin
«_Superman_»15-Jul-09 6:04
professional«_Superman_»15-Jul-09 6:04 
AnswerRe: Mount file to a folder Pin
Richard Andrew x6415-Jul-09 6:18
professionalRichard Andrew x6415-Jul-09 6:18 
QuestionRegOpenKeyEx fetching value after logoff Pin
hackcrackvirus15-Jul-09 4:10
hackcrackvirus15-Jul-09 4:10 
AnswerRe: RegOpenKeyEx fetching value after logoff Pin
David Crow15-Jul-09 4:42
David Crow15-Jul-09 4:42 
QuestionHow to change the access properties of a drive Pin
Nekkantidivya15-Jul-09 4:03
Nekkantidivya15-Jul-09 4:03 
AnswerRe: How to change the access properties of a drive Pin
Stuart Dootson15-Jul-09 4:13
professionalStuart Dootson15-Jul-09 4:13 
GeneralRe: How to change the access properties of a drive Pin
Nekkantidivya15-Jul-09 5:01
Nekkantidivya15-Jul-09 5:01 
GeneralRe: How to change the access properties of a drive Pin
Stuart Dootson15-Jul-09 5:29
professionalStuart Dootson15-Jul-09 5:29 
GeneralRe: How to change the access properties of a drive Pin
Anil Veeraghattapu 415-Jul-09 6:19
Anil Veeraghattapu 415-Jul-09 6:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.