mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 10:48:02 +00:00
libsecureboot: avoid set but not used errors
Reviewed by: stevek
This commit is contained in:
parent
fcc8d72702
commit
56f3f2d249
|
@ -464,20 +464,22 @@ verify_asc(const char *sigfile, int flags)
|
||||||
size_t n;
|
size_t n;
|
||||||
unsigned char *fdata, *sdata;
|
unsigned char *fdata, *sdata;
|
||||||
size_t fbytes, sbytes;
|
size_t fbytes, sbytes;
|
||||||
|
|
||||||
|
fdata = NULL;
|
||||||
if ((sdata = read_file(sigfile, &sbytes))) {
|
if ((sdata = read_file(sigfile, &sbytes))) {
|
||||||
n = strlcpy(pbuf, sigfile, sizeof(pbuf));
|
n = strlcpy(pbuf, sigfile, sizeof(pbuf));
|
||||||
if ((cp = strrchr(pbuf, '.')))
|
if (n < sizeof(pbuf)) {
|
||||||
*cp = '\0';
|
if ((cp = strrchr(pbuf, '.')))
|
||||||
if ((fdata = read_file(pbuf, &fbytes))) {
|
*cp = '\0';
|
||||||
if (openpgp_verify(pbuf, fdata, fbytes, sdata,
|
if ((fdata = read_file(pbuf, &fbytes))) {
|
||||||
sbytes, flags)) {
|
if (openpgp_verify(pbuf, fdata, fbytes, sdata,
|
||||||
free(fdata);
|
sbytes, flags)) {
|
||||||
fdata = NULL;
|
free(fdata);
|
||||||
|
fdata = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
fdata = NULL;
|
|
||||||
free(sdata);
|
free(sdata);
|
||||||
return (fdata);
|
return (fdata);
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,11 +241,14 @@ x509_cn_get(br_x509_certificate *xc, char *buf, size_t len)
|
||||||
mc.vtable->start_cert(&mc.vtable, xc->data_len);
|
mc.vtable->start_cert(&mc.vtable, xc->data_len);
|
||||||
mc.vtable->append(&mc.vtable, xc->data, xc->data_len);
|
mc.vtable->append(&mc.vtable, xc->data, xc->data_len);
|
||||||
mc.vtable->end_cert(&mc.vtable);
|
mc.vtable->end_cert(&mc.vtable);
|
||||||
/* we don' actually care about cert status - just its name */
|
/* we don't actually care about cert status - just its name */
|
||||||
err = mc.vtable->end_chain(&mc.vtable);
|
err = mc.vtable->end_chain(&mc.vtable);
|
||||||
|
|
||||||
if (!cn.status)
|
if (!cn.status) {
|
||||||
buf = NULL;
|
buf = NULL;
|
||||||
|
if (err == 0) /* keep compiler happy */
|
||||||
|
buf = NULL;
|
||||||
|
}
|
||||||
return (buf);
|
return (buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue