Cetching segfault, if no password for pem key given.
FossilOrigin-Name: a996a773e8001040020a438ab2a71ba646f1dff16b886989d1f9a189e00514e9
This commit is contained in:
parent
ce01c6327e
commit
04fa8f58f9
@ -50,9 +50,14 @@ static void dtls_debug_cb(int write_p,int version,int type, const void * buf,siz
|
||||
|
||||
int pem_passwd_cb(char *buf, int size, int rwflag, void *password)
|
||||
{
|
||||
strncpy(buf, (char *)(password), size);
|
||||
buf[size - 1] = '\0';
|
||||
return(strlen(buf));
|
||||
if (!password){
|
||||
cw_dbg(DBG_DTLS, "DTLS - No password given to decrypt privat key");
|
||||
return 0;
|
||||
}
|
||||
|
||||
strncpy(buf, (char *)(password), size);
|
||||
buf[size - 1] = '\0';
|
||||
return(strlen(buf));
|
||||
}
|
||||
|
||||
/* Set up ephemeral RSA stuff */
|
||||
|
Loading…
Reference in New Issue
Block a user