Skip to content

Commit

Permalink
Fix !OpenSSL build/bootstrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonn committed Feb 9, 2009
1 parent 6641a9a commit 89a4432
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkgtools/pkg_install/files/lib/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile.in,v 1.24 2009/02/02 12:35:01 joerg Exp $
# $NetBSD: Makefile.in,v 1.25 2009/02/09 16:54:08 joerg Exp $

srcdir= @srcdir@

Expand Down Expand Up @@ -36,12 +36,12 @@ CPPFLAGS+= -DSYSCONFDIR=\"$(sysconfdir)\"
.if !empty(BOOTSTRAP)
CPPFLAGS+= -DBOOTSTRAP
.else
OBJS+= pkg_io.o
OBJS+= pkg_io.o pkg_signature.o
.endif

.if !empty(SSL_SUPPORT)
CPPFLAGS+= -DHAVE_SSL
OBJS+= pkg_signature.o pkcs7.o
OBJS+= pkcs7.o
.endif

all: $(LIB)
Expand Down
12 changes: 10 additions & 2 deletions pkgtools/pkg_install/files/lib/pkg_signature.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: pkg_signature.c,v 1.2 2009/02/02 12:35:01 joerg Exp $ */
/* $NetBSD: pkg_signature.c,v 1.3 2009/02/09 16:54:08 joerg Exp $ */

#if HAVE_CONFIG_H
#include "config.h"
Expand All @@ -7,7 +7,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
__RCSID("$NetBSD: pkg_signature.c,v 1.2 2009/02/02 12:35:01 joerg Exp $");
__RCSID("$NetBSD: pkg_signature.c,v 1.3 2009/02/09 16:54:08 joerg Exp $");

/*-
* Copyright (c) 2008 Joerg Sonnenberger <[email protected]>.
Expand Down Expand Up @@ -356,10 +356,16 @@ pkg_verify_signature(struct archive **archive, struct archive_entry **entry,

free(signature_file);
} else {
#ifdef HAVE_SSL
has_sig = !easy_pkcs7_verify(hash_file, hash_len, signature_file,
signature_len, certs_packages, 1);

free(signature_file);
#else
warnx("No OpenSSL support compiled in, skipping signature");
has_sig = 0;
free(signature_file);
#endif
}

r = archive_read_next_header(*archive, &my_entry);
Expand Down Expand Up @@ -503,6 +509,7 @@ static const char hash_template[] =

static const char hash_trailer[] = "end pkgsrc signature\n";

#ifdef HAVE_SSL
void
pkg_sign_x509(const char *name, const char *output, const char *key_file, const char *cert_file)
{
Expand Down Expand Up @@ -593,6 +600,7 @@ pkg_sign_x509(const char *name, const char *output, const char *key_file, const

exit(0);
}
#endif

void
pkg_sign_gpg(const char *name, const char *output)
Expand Down

0 comments on commit 89a4432

Please sign in to comment.