summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2011-03-23Refactor signature loading code into common functionDan McGee
We can use this for both standalone package signatures as well as standalone database signatures. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add functions for verifying database signatureAllan McRae
Add a pmpgpsig_t struct to the database entry struct and functions for the lazy loading of database signatures. Add a function for checking database signatures, reusing (and generalizing) the code currently used for checking package signatures. TODO: The code for reading in signature files from the filesystem is duplicated for local packages and database and needs refactoring. Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23lib/dload.c: Check for dlcb == NULL earlierDave Reisner
Our curl callback does a whole lot of work for nothing if the front end never defined a callback to receive the data we'd calculate for it. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23lib/dload.c: don't use deprecated curl symbolsDave Reisner
CURLINFO_HTTP_CODE is deprecated in favor of CURLINFO_RESPONSE_CODE. Both yield the same values. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23lib/dload.c: don't request compressed transportDave Reisner
The files we transfer are generally compressed already, so this just adds unnecessary overhead. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23lib/dload.c: Fix progress callback issues on downloadDave Reisner
Use a static variable to effectively track the initialization state of the progress callback via the last byte amount reported as downloaded by libcurl. Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23lib/dload.c: fix compiler warnings generated by -Wfloat-equalDave Reisner
* introduces new macro in util.h (DOUBLE_EQ) for properly comparing floating point values Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23buildsys: use libcurl's m4 macro for buildtime detectionDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Report output from signature checking to debug logAllan McRae
Move the (possibly still temporary) output generated during signature checking into the --debug output. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Added gpg verification options per repo to the config file.Xavier Chantry
Once we do this, add support for VerifySig to pactest. We just check if the repo name contains Always, Never or Optional to determine the value of VerifySig. The default is Never. pacman uses Always by default but this is not suitable for pactest. Original-work-by: shankar <jatheendra@gmail.com> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Remove unnecessary sanity check on db->setserverDan McGee
We pass in a db object, so no need to go looking for it in the list on the handle. This is a remnant of when we passed in a treename, more than likely. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Integrate GPGME into libalpmDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add some error codes for signature verificationDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add signature directory as option on libalpm handleDan McGee
This will serve as the home directory we pass to GPGME when making calls so we can have a libalpm-utilized keyring. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Actually read PGPSIG field in sync DB codeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Merge branch 'gpg-libalpm-basics'Dan McGee
2011-03-23Remove libfetch error codeDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Read in .sig files when opening a package fileDan McGee
If a .sig file sits side-by-side on the filesystem with a package archive, read it in during the package struct creation process so we can verify it at a later time if necessary. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23Allow PGP signature to be read from sync databaseDan McGee
Add a new field to the package struct to hold PGP information and instruct db_read to pick it up from the database. It is currently unused internally but this is the first step. Due to the fact that we store the PGP sig as binary data, we need to store both the data and the length so we have a small utility struct to assist us. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23Add base64 algorithms from PolarSSL to libalpmDan McGee
We will need these for GPG functionality (decoding the base64 encoded signature stored in the databases). Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-03-23Merge branch 'gpg-build-tools'Dan McGee
2011-03-23repo-add: add sha256sum values to repo databaseDan McGee
Implements FS#23103. Also modify libalpm so it ignores this value without any warning as we know it is likely to exist. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Merge branch 'maint'Dan McGee
2011-03-23Updated 3.5.1 translations from TransifexDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-23Add new Serbian translation from TransifexSlobodan Terzić
Thanks! Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Minor code cleanupsDan McGee
Wrap lines of long length, noticed while creating and messing around with some of the other maint branch patches. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Ensure package removal list does not contain duplicatesDan McGee
Noticed with the openoffice/libreoffice replacement scheme where many packages are listed as replacements to one package, thus electing it for removal multiple times. Ensure a given package is not already present before placing it in the removal list. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Fix line_offset not being reset in _alpm_archive_fgets()Dan McGee
This is a rather serious data corruption issue that luckily manifested itself today in a noticable way. A package in testing had replaces entries read in as ["%RE pkgname", "%RE"] which was clearly wrong. This happens when we hit the end of an archive block, do not have a newline, and have to continue reading from the next block to complete the line. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Merge branch 'maint'Dan McGee
Conflicts due to change in return calling style. Conflicts: src/pacman/pacman.c src/pacman/sync.c
2011-03-21Don't initialize progress to zero before calling curl_easy_perform().Lukas Fleischer
Drawing progress bars before calling curl_easy_perform() is needless as the curl progress callback is called with zero progress before actually downloading the file anyways. Fixes display of "0%" progress bars when sync'ing package databases that are already up to date. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-21Ensure dlcb is defined before calling itDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Update source translation files in prep for 3.5.1Dan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Fix comparison to 0 rather than NULLDan McGee
Another fix found by Coccinelle example semantic patches. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Fix assignment before NULL checkDan McGee
Easy fix, found using null_ref.cocci example Coccinelle script. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Style change: return(x) --> return xDan McGee
This was discussed and more or less agreed upon on the mailing list. A huge checkin, but if we just do it and let people adjust the pain will end soon enough. Rebasing should be relatively straighforward for anyone that sees conflicts; just be sure you use the new return style if possible. The following semantic patch was used to do the change, along with some hand-massaging in order to preserve parenthesis where appropriate: The semantic match that finds this problem is as follows, although some hand-massaging was done in order to keep parenthesis where appropriate: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a; @@ - return(a); + return a; // </smpl> A macros_file was also provided with the following content: Additional steps taken, mainly for ASSERT() macros: $ sed -i -e 's#return(NULL)#return NULL#' lib/libalpm/*.c $ sed -i -e 's#return(-1)#return -1#' lib/libalpm/*.c Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20lib/dload.c: fix opening braces to conform with coding styleDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Merge branch 'maint'Dan McGee
2011-03-20Add missing include for size_tDan McGee
Needed for things like our strndup() substitute function. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20lib/dload.c: remove lingering libfetch specific headersDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-20Use sane umask for repo db downloadsAllan McRae
Fixes FS#23343. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17Correctly parse %DELTAS% entries in sync DBtuxce
We erroniously dropped the call to _alpm_delta_parse() when macro-izing, causing segfaults for repos that provide deltas. Addresses FS#23314. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17Fix triple progress bars on downloadDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-17Ensure we have a root partition when checking spaceDan McGee
Partially addresses the "why doesn't CheckSpace work in a chroot" issue. We can't make it work, but we can at least detect when it won't work by checking for a partition for our given installation root. If we can't determine the mountpoint for this, bail out with an error. Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Merge branch 'maint'Dan McGee
2011-03-16alpm_list: fix typo in doxygen commentDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Update translations for message with added newlineDan McGee
Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Add missing newline to warning messageAllan McRae
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-16Merge branch 'download'Dan McGee
2011-03-16Updated translations for 3.5.0 from TransifexDan McGee
Thanks to all translators that contributed! Signed-off-by: Dan McGee <dan@archlinux.org>
2011-03-09Remove all traces of libfetchDave Reisner
Signed-off-by: Dave Reisner <d@falconindy.com>