Update the random PIN generator module to provide high entropy.
After this patch,
Server developer can choose the policy of random PIN generation
through SetRandomPinPolicy API.
Updated Random PIN module provides flexibility
in the PIN length and PIN type as following :
PIN length : 4 bytes ~ 32 bytes
PIN Type : Bitmask :
NUM_PIN = (0x1 << 0), //Numeric PIN
UPPERCASE_CHAR_PIN = (0x1 << 1), //uppercase character PIN
LOWERCASE_CHAR_PIN = (0x1 << 2) //lowercase character PIN
Here is example for SetRandomPinPolicy API :
//Now, Server will generate the 10 bytes PIN
//which is nummeric and lowercase mixed PIN.
if(OC_STACK_OK != SetRandomPinPolicy(10, NUM_PIN | LOWERCASE_CAHR_PIN))
{
OIC_LOG(ERROR, TAG, "Failed to setting PIN policy");
return 0;
}
Change-Id: I0f6b56a037a85a0d7c8e6d1db85f4a9808989964
Signed-off-by: Chul Lee <chuls.lee@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11607
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13825