From: Niels Möller Date: Mon, 14 May 2007 14:48:16 +0000 (+0200) Subject: * examples/io.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY. X-Git-Tag: nettle_2.0_release_20090608~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90113ca26921741a0a4f648f8107d5ee97ea8477;p=thirdparty%2Fnettle.git * examples/io.h: Use WITH_HOGWEED, not WITH_PUBLIC_KEY. * 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 --- diff --git a/examples/io.c b/examples/io.c index df471037..ead9fd1d 100644 --- a/examples/io.c +++ b/examples/io.c @@ -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 */ diff --git a/examples/io.h b/examples/io.h index 93c6856c..e85dc5f8 100644 --- a/examples/io.h +++ b/examples/io.h @@ -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 @@ -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 */