Fix segmentation_fault on shss with no priv_args

This commit is contained in:
Kota Tsuyuzaki 2015-02-27 14:54:14 +09:00
parent 4ca25e9629
commit 9e5f83b32a
1 changed files with 6 additions and 1 deletions

View File

@ -229,8 +229,13 @@ static void * shss_init(struct ec_backend_args *args, void *backend_sohandle)
/* Sample on how to pass extra args to the backend */
// TODO: Need discussion how to pass extra args.
// tentatively we could pass with priv_args2 as the bit_length
int *priv = (int *)args->uargs.priv_args2;
desc->aes_bit_length = priv[0]; // AES bit number
if(priv != NULL){
desc->aes_bit_length = priv[0]; // AES bit number
}else{
desc->aes_bit_length = 128;
}
union {
shss_encode_func encodep;