Hi,
I tried modifying the code and now I get a segmentation fault on this line:

err = EVP_CipherUpdate (&ctx, enc_buff, &bytes_enc, message, strlen(message));

Here is the code:

#include <stdio.h>

#include <string.h>

#include <openssl/x509.h>

#include <openssl/evp.h>

#include <openssl/err.h>

int main()

{

EVP_CIPHER_CTX ctx;

X509_ALGOR *alg=NULL;

unsigned char *passwd = "password";

unsigned char *message = "Test message";

unsigned char *salt = "salt";

int bytes_enc, bytes_final, bytes_dec, err;

unsigned char *dec_buff = NULL, *enc_buff = NULL;

OpenSSL_add_all_algorithms();

ERR_load_crypto_strings();

alg = PKCS5_pbe2_set (EVP_des_ede3_cbc(), 1024, salt, strlen(salt));

if (alg == NULL)

{

ERR_print_errors_fp(stderr);

exit(1);

}

err = EVP_PBE_CipherInit (alg->algorithm, passwd, strlen(passwd), alg->parameter, &ctx, 1);

if ( err == 0 )

{

ERR_print_errors_fp(stderr);

exit(1);

}

}
 
Any suggestions,
 
Joe

"Dr. Stephen Henson" <[EMAIL PROTECTED]> wrote:
On Fri, Jul 16, 2004, Joe smith wrote:

> Hi:

[code snipped]

> But i am getting the following error:
>
> 1536:error:06074079:lib(6):func(116):reason(121):evp_pbe.c:89:TYPE=PBES2
>
> Any suggestions?
>

The FAQ? This is another incarnation of:

http://www.openssl.org/support/faq.html#PROG6
http://www.openssl.org/support/faq.html#PROG7

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Funding needed! Details on homepage.
Homepage: http://www.drh-consultancy.demon.co.uk
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]


Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!

Reply via email to