diff options
author | Rob Austein <sra@hactrn.net> | 2008-07-02 21:15:51 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2008-07-02 21:15:51 +0000 |
commit | 195bc15b0a02da2af0a7ef67d1a9030f6c99e90c (patch) | |
tree | 17675ef940480677b3e315409bbc8bedc78aeb59 /utils | |
parent | d39cb158a3cb4813bf4efd6ea13484b10fe41795 (diff) |
Cleanup
svn path=/utils/Makefile; revision=1967
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile | 2 | ||||
-rw-r--r-- | utils/cert_hash/Makefile | 24 | ||||
-rw-r--r-- | utils/cert_hash/cert_hash.c | 70 |
3 files changed, 1 insertions, 95 deletions
diff --git a/utils/Makefile b/utils/Makefile index 450ffcb3..9bc99598 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -1,6 +1,6 @@ # $Id$ -SUBDIRS = uri manifest cert_hash roa hashdir +SUBDIRS = uri manifest roa hashdir all clean test: @for i in ${SUBDIRS}; do echo "Making $@ in $$i"; (cd $$i && ${MAKE} $@); done diff --git a/utils/cert_hash/Makefile b/utils/cert_hash/Makefile deleted file mode 100644 index a9e9c52c..00000000 --- a/utils/cert_hash/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# $Id$ - -OPENSSL_DIR = ../../openssl/openssl - -CFLAGS = -g -I${OPENSSL_DIR}/include - -# -H -Wl,-t - -BIN = cert_hash -OBJ = cert_hash.o -LIB = ${OPENSSL_DIR}/libcrypto.a - -all: ${BIN} - -clean: - rm -f ${BIN} ${OBJ} - -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} - -TARGET = ../../rpkid/testbed.dir/publication/localhost:4400/testbed/WOMBAT.cer - -test: all - if test -r ${TARGET}; then ./${BIN} ${TARGET}; openssl dgst -sha256 -c < ${TARGET}; else :; fi diff --git a/utils/cert_hash/cert_hash.c b/utils/cert_hash/cert_hash.c deleted file mode 100644 index bb498996..00000000 --- a/utils/cert_hash/cert_hash.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2008 American Registry for Internet Numbers ("ARIN") - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND ARIN DISCLAIMS ALL WARRANTIES WITH - * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS. IN NO EVENT SHALL ARIN BE LIABLE FOR ANY SPECIAL, DIRECT, - * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE - * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* $Id$ */ - -/* - * Test of using BIO_f_md() filter BIO to calculate hash while reading. - */ - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <unistd.h> - -#include <openssl/bio.h> -#include <openssl/evp.h> -#include <openssl/x509.h> - -int main (int argc, char *argv[]) -{ - BIO *b1 = NULL, *b2 = NULL; - X509 *x = NULL; - unsigned char buf[EVP_MAX_MD_SIZE]; - unsigned i, n; - - if ((b1 = BIO_new_file(argv[1], "rb")) == NULL) - goto done; - - if ((b2 = BIO_new(BIO_f_md())) == NULL) - goto done; - - if (!BIO_set_md(b2, EVP_sha256())) - goto done; - - BIO_push(b2, b1); - - if ((x = d2i_X509_bio(b2, NULL)) == NULL) - goto done; - - if (X509_print_fp(stdout, x) < 0) - goto done; - - if ((n = BIO_gets(b2, buf, sizeof(buf))) > 0) { - printf("\nsha26[%u]: ", n); - for (i = 0; i < n; i++) { - printf("%02x%s", buf[i], i == n - 1 ? "\n" : ":"); - } - } - - done: - if (ERR_peek_error()) - ERR_print_errors_fp(stderr); - - BIO_free_all(b2); - - return 0; -} |