fi
fi
+AC_ARG_ENABLE(usign,
+ AC_HELP_STRING([--enable-usign], [Enable signature checking with usign
+ [[default=yes]] ]),
+ [want_usign="$enableval"], [want_usign="yes"])
+
+if test "x$want_usign" = "xyes"; then
+ AC_DEFINE(HAVE_USIGN, 1, [Define if you want usign support])
+fi
+
AC_SUBST(GPGME_CFLAGS)
AC_SUBST(GPGME_LIBS)
}
free(url);
-#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL)
+#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
if (conf->check_signature) {
char *sig_file_name;
/* download detached signitures to verify the package lists */
list_file_name);
}
free(url);
-#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL)
+#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
if (conf->check_signature) {
/* download detached signitures to verify the package lists */
/* get the url for the sig file */
#include "config.h"
+#include <sys/wait.h>
#include <stdio.h>
#include <unistd.h>
#include <libgen.h>
int
opkg_verify_file (char *text_file, char *sig_file)
{
-#if defined HAVE_GPGME
+#if defined HAVE_USIGN
+ int status = -1;
+ int pid;
+
+ if (conf->check_signature == 0 )
+ return 0;
+
+ pid = fork();
+ if (pid < 0)
+ return -1;
+
+ if (!pid) {
+ execl("/usr/sbin/opkg-key", "opkg-key", "verify", sig_file, text_file, NULL);
+ exit(255);
+ }
+
+ waitpid(pid, &status, 0);
+ if (!WIFEXITED(status) || WEXITSTATUS(status))
+ return -1;
+
+ return 0;
+#elif defined HAVE_GPGME
if (conf->check_signature == 0 )
return 0;
int status = -1;
}
/* check that the repository is valid */
- #if defined(HAVE_GPGME) || defined(HAVE_OPENSSL)
+ #if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN)
char *list_file_name, *sig_file_name, *lists_dir;
/* check to ensure the package has come from a repository */