Merge branch 'clientid'

This commit is contained in:
Iwan Timmer
2021-04-21 19:40:44 +02:00

View File

@@ -87,11 +87,8 @@ static int load_unique_id(const char* keyDirectory) {
FILE *fd = fopen(uniqueFilePath, "r"); FILE *fd = fopen(uniqueFilePath, "r");
if (fd == NULL) { if (fd == NULL) {
unsigned char unique_data[UNIQUEID_BYTES]; snprintf(unique_id,UNIQUEID_CHARS+1,"0123456789ABCDEF");
RAND_bytes(unique_data, UNIQUEID_BYTES);
for (int i = 0; i < UNIQUEID_BYTES; i++) {
sprintf(unique_id + (i * 2), "%02x", unique_data[i]);
}
fd = fopen(uniqueFilePath, "w"); fd = fopen(uniqueFilePath, "w");
if (fd == NULL) if (fd == NULL)
return GS_FAILED; return GS_FAILED;