Try all formats on the binary file before giving up, this way we can
handle binary rsa keys too. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19665 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -540,6 +540,7 @@ file_init(hx509_context context,
|
|||||||
if (!found_data) {
|
if (!found_data) {
|
||||||
size_t length;
|
size_t length;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
|
int i;
|
||||||
|
|
||||||
ret = _hx509_map_file(p, &ptr, &length, NULL);
|
ret = _hx509_map_file(p, &ptr, &length, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -547,7 +548,11 @@ file_init(hx509_context context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = parse_certificate(context, p, c, NULL, ptr, length);
|
for (i = 0; i < sizeof(formats)/sizeof(formats[0]); i++) {
|
||||||
|
ret = (*formats[i].func)(context, p, c, NULL, ptr, length);
|
||||||
|
if (ret == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
_hx509_unmap_file(ptr, length);
|
_hx509_unmap_file(ptr, length);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user