Hi All,

I have a short program that I wrote. All the functions compile/link,
except the EVP_aes_256_cbc(), which compiles, but doesn't link. I
checked to see that there are aes supported by the openssl I'm using
(0.9.7g) and it looks like it's supported. I did [openssl ciphers
'AES'] on the command line.

The short program I wrote is below:

#include
#include

void
Generate_Random_Val( unsigned char* val, int size )
{
RAND_bytes( val, size );
}

int
seed_prng( int bytes )
{
if( !(RAND_load_file( "/dev/random", bytes) ) )
{
return 0;
}
return 1;
}

int
main()
{
if( !(seed_prng( 1024 ) )
{
return 1;
}
unsigned char key[MAX_EVP_KEY_LENGTH]
Generate_Random_Val( key, MAX_EVP_KEY_LENGTH);
unsigned char iv[MAX_EVP_IV_LENGTH];
Generate_Random_Val(iv, MAX_EVP_IV_LENGTH];

EVP_CIPHER_CTX ctx;
EVP_EncryptInit( &ctx, EVP_aes_256_cbc(), key, iv );

return 0;
}


To build this I'm using the following:
cc -g -L/usr/local/ssl/lib -lssl -lcrypto -I/usr/local/ssl/include
-I//usr/include functions.cpp

Ther error I get is

Undefined symbol first referenced in file
EVP_aes_128_cbc functions.o
ld:fatal: Symbol referencing errors. No output written to a.out

I also tried using EVP_get_cipherbyname("aes-256-cbc") and that didn't
work either. I tried different aes ciphers, but they didn't work
either. I'm at a lost.

Any input will be appreciated.

Thanks,
Melinda