summaryrefslogtreecommitdiff
path: root/futility
diff options
context:
space:
mode:
Diffstat (limited to 'futility')
-rw-r--r--futility/cmd_create.c29
-rw-r--r--futility/vb2_helper.c14
2 files changed, 21 insertions, 22 deletions
diff --git a/futility/cmd_create.c b/futility/cmd_create.c
index 32eed50a..db668b2c 100644
--- a/futility/cmd_create.c
+++ b/futility/cmd_create.c
@@ -12,7 +12,7 @@
#include "2sysincludes.h"
#include "2common.h"
-#include "2guid.h"
+#include "2id.h"
#include "2rsa.h"
#include "util_misc.h"
#include "vb2_common.h"
@@ -29,7 +29,7 @@ enum {
OPT_OUTFILE = 1000,
OPT_VERSION,
OPT_DESC,
- OPT_GUID,
+ OPT_ID,
OPT_HASH_ALG,
};
@@ -40,13 +40,13 @@ static char *infile, *outfile, *outext;
static uint32_t opt_version = DEFAULT_VERSION;
enum vb2_hash_algorithm opt_hash_alg = DEFAULT_HASH;
static char *opt_desc;
-static struct vb2_guid opt_guid;
-static int force_guid;
+static struct vb2_id opt_id;
+static int force_id;
static const struct option long_opts[] = {
{"version", 1, 0, OPT_VERSION},
{"desc", 1, 0, OPT_DESC},
- {"guid", 1, 0, OPT_GUID},
+ {"id", 1, 0, OPT_ID},
{"hash_alg", 1, 0, OPT_HASH_ALG},
{NULL, 0, 0, 0}
};
@@ -70,7 +70,7 @@ static void print_help(const char *progname)
entry->num, entry->name,
entry->num == VB2_HASH_SHA256 ? " (default)" : "");
printf(
-" --guid <guid> Identifier for this keypair (vb21 only)\n"
+" --id <id> Identifier for this keypair (vb21 only)\n"
" --desc <text> Human-readable description (vb21 only)\n"
"\n");
@@ -239,15 +239,15 @@ static int vb2_make_keypair()
}
/* Update the IDs */
- if (!force_guid) {
+ if (!force_id) {
uint8_t *digest = DigestBuf(keyb_data, keyb_size,
SHA1_DIGEST_ALGORITHM);
- memcpy(&opt_guid, digest, sizeof(opt_guid));
+ memcpy(&opt_id, digest, sizeof(opt_id));
free(digest);
}
- privkey->guid = opt_guid;
- memcpy((struct vb2_guid *)pubkey->guid, &opt_guid, sizeof(opt_guid));
+ privkey->id = opt_id;
+ memcpy((struct vb2_id *)pubkey->id, &opt_id, sizeof(opt_id));
/* Write them out */
strcpy(outext, ".vbprik2");
@@ -299,14 +299,13 @@ static int do_create(int argc, char *argv[])
opt_desc = optarg;
break;
- case OPT_GUID:
- if (VB2_SUCCESS != vb2_str_to_guid(optarg,
- &opt_guid)) {
- fprintf(stderr, "invalid guid \"%s\"\n",
+ case OPT_ID:
+ if (VB2_SUCCESS != vb2_str_to_id(optarg, &opt_id)) {
+ fprintf(stderr, "invalid id \"%s\"\n",
optarg);
errorcnt = 1;
}
- force_guid = 1;
+ force_id = 1;
break;
case OPT_HASH_ALG:
diff --git a/futility/vb2_helper.c b/futility/vb2_helper.c
index b3349af2..686b8333 100644
--- a/futility/vb2_helper.c
+++ b/futility/vb2_helper.c
@@ -9,7 +9,7 @@
#include "2sysincludes.h"
#include "2common.h"
-#include "2guid.h"
+#include "2id.h"
#include "2rsa.h"
#include "util_misc.h"
#include "vb2_common.h"
@@ -88,10 +88,10 @@ int futil_cb_show_vb2_pubkey(struct futil_traverse_state_s *state)
printf(" Hash Algorithm: %d %s\n", key.hash_alg,
entry ? entry->name : "(invalid)");
printf(" Version: 0x%08x\n", key.version);
- printf(" GUID: ");
- vb2_print_bytes(key.guid, sizeof(*key.guid));
+ printf(" ID: ");
+ vb2_print_bytes(key.id, sizeof(*key.id));
printf("\n");
- if (sha1sum && memcmp(key.guid, sha1sum, sizeof(*key.guid))) {
+ if (sha1sum && memcmp(key.id, sha1sum, sizeof(*key.id))) {
printf(" Key sha1sum: ");
vb2_print_bytes(sha1sum, SHA1_DIGEST_SIZE);
printf("\n");
@@ -135,10 +135,10 @@ int futil_cb_show_vb2_privkey(struct futil_traverse_state_s *state)
entry = vb2_lookup_by_num(vb2_text_vs_hash, key->hash_alg);
printf(" Hash Algorithm: %d %s\n", key->hash_alg,
entry ? entry->name : "(invalid)");
- printf(" GUID: ");
- vb2_print_bytes(&key->guid, sizeof(key->guid));
+ printf(" ID: ");
+ vb2_print_bytes(&key->id, sizeof(key->id));
printf("\n");
- if (sha1sum && memcmp(&key->guid, sha1sum, sizeof(key->guid))) {
+ if (sha1sum && memcmp(&key->id, sha1sum, sizeof(key->id))) {
printf(" Key sha1sum: ");
vb2_print_bytes(sha1sum, SHA1_DIGEST_SIZE);
printf("\n");