]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
print right algorithm in case of SHA1
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Wed, 7 Sep 2005 14:46:28 +0000 (14:46 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Wed, 7 Sep 2005 14:46:28 +0000 (14:46 +0000)
(is MD5 format the same for the rest of the output?)

host2str.c

index 6784b374eddf8f479f865dae33e7bc177ba6562b..320c035b76b599d43b3c713224cba684bec35f75 100644 (file)
@@ -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 */