addrs_flag ? FALSE : TRUE);
if (renew_life == NULL && renewable_flag)
- renewstr = "1 month";
+ asprintf(&renewstr, "1 month");
if (renew_life)
- renewstr = renew_life;
+ asprintf(&renewstr, "%s", renew_life);
if (renewstr) {
renew = parse_time (renewstr, "s");
if (renew < 0)
errx (1, "unparsable time: %s", renewstr);
-
+ free(renewstr);
krb5_get_init_creds_opt_set_renew_life (opt, renew);
}
const heim_oid *oid,
const char *string)
{
- const PKIXXmppAddr ustring = (const PKIXXmppAddr)string;
+ const PKIXXmppAddr ustring = string;
heim_octet_string os;
size_t size;
int ret;
Certificate *c = _hx509_get_cert(cert);
heim_octet_string os, sig;
hx509_env envhash = NULL;
- char *buf;
os.data = c->tbsCertificate.subjectPublicKeyInfo.subjectPublicKey.data;
os.length =
int
hx509_pem_add_header(hx509_pem_header **headers,
- const char *header, const char *value)
+ const char *hdr, const char *value)
{
hx509_pem_header *h;
h = calloc(1, sizeof(*h));
if (h == NULL)
return ENOMEM;
- h->header = strdup(header);
+ h->header = strdup(hdr);
if (h->header == NULL) {
free(h);
return ENOMEM;
*/
const char *
-hx509_pem_find_header(const hx509_pem_header *h, const char *header)
+hx509_pem_find_header(const hx509_pem_header *h, const char *hdr)
{
while(h) {
- if (strcmp(header, h->header) == 0)
+ if (strcmp(hdr, h->header) == 0)
return h->value;
h = h->next;
}
goto out;
for (p = f->fn; p != NULL; p = pnext) {
- FILE *f;
+ FILE *f2;
pnext = strchr(p, ',');
if (pnext)
*pnext++ = '\0';
- if ((f = fopen(p, "r")) == NULL) {
+ if ((f2 = fopen(p, "r")) == NULL) {
ret = ENOENT;
hx509_set_error_string(context, 0, ret,
"Failed to open PEM file \"%s\": %s",
p, strerror(errno));
goto out;
}
- rk_cloexec_file(f);
+ rk_cloexec_file(f2);
- ret = hx509_pem_read(context, f, pem_func, &pem_ctx);
- fclose(f);
+ ret = hx509_pem_read(context, f2, pem_func, &pem_ctx);
+ fclose(f2);
if (ret != 0 && ret != HX509_PARSING_KEY_FAILED)
goto out;
else if (ret == HX509_PARSING_KEY_FAILED) {
switch (name->element) {
case choice_GeneralName_otherName: {
- char *str;
- hx509_oid_sprint(&name->u.otherName.type_id, &str);
- if (str == NULL)
+ char *str2;
+ hx509_oid_sprint(&name->u.otherName.type_id, &str2);
+ if (str2 == NULL)
return ENOMEM;
- strpool = rk_strpoolprintf(strpool, "otherName: %s", str);
- free(str);
+ strpool = rk_strpoolprintf(strpool, "otherName: %s", str2);
+ free(str2);
break;
}
case choice_GeneralName_rfc822Name:
break;
}
case choice_GeneralName_registeredID: {
- char *str;
- hx509_oid_sprint(&name->u.registeredID, &str);
- if (str == NULL)
+ char *str2;
+ hx509_oid_sprint(&name->u.registeredID, &str2);
+ if (str2 == NULL)
return ENOMEM;
- strpool = rk_strpoolprintf(strpool, "registeredID: %s", str);
- free(str);
+ strpool = rk_strpoolprintf(strpool, "registeredID: %s", str2);
+ free(str2);
break;
}
default:
default:
_hx509_abort("hx509 eval expr with unknown op: %d", (int)expr->op);
}
+ return 0;
}
void