// Compare if (memcmp(tpm_pubkey, stored_pubkey, pubkey_len) != 0) // MISMATCH – force re-enrollment log_error("TPM public key mismatch – re-enrolling"); secure_storage_write("device_pubkey", tpm_pubkey); return enroll_device(ctx);
The core issue is:
// Load stored public key from secure storage ret = secure_storage_read("device_pubkey", stored_pubkey, sizeof(stored_pubkey)); if (ret == STORAGE_NOT_FOUND) // First enrollment – just store and proceed secure_storage_write("device_pubkey", tpm_pubkey); return enroll_device(ctx); // Compare if (memcmp(tpm_pubkey, stored_pubkey, pubkey_len)
Join our mailing list to receive the latest news and updates from our team.
Join our mailing list to receive the latest news and updates from our team.
Join our mailing list to receive the latest news and updates from our team.
Join our mailing list to receive the latest news and updates from our team.