]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
first attempt
authorMiek Gieben <miekg@NLnetLabs.nl>
Thu, 3 Mar 2005 12:45:16 +0000 (12:45 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Thu, 3 Mar 2005 12:45:16 +0000 (12:45 +0000)
Makefile.in
TODO
keys.c
ldns/keys.h

index 19015ad1954f05c894dd16ee07bee36f3cf2179d..0d3a0c55d9a1cf43fc273067eaa7f4f68f55ee89 100644 (file)
@@ -24,7 +24,7 @@ LINTFLAGS     = +quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsign
 
 LIBDNS_SOURCES =       rdata.c util.c rr.c packet.c wire2host.c \
                        host2str.c buffer.c str2host.c resolver.c \
-                       net.c host2wire.c dname.c dnssec.c
+                       net.c host2wire.c dname.c dnssec.c keys.c
 LIBDNS_HEADERS =       ldns/error.h            \
                        ldns/packet.h           \
                        ldns/prototype.h        \
@@ -39,6 +39,7 @@ LIBDNS_HEADERS        =       ldns/error.h            \
                        ldns/net.h              \
                        ldns/dname.h            \
                        ldns/dnssec.h           \
+                       ldns/keys.h             \
                        util.h
 PROG_SOURCES   =       mx.c
 PROG_TARGETS   =       $(PROG_SOURCES:.c=)
diff --git a/TODO b/TODO
index cea7e488fbb62d2fb2df562ebc2cab202d34e61d..6954b2dca9a95a240b005235e800602e4b4cd606 100644 (file)
--- a/TODO
+++ b/TODO
@@ -47,3 +47,8 @@ o Dependency on openSSL?
 o ldns_lookup_by_name works for types, classes
        should be shielded, only use ldns_get_class_by_name/type
 o private key type?
+       to many algs:
+       ldns_algorithms[] host2str.c
+       ldns_algorithm    dnssec.h
+       ldns_signing_algorithm keys.h (new!?)
+       
diff --git a/keys.c b/keys.c
index 15e381528d3748af87706d499ddb64ec2487c812..526e6d9abfed128bb95a088017814167fab272f7 100644 (file)
--- a/keys.c
+++ b/keys.c
@@ -5,3 +5,6 @@
  * and give a general interface for private keys and hmac
  * handling
  */
+
+#include <config.h>
+#include <ldns/keys.h>
index bfa5a3b890b94ccf866d01121f9a130c99420d00..30e36f2d558a5c319edbb1e534204bbd7d48b9ec 100644 (file)
  * See the file LICENSE for the license
  */
 
+#include <openssl/ssl.h>
+#include <util.h>
+
+enum ldns_enum_signing_algorithm
+{
+       LDNS_SIGN_ALG_RSAMD5    = 1,
+       LDNS_SIGN_ALG_RSASHA1   = 2,
+       LDNS_SIGN_ALG_DSAMD5    = 3, 
+       LDNS_SIGN_ALG_DSASHA1   = 4,
+       LDNS_SIGN_ALG_HMACMD5   = 5
+};
+typedef enum ldns_enum_signing_algorithm ldns_signing_algorithm;
+
+ldns_lookup_table ldns_signing_algorithms[] = {
+       { LDNS_SIGN_ALG_RSAMD5, "RSAMD5" },
+       { LDNS_SIGN_ALG_RSASHA1, "RSASHA1" },
+       { LDNS_SIGN_ALG_DSAMD5, "DSAMD5" },
+       { LDNS_SIGN_ALG_DSASHA1, "DSASHA1" },
+       { LDNS_SIGN_ALG_HMACMD5, "hmac-md5.sig-alg.reg.int" },
+       { 0, NULL }
+};
+
+
+struct ldns_struct_key {
+       ldns_signing_algorithm algorithm;
+       union {
+               RSA     *rsa;
+               DSA     *dsa;
+               unsigned char *hmac;
+       } key;
+};
+typedef struct ldns_struct_key ldns_key;
+