diff options
Diffstat (limited to 'crypto/heimdal/lib/hx509')
-rw-r--r-- | crypto/heimdal/lib/hx509/hxtool.c | 1 | ||||
-rw-r--r-- | crypto/heimdal/lib/hx509/ks_file.c | 8 | ||||
-rw-r--r-- | crypto/heimdal/lib/hx509/name.c | 11 | ||||
-rw-r--r-- | crypto/heimdal/lib/hx509/softp11.c | 6 | ||||
-rw-r--r-- | crypto/heimdal/lib/hx509/version-script.map | 5 |
5 files changed, 15 insertions, 16 deletions
diff --git a/crypto/heimdal/lib/hx509/hxtool.c b/crypto/heimdal/lib/hx509/hxtool.c index 06c7958592ff..690ee5da612b 100644 --- a/crypto/heimdal/lib/hx509/hxtool.c +++ b/crypto/heimdal/lib/hx509/hxtool.c @@ -1288,6 +1288,7 @@ request_create(struct request_create_options *opt, int argc, char **argv) const char *outfile = argv[0]; memset(&key, 0, sizeof(key)); + memset(&signer, 0, sizeof(signer)); get_key(opt->key_string, opt->generate_key_string, diff --git a/crypto/heimdal/lib/hx509/ks_file.c b/crypto/heimdal/lib/hx509/ks_file.c index 6aa36f4e204e..b8404a60f66f 100644 --- a/crypto/heimdal/lib/hx509/ks_file.c +++ b/crypto/heimdal/lib/hx509/ks_file.c @@ -533,7 +533,7 @@ store_func(hx509_context context, void *ctx, hx509_cert c) { struct store_ctx *sc = ctx; heim_octet_string data; - int ret; + int ret = 0; ret = hx509_cert_binary(context, c, &data); if (ret) @@ -554,14 +554,14 @@ store_func(hx509_context context, void *ctx, hx509_cert c) HX509_KEY_FORMAT_DER, &data); if (ret) break; - hx509_pem_write(context, _hx509_private_pem_name(key), NULL, sc->f, - data.data, data.length); + ret = hx509_pem_write(context, _hx509_private_pem_name(key), NULL, + sc->f, data.data, data.length); free(data.data); } break; } - return 0; + return ret; } static int diff --git a/crypto/heimdal/lib/hx509/name.c b/crypto/heimdal/lib/hx509/name.c index efd7b703422f..ffb67c85e574 100644 --- a/crypto/heimdal/lib/hx509/name.c +++ b/crypto/heimdal/lib/hx509/name.c @@ -938,6 +938,7 @@ int hx509_general_name_unparse(GeneralName *name, char **str) { struct rk_strpool *strpool = NULL; + int ret = 0; *str = NULL; @@ -964,7 +965,6 @@ hx509_general_name_unparse(GeneralName *name, char **str) case choice_GeneralName_directoryName: { Name dir; char *s; - int ret; memset(&dir, 0, sizeof(dir)); dir.element = name->u.directoryName.element; dir.u.rdnSequence = name->u.directoryName.u.rdnSequence; @@ -1017,10 +1017,9 @@ hx509_general_name_unparse(GeneralName *name, char **str) default: return EINVAL; } - if (strpool == NULL) + if (ret) + rk_strpoolfree(strpool); + else if (strpool == NULL || (*str = rk_strpoolcollect(strpool)) == NULL) return ENOMEM; - - *str = rk_strpoolcollect(strpool); - - return 0; + return ret; } diff --git a/crypto/heimdal/lib/hx509/softp11.c b/crypto/heimdal/lib/hx509/softp11.c index 38f587e0fea2..6a516a50cb66 100644 --- a/crypto/heimdal/lib/hx509/softp11.c +++ b/crypto/heimdal/lib/hx509/softp11.c @@ -342,6 +342,9 @@ add_object_attribute(struct st_object *o, struct st_attr *a; int i; + if (pValue == NULL && ulValueLen) + return CKR_ARGUMENTS_BAD; + i = o->num_attributes; a = realloc(o->attrs, (i + 1) * sizeof(o->attrs[0])); if (a == NULL) @@ -352,7 +355,8 @@ add_object_attribute(struct st_object *o, o->attrs[i].attribute.pValue = malloc(ulValueLen); if (o->attrs[i].attribute.pValue == NULL && ulValueLen != 0) return CKR_DEVICE_MEMORY; - memcpy(o->attrs[i].attribute.pValue, pValue, ulValueLen); + if (ulValueLen) + memcpy(o->attrs[i].attribute.pValue, pValue, ulValueLen); o->attrs[i].attribute.ulValueLen = ulValueLen; o->num_attributes++; diff --git a/crypto/heimdal/lib/hx509/version-script.map b/crypto/heimdal/lib/hx509/version-script.map index 7ee26dd91922..99ce18daf7b4 100644 --- a/crypto/heimdal/lib/hx509/version-script.map +++ b/crypto/heimdal/lib/hx509/version-script.map @@ -21,7 +21,6 @@ HEIMDAL_X509_1.2 { _hx509_request_add_email; _hx509_request_parse; _hx509_request_print; - _hx509_request_set_email; _hx509_request_to_pkcs10; _hx509_unmap_file_os; _hx509_write_file; @@ -51,8 +50,6 @@ HEIMDAL_X509_1.2 { hx509_ca_tbs_set_unique; hx509_ca_tbs_subject_expand; hx509_ca_tbs_template_units; - hx509_cert; - hx509_cert_attribute; hx509_cert_binary; hx509_cert_check_eku; hx509_cert_cmp; @@ -85,7 +82,6 @@ HEIMDAL_X509_1.2 { hx509_certs_free; hx509_certs_info; hx509_certs_init; - hx509_certs_iter; hx509_certs_iter_f; hx509_certs_merge; hx509_certs_next_cert; @@ -133,7 +129,6 @@ HEIMDAL_X509_1.2 { hx509_env_find; hx509_env_find_binding; hx509_env_free; - hx509_env_init; hx509_env_lfind; hx509_err; hx509_free_error_string; |