RE: struct problem

2006-03-29 Thread David Schwartz
> Thank! > but how can I use EVP_get_cipherbyname(const char *name);? > > ciphers[0].cipher = EVP_get_cipherbyname("BLABLABLABLA"); > perror("EVP_get_cipherbyname()"); > > ./evp > EVP_get_cipherbyname(): Success > > And always: success :-) but doesn't work. Why are you calling 'perror'?

Re: struct problem

2006-03-29 Thread Dr. Stephen Henson
On Wed, Mar 29, 2006, Nagy Zoltn Mrk wrote: > ohh sorry... > in the last example: > but, if i use: > { > const EVP_CIPHER *c; > c = EVP_get_cipherbyname("aes-128-cbc"); > EVP_EncryptInit(&ctx, c, key, NULL); > } > doesn't work > (segmentation fault) > Check to see if "c" is NULL before using it.

Re: struct problem

2006-03-29 Thread Nagy Zoltán Márk
ohh sorry... in the last example: but, if i use: { const EVP_CIPHER *c; c = EVP_get_cipherbyname("aes-128-cbc"); EVP_EncryptInit(&ctx, c, key, NULL); } doesn't work (segmentation fault) mark > hi! > > if i use: > { > EVP_EncryptInit(&ctx, EVP_aes_128_cbc(), key, NULL); > } > is work > > if i use:

Re: struct problem

2006-03-29 Thread Nagy Zoltán Márk
hi! if i use: { EVP_EncryptInit(&ctx, EVP_aes_128_cbc(), key, NULL); } is work if i use: { const EVP_CIPHER *c; c = EVP_aes_128_cbc(); EVP_EncryptInit(&ctx, c, key, NULL); } is work but, if i use: { const EVP_CIPHER *c; c = EVP_get_cipherbyname("aes-128-cbc"); EVP_EncryptInit(&ctx, EVP_aes_128_c

Re: struct problem

2006-03-29 Thread Nagy Zoltán Márk
Thank! but how can I use EVP_get_cipherbyname(const char *name);? ciphers[0].cipher = EVP_get_cipherbyname("BLABLABLABLA"); perror("EVP_get_cipherbyname()"); ./evp EVP_get_cipherbyname(): Success And always: success :-) but doesn't work. King regards, mark > That wont work in many cases beca

Re: struct problem

2006-03-29 Thread Dr. Stephen Henson
On Wed, Mar 29, 2006, Nagy Zoltn Mrk wrote: > Dear all > > I would like to create a data structure in C. > Below you can see what I have created, but it doesn't work correctly. > My question is: why doesn't initialised EVP_aes_128_cbc() into cipher? > > #define ORANGE 0xffa500 > > struct cipher

Re: struct problem

2006-03-29 Thread Nagy Zoltán Márk
no no no...name and description working correctly.struct ciphers_name ciphers[] ={   { "aes128cbc","AES 128bit CBC",EVP_aes_128_cbc(),ORANGE}};EVP_aes_128_cbc() not working correctly, but i dont known why? mark The unsigned char *name and *description are pointers, not storage arrays. For this to w

Re: struct problem

2006-03-29 Thread Steve . Pauly
The unsigned char *name and *description are pointers, not storage arrays. For this to work, you would need: struct ciphers_name {   unsigned char name[NAME_LEN];   unsigned char description[DESC_LEN];   const EVP_CIPHER *cipher;   unsigned int color; }; Steven Pauly Pitney Bowes GMS [EMAIL