diff options
Diffstat (limited to 'src/pki')
-rw-r--r-- | src/pki/commands/gen.c | 2 | ||||
-rw-r--r-- | src/pki/commands/keyid.c | 12 | ||||
-rw-r--r-- | src/pki/commands/print.c | 4 | ||||
-rw-r--r-- | src/pki/commands/pub.c | 2 | ||||
-rw-r--r-- | src/pki/pki.c | 8 | ||||
-rw-r--r-- | src/pki/pki.h | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/src/pki/commands/gen.c b/src/pki/commands/gen.c index b2769da54..0a6571153 100644 --- a/src/pki/commands/gen.c +++ b/src/pki/commands/gen.c @@ -20,7 +20,7 @@ */ static int gen() { - key_encoding_type_t form = KEY_PRIV_ASN1_DER; + cred_encoding_type_t form = PRIVKEY_ASN1_DER; key_type_t type = KEY_RSA; u_int size = 0; private_key_t *key; diff --git a/src/pki/commands/keyid.c b/src/pki/commands/keyid.c index c15c1193e..6d2f7b915 100644 --- a/src/pki/commands/keyid.c +++ b/src/pki/commands/keyid.c @@ -99,11 +99,11 @@ static int keyid() if (type == CRED_PRIVATE_KEY) { private = cred; - if (private->get_fingerprint(private, KEY_ID_PUBKEY_SHA1, &id)) + if (private->get_fingerprint(private, KEYID_PUBKEY_SHA1, &id)) { printf("subjectKeyIdentifier: %#B\n", &id); } - if (private->get_fingerprint(private, KEY_ID_PUBKEY_INFO_SHA1, &id)) + if (private->get_fingerprint(private, KEYID_PUBKEY_INFO_SHA1, &id)) { printf("subjectPublicKeyInfo hash: %#B\n", &id); } @@ -112,11 +112,11 @@ static int keyid() else if (type == CRED_PUBLIC_KEY) { public = cred; - if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &id)) + if (public->get_fingerprint(public, KEYID_PUBKEY_SHA1, &id)) { printf("subjectKeyIdentifier: %#B\n", &id); } - if (public->get_fingerprint(public, KEY_ID_PUBKEY_INFO_SHA1, &id)) + if (public->get_fingerprint(public, KEYID_PUBKEY_INFO_SHA1, &id)) { printf("subjectPublicKeyInfo hash: %#B\n", &id); } @@ -131,11 +131,11 @@ static int keyid() fprintf(stderr, "extracting public key from certificate failed"); return 1; } - if (public->get_fingerprint(public, KEY_ID_PUBKEY_SHA1, &id)) + if (public->get_fingerprint(public, KEYID_PUBKEY_SHA1, &id)) { printf("subjectKeyIdentifier: %#B\n", &id); } - if (public->get_fingerprint(public, KEY_ID_PUBKEY_INFO_SHA1, &id)) + if (public->get_fingerprint(public, KEYID_PUBKEY_INFO_SHA1, &id)) { printf("subjectPublicKeyInfo hash: %#B\n", &id); } diff --git a/src/pki/commands/print.c b/src/pki/commands/print.c index a86a9236d..6d5462783 100644 --- a/src/pki/commands/print.c +++ b/src/pki/commands/print.c @@ -30,11 +30,11 @@ static void print_pubkey(public_key_t *key) printf("pubkey: %N %d bits\n", key_type_names, key->get_type(key), key->get_keysize(key) * 8); - if (key->get_fingerprint(key, KEY_ID_PUBKEY_INFO_SHA1, &chunk)) + if (key->get_fingerprint(key, KEYID_PUBKEY_INFO_SHA1, &chunk)) { printf("keyid: %#B\n", &chunk); } - if (key->get_fingerprint(key, KEY_ID_PUBKEY_SHA1, &chunk)) + if (key->get_fingerprint(key, KEYID_PUBKEY_SHA1, &chunk)) { printf("subjkey: %#B\n", &chunk); } diff --git a/src/pki/commands/pub.c b/src/pki/commands/pub.c index de0444c1a..68831362b 100644 --- a/src/pki/commands/pub.c +++ b/src/pki/commands/pub.c @@ -23,7 +23,7 @@ */ static int pub() { - key_encoding_type_t form = KEY_PUB_SPKI_ASN1_DER; + cred_encoding_type_t form = PUBKEY_SPKI_ASN1_DER; credential_type_t type = CRED_PRIVATE_KEY; int subtype = KEY_RSA; certificate_t *cert; diff --git a/src/pki/pki.c b/src/pki/pki.c index 0912d5051..49174047d 100644 --- a/src/pki/pki.c +++ b/src/pki/pki.c @@ -21,20 +21,20 @@ /** * Convert a form string to a encoding type */ -bool get_form(char *form, key_encoding_type_t *type, bool pub) +bool get_form(char *form, cred_encoding_type_t *type, bool pub) { if (streq(form, "der")) { /* der encoded keys usually contain the complete SubjectPublicKeyInfo */ - *type = pub ? KEY_PUB_SPKI_ASN1_DER : KEY_PRIV_ASN1_DER; + *type = pub ? PUBKEY_SPKI_ASN1_DER : PRIVKEY_ASN1_DER; } else if (streq(form, "pem")) { - *type = pub ? KEY_PUB_PEM : KEY_PRIV_PEM; + *type = pub ? PUBKEY_PEM : PRIVKEY_PEM; } else if (streq(form, "pgp")) { - *type = pub ? KEY_PUB_PGP : KEY_PRIV_PGP; + *type = pub ? PUBKEY_PGP : PRIVKEY_PGP; } else { diff --git a/src/pki/pki.h b/src/pki/pki.h index 01b103c8f..9867eb5e0 100644 --- a/src/pki/pki.h +++ b/src/pki/pki.h @@ -29,7 +29,7 @@ /** * Convert a form string to a encoding type */ -bool get_form(char *form, key_encoding_type_t *type, bool pub); +bool get_form(char *form, cred_encoding_type_t *type, bool pub); /** * Convert a digest string to a hash algorithm |