if (uuid) {
uuid_from_string(uuid, &uu, &ret);
if (ret != uuid_s_ok) {
- printf("crap happened in uuid_from_string(%s), err = %d\n", uuid, ret);
+ printf("error in uuid_from_string(%s), err = %d\n", uuid, ret);
for (ptr = uuid2, i = 0; i < UUID_LEN; i++) {
if (uuid[i] != '-') {
*ptr = uuid[i];
ptr++;
}
}
- } else {
- printf("went well in uuid_from_string(%s), err = %d\n", uuid, ret);
}
}
if (!_memlock_count++) {
log_dbg("Locking memory.");
if (mlockall(MCL_CURRENT | MCL_FUTURE)) {
+#if 0
log_err(ctx, _("WARNING!!! Possibly insecure memory. Are you root?\n"));
+#endif
+ log_err(ctx, _("WARNING!!! Possibly insecure memory, missing mlockall()\n"));
_memlock_count--;
return 0;
}
int r;
uint32_t ret;
char luksMagic[] = LUKS_MAGIC;
+ char *uu;
uuid_t partitionUuid;
int currentSector;
int alignSectors = LUKS_ALIGN_KEYSLOTS / SECTOR_SIZE;
}
if (!uuid)
uuid_create(&partitionUuid, &ret);
- uuid_to_string(&partitionUuid, &header->uuid, &ret);
+ uuid_to_string(&partitionUuid, &uu, &ret);
+ if (uu == NULL) {
+ log_err(ctx, _("Cannot allocate memory in uuid_to_string()\n"));
+ return -1;
+ }
+ memcpy(header->uuid, uu, UUID_STRING_L);
+ free(uu);
log_dbg("Data offset %d, UUID %s, digest iterations %" PRIu32,
header->payloadOffset, header->uuid, header->mkDigestIterations);
}
r = pkcs5_pbkdf2(hash, "foo", 3, "bar", 3, ~(0U), 1, &buf, 1);
- printf("foo4: %d\n", r);
*iter = __PBKDF2_performance;
__PBKDF2_global_j = 0;
__PBKDF2_performance = 0;