Hello and problem detecting signed data files

View: New views
2 Messages — Rating Filter:   Alert me  

Hello and problem detecting signed data files

by Jean-Claude Bauer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I can't get my code working so maybe what I want to do is not
possible ? Basically I want to know if a file is a signed file.
This must be a classic problem. The way I do this with cryptlib
is:

read file into buffer
cryptlib init
create envelope
push data using buffer
-- try to find out something useful about the data
flush data
pop data
destroy envelope
cryptlib end

With the idea that cryptlib will "parse" the object and I will be able
to look at its characteristics afterwards. If it is in CMS format
I should be able to do something with it. If not then there should be
some way to determine that its format is incorrect. (dismissing
the case where garbage happens to make sense).

If I create the envelope with CRYPT_FORMAT_AUTO,I get the error BAD_DATA
when I push the data for any file I try (certs in test for example or
anything actually).

When I use CRYPT_FORMAT_CRYPTLIB I can create the envelope and push data
with no errors. After pushing the data I try any operation with
attributes using the envelope but none of them work. For example
GetAttribute with CRYPT_ATTRIBUTE_CURRENT fails with bad second parameter.

Because what I want to do seems to me a classical problem I feel that
I am just not doing things in the right order or with the right parameters.
For example, the buffer I use is malloced, is that ok ? I cast it into a
(const void *) when passing to PushData, I understand that to be an
abstraction type thing.

I can provide my code if useful.

Thanks for any help.

best regards

Jean-Claude Bauer


_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.

Re: Hello and problem detecting signed data files

by Peter Gutmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jean-Claude Bauer <Jean-Claude.Bauer@...> writes:

>I can provide my code if useful.

Code would be useful.  Are you pushing in CMS data exactly as stored, e.g. not
reading it in in text-mode or something similar?  Also, what's the extended
status information CRYPT_ATTRIBUTE_INT_ERRORCODE and
CRYPT_ATTRIBUTE_INT_ERRORMESSAGE?

Peter.

_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.