Dear All:
     I am in working with Openssl application in WinNT. I met some questions , If some can help me?
    1. I want to use ssl connection In Winows Application.When I load my key file which is encrypted using passwood. It need i input
passwood. By default , It use console to require user inputting passwd, but I want to use my own window to get passwd,How can I replace default passwd_callback.
 
int __cdecl  key_callback(char *buf,int len,int verify)
{
 int i;
 extern char *key;
 if (key == NULL) return(0);
 i=strlen(key);
 i=(i > len)?len:i;
 memcpy(buf,key,i);
 return(i);
}
in my program:
  pkey=PEM_read_bio_PrivateKey(in,NULL,key_callback);
 
but when i compile my program,I get a error:
PEM_read_bio_PrivateKey' : cannot convert parameter 3 from 'int (char *,int,int)' to 'int (__cdecl *)(void)';
but ca.c can do it.
 
2.  Is there a way to appoint a algorith SSL used it to make session key? for example: I want 128 bit session key.
 
thanks in advance.
                                                           leo zhong

 

Reply via email to