From 760cd1cfbd6149d9115d9d55e6a98efe66df891e Mon Sep 17 00:00:00 2001 From: Viktor Tarasov Date: Sun, 23 Sep 2012 16:51:25 +0200 Subject: [PATCH] pkcs15-tool: non-initialised OID --- src/tools/pkcs15-tool.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tools/pkcs15-tool.c b/src/tools/pkcs15-tool.c index f3385f2c..e95d915f 100644 --- a/src/tools/pkcs15-tool.c +++ b/src/tools/pkcs15-tool.c @@ -654,9 +654,7 @@ static int read_public_key(void) if (r >= 0) { if (verbose) printf("Reading certificate with ID '%s'\n", opt_pubkey); - r = sc_pkcs15_read_certificate(p15card, - (sc_pkcs15_cert_info_t *) obj->data, - &cert); + r = sc_pkcs15_read_certificate(p15card, (sc_pkcs15_cert_info_t *) obj->data, &cert); } if (r >= 0) pubkey = cert->key; @@ -2071,6 +2069,7 @@ static int pubkey_pem_encode(sc_pkcs15_pubkey_t *pubkey, sc_pkcs15_der_t *key, s size_t key_len; memset(&algorithm, 0, sizeof(algorithm)); + sc_init_oid(&algorithm.oid); algorithm.algorithm = pubkey->algorithm; if (algorithm.algorithm == SC_ALGORITHM_GOSTR3410) algorithm.params = &pubkey->u.gostr3410.params;