{
*location++ = OCGetRandomByte();
}
+ uint8_t *temp = (char *) OICCalloc(len, sizeof(char));
+ int *mask = (int *) OICCalloc(len, sizeof(int));
+ int i, j, rand_idx;
+ for (i = 0; i < len; i++)
+ {
+ mask[i] = 0;
+ }
+ j = 0;
+ for (i = 0; i < len; i++)
+ {
+ rand_idx = lrand48() % len;
+ while((rand_idx < len) && (mask[rand_idx] != 0))
+ {
+ rand_idx++;
+ }
+ if(rand_idx == len)
+ {
+ rand_idx = 0;
+ while(mask[rand_idx] != 0)
+ {
+ rand_idx++;
+ }
+ }
+ temp[rand_idx] = location[j];
+ mask[rand_idx] = 1;
+ j++;
+ }
+ for (i = 0; i < len; i++)
+ {
+ location[i] = temp[i];
+ }
+ OICFree(temp);
+ OICFree(mask);
}
uint32_t OCGetRandom()
OIC_LOG_V(DEBUG, TAG, "token len:%d, token:", tokenLength);
OIC_LOG_BUFFER(DEBUG, TAG, (const uint8_t *)(*token), tokenLength);
-
return CA_STATUS_OK;
}