Re: RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Jayashree Kanchana
Hi, My structure has 3 unsigned char arrays and I will have to move this encrypted data to other machines too. Following is the structure: typedef struct myStruct { unsigned char id[4]; unsigned char type; unsigned char Data[128]; } ; Can you pleas

Re: RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Michael Sierchio
Charles B Cranston wrote: Casting does not actually change the data, only the way in which it is treated by the program. Casting changes the way data are treated by the compiler. There is no string type in C, the semantics of nul-terminated strings are created in the behavior of certain functions.

RE : RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Marc Gaudichet
I think that your code should look like the following (not tested) : struct MyStruct { int iMyInt; float fMyFloat; char szMyString[5]; long lMyLong } int main () { struct MyStruct sStruct; unsigned char szEncrypted[...]; RSA Rsa; i

Re: RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Charles B Cranston
One danger with casting a structure as a string is that zero bytes (which can happen due to "slack bits" in the structure) might be interpreted as an end-of-string that would prematurely terminate the data. If you're going to process binary data, look for an API where you specify both a pointer and

Re: RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Jayashree Kanchana
Hi Marc, I am sorry, I am not sure how I can type cast the structure to string, should I do (char *) ? Once I encrypt I am not sure if the encrypted string has the same structure as the original "structure". Can you please show me the synatx to type cast a structure to string. Thanks, Jayashree

Re: RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Steven Bade
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jayashree Kanchana wrote: | Hi, | | I am hoping that someone might have come across this problem and will be | able to help me. | | I am trying to use openssl to encrypt a "c structure" instead of just a | "string", is there any function in openssl that

RE : RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Marc Gaudichet
Maybe you could cast the contents of your structure to a string, encrypt this string and then cast the string back to your structure type. Marc. > -Message d'origine- > De : Jayashree Kanchana [mailto:[EMAIL PROTECTED] > Envoyé : mardi 3 août 2004 16:00 > À : [EMAIL PROTECTED] > Objet :

RSA encryption - to encrypt a c structure ??

2004-08-03 Thread Jayashree Kanchana
Hi, I am hoping that someone might have come across this problem and will be able to help me. I am trying to use openssl to encrypt a "c structure" instead of just a "string", is there any function in openssl that I could use? I have a RSA key structure that is already created and I am able to e

Re: Storing keys and certs on USB tokens using openssl(1)

2004-08-03 Thread Ralf Hornik Mailings
>> http://www.opensc.org/files/doc/opensc.html#opensc.using.openssl > > btw: what kind of usb token do you have ? Aladdin eToken pro 32k. Opensc now recognices my USB token. When I try to load the engine I get: mtag03:/home/rho/et2k/opensc-0.8.1 # openssl OpenSSL> engine dynamic -pre SO_PATH:/us

Problems using X509_get_ext_d2i()

2004-08-03 Thread lbfi
Hi all! I'm trying to scratch a distpoint from an X509 certificate. When I use this code, STACK_OF(DIST_POINT) * distpoints = NULL; distpoints = X509_get_ext_d2i(x, NID_crl_distribution_points, NULL, NULL); an error occurs: invalid conversion from `void*' to `STACK* Someone can help me? Thank

Re: What binary data format is used by openssl enc?

2004-08-03 Thread Dr. Stephen Henson
On Mon, Aug 02, 2004, Alicia da Conceicao wrote: > Hi Steve: > > > Its not ASN1 because the OpenSSL ASN1 code isn't fully streaming and to do so > > would be a massive undertaking which has so far not attracted any interest. > > The data following the salt is the raw encrypted data using standard

Re: How to convert a buffer to an intern structure???

2004-08-03 Thread Juan Segarra
You can use a memory bio and then the appropiate PEM I/O function. Something like: BIO *bioMem; char *keyBuffer; X509 *cert; /* Read de buffer (bla,bla,bla) :-) */ /* And now... */ bioMem =3D BIO_new_mem_buf(keyBuffer, keyBufferLen); cert =3D PEM_read_bio_X509(bioMem,NULL,NULL,NULL); --- Juan

TLS : finished hanshake query

2004-08-03 Thread Avinash Agarwal
Hello all, I had a query wrt the finished handshake message that the server sends in the TLS protocol. I'm using openssl-0.9.6g. When the server sends the Handshake finished message , in the ethereal dump the Finished handshake message is shown as "Encrypted Handshake Message" with Length as 32 b

Re: Storing keys and certs on USB tokens using openssl(1)

2004-08-03 Thread Nils Larsch
Ralf Hornik Mailings wrote: Yes, I know, but I don't find any pointer to this engines. Even, there is no pkcs11 or opensc word in the complete openssl-source! Do I have to include the hw_* files from opensc manually? What engine id will it be? Has anyone done this in practice? Found the solution m

Re: Storing keys and certs on USB tokens using openssl(1)

2004-08-03 Thread Ralf Hornik Mailings
> Yes, I know, but I don't find any pointer to this engines. Even, there is > no pkcs11 or opensc word in the complete openssl-source! > > Do I have to include the hw_* files from opensc manually? What engine id > will it be? Has anyone done this in practice? Found the solution myself! :-) http:/

Re: Storing keys and certs on USB tokens using openssl(1)

2004-08-03 Thread Ralf Hornik Mailings
> Keys at least: there's an openssl engine for opensc aKeys at least: > there's > an openssl engine for opensc and one for pkcs11 libraries at > www.opensc.org Yes, I know, but I don't find any pointer to this engines. Even, there is no pkcs11 or opensc word in the complete openssl-source! Do I