X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libopkg%2Fopkg_pathfinder.c;h=bf7dab68a55dff1061fd72df4f2c9416dabf09b5;hb=f637389e79f9fb04b73d4fe254fea63e9b077a94;hp=01912eb87bb15c8c10642bc1cdfd883d0a32b24e;hpb=813388093465b8723394960bc8e489fa64bb1a85;p=oweals%2Fopkg-lede.git diff --git a/libopkg/opkg_pathfinder.c b/libopkg/opkg_pathfinder.c index 01912eb..bf7dab6 100644 --- a/libopkg/opkg_pathfinder.c +++ b/libopkg/opkg_pathfinder.c @@ -1,10 +1,7 @@ /* vi: set noexpandtab sw=4 sts=4: */ -/* opkg_download.c - the opkg package management system +/* opkg_pathfinder.c - the opkg package management system - Carl D. Worth - - Copyright (C) 2001 University of Southern California - Copyright (C) 2008 OpenMoko Inc + Copyright (C) 2009 Camille Moncelier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -20,12 +17,12 @@ #include #include - +#include #if defined(HAVE_SSLCURL) #include #endif -#include "includes.h" +#include "libbb/libbb.h" #include "opkg_message.h" #if defined(HAVE_SSLCURL) || defined(HAVE_OPENSSL) @@ -40,9 +37,9 @@ static int pathfinder_verify_callback(X509_STORE_CTX *ctx, void *arg) const char *hex = "0123456789ABCDEF"; size_t size = i2d_X509(ctx->cert, NULL); unsigned char *keybuf, *iend; - iend = keybuf = malloc(size); + iend = keybuf = xmalloc(size); i2d_X509(ctx->cert, &iend); - char *certdata_str = malloc(size * 2 + 1); + char *certdata_str = xmalloc(size * 2 + 1); unsigned char *cp = keybuf; char *certdata_str_i = certdata_str; while (cp < iend) @@ -58,7 +55,7 @@ static int pathfinder_verify_callback(X509_STORE_CTX *ctx, void *arg) int validated = pathfinder_dbus_verify(certdata_str, policy, 0, 0, &errmsg); if (!validated) - fprintf(stderr, "curlcb_pathfinder: Path verification failed: %s", errmsg); + opkg_msg(ERROR, "Path verification failed: %s.\n", errmsg); free(certdata_str); free(errmsg);