]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* examples/io.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 14 May 2007 14:48:16 +0000 (16:48 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 14 May 2007 14:48:16 +0000 (16:48 +0200)
* examples/io.c (read_rsa_key): Deleted, moved to...
* examples/read_rsa_key.c: New file, extracted from io.c.

Rev: nettle/examples/io.c:1.2
Rev: nettle/examples/io.h:1.2

examples/io.c
examples/io.h

index df4710379209564936a6f980f8db5a23f37d35ec..ead9fd1d24ca9e7b565271c3dae1848a43b41862 100644 (file)
@@ -185,24 +185,3 @@ hash_file(const struct nettle_hash *hash, void *ctx, FILE *f)
        return 1;
     }
 }
-
-#if WITH_PUBLIC_KEY
-int
-read_rsa_key(const char *name,
-            struct rsa_public_key *pub,
-            struct rsa_private_key *priv)
-{
-  unsigned length;
-  char *buffer;
-  int res;
-  
-  length = read_file(name, 0, &buffer);
-  if (!length)
-    return 0;
-
-  res = rsa_keypair_from_sexp(pub, priv, 0, length, buffer);
-  free(buffer);
-
-  return res;
-}
-#endif /* WITH_PUBLIC_KEY */
index 93c6856c2da8c1fad819eb2c8035da1d57ef4821..e85dc5f8bd2b4f3b7f5a6b26416aba54f25fa1a6 100644 (file)
@@ -27,9 +27,6 @@
 #define NETTLE_EXAMPLES_IO_H_INCLUDED
 
 #include "nettle-meta.h"
-#if WITH_PUBLIC_KEY
-# include "rsa.h"
-#endif
 #include "yarrow.h"
 
 #include <stdio.h>
@@ -63,7 +60,7 @@ simple_random(struct yarrow256_ctx *ctx, const char *name);
 int
 hash_file(const struct nettle_hash *hash, void *ctx, FILE *f);
 
-#if WITH_PUBLIC_KEY
+#if WITH_HOGWEED
 struct rsa_public_key;
 struct rsa_private_key;
 
@@ -71,6 +68,6 @@ int
 read_rsa_key(const char *name,
             struct rsa_public_key *pub,
             struct rsa_private_key *priv);
-#endif /* WITH_PUBLIC_KEY */
+#endif /* WITH_HOGWEED */
 
 #endif /* NETTLE_EXAMPLES_IO_H_INCLUDED */