From 2c45be24612378929580b8fefd88fdcb9df50aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 4 Jan 2007 02:01:41 +0000 Subject: [PATCH] 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 --- lib/hx509/ks_file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/hx509/ks_file.c b/lib/hx509/ks_file.c index bb7033e14..27a25ba41 100644 --- a/lib/hx509/ks_file.c +++ b/lib/hx509/ks_file.c @@ -540,6 +540,7 @@ file_init(hx509_context context, if (!found_data) { size_t length; void *ptr; + int i; ret = _hx509_map_file(p, &ptr, &length, NULL); if (ret) { @@ -547,7 +548,11 @@ file_init(hx509_context context, 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); if (ret) goto out;