#include <openssl/evp.h>
 #include <openssl/rsa.h>

main()
{

 EVP_PKEY_CTX *ctx;
 unsigned char *skey;
 size_t skeylen;
 EVP_PKEY *pkey, *peerkey;
 /* NB: assumes pkey, peerkey have been already set up */

 ctx = EVP_PKEY_CTX_new(pkey,NULL);
 if (!ctx)
        /* Error occurred */
 if (EVP_PKEY_derive_init(ctx) <= 0)
        /* Error */
 if (EVP_PKEY_derive_set_peer(ctx, peerkey) <= 0)
        /* Error */

 /* Determine buffer length */
 if (EVP_PKEY_derive(ctx, NULL, &skeylen) <= 0)
        /* Error */

 skey = OPENSSL_malloc(skeylen);

 if (!skey)
        /* malloc failure */

 if (EVP_PKEY_derive(ctx, skey, &skeylen) <= 0)
        ;
}


I write a code like this. but when i compile it show's error "Undefined
EVP_PKEY_derive".
what is the reason for that?



--
View this message in context: 
http://openssl.6102.n7.nabble.com/Error-for-EVP-PKEY-CTX-new-tp49217.html
Sent from the OpenSSL - User mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to