From: Jelte Jansen Date: Wed, 7 Sep 2005 14:46:28 +0000 (+0000) Subject: print right algorithm in case of SHA1 X-Git-Tag: release-1.0.0~199 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43ae128e8463eaf508912480a527f41eebec6afa;p=thirdparty%2Fldns.git print right algorithm in case of SHA1 (is MD5 format the same for the rest of the output?) --- diff --git a/host2str.c b/host2str.c index 6784b374..320c035b 100644 --- a/host2str.c +++ b/host2str.c @@ -1035,7 +1035,11 @@ ldns_key2buffer_str(ldns_buffer *output, ldns_key *k) /* copied by looking at dnssec-keygen output */ /* header */ ldns_buffer_printf(output,"Private-key-format: v1.2\n"); - ldns_buffer_printf(output,"Algorithm: 1 (RSA)\n"); + if (ldns_key_algorithm(k) == LDNS_SIGN_RSAMD5) { + ldns_buffer_printf(output,"Algorithm: 1 (RSA)\n"); + } else if (ldns_key_algorithm(k) == LDNS_SIGN_RSAMD5) { + ldns_buffer_printf(output,"Algorithm: 5 (RSASHA1)\n"); + } /* print to buf, convert to bin, convert to b64, * print to buf */