summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 2.9.192.9.19Julian Andres Klode2024-12-2349-546/+830
|
* Merge branch 'symbols'Julian Andres Klode2024-12-232-119/+280
|\
| * Symbols: Merge stable, noble, testing, unstableJulian Andres Klode2024-12-231-119/+74
| | | | | | | | | | | | | | Hand edit 2.7.14build2 to 2.7.14 The funny 999:0misbuilt version number gets auto-reduced to the current version when building which is sad, but it works.
| * abicheck: Add symbol-merge.py helperJulian Andres Klode2024-12-231-0/+206
| | | | | | | | This allows merging symbol diffs from the various build logs
* | Merge branch 'sqv' into 'main'Julian Andres Klode2024-12-2319-52/+465
|\ \ | |/ |/| | | | | methods: Add new sqv method See merge request apt-team/apt!409
| * debian: Plug sqv into the package buildJulian Andres Klode2024-12-224-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our goal is for each platform to have one blessed OpenPGP verification system: Platforms that support sqv get sqv, platforms that don't get gpgv. To do so we hardcode the architecture list at build time. At build time we check if /usr/bin/sqv exists, which is the condition that apt uses to see if it should build with sqv support. We use a slight hack here to build with sqv on the official Debian buildds but use gpgv on Ubuntu by abusing the fact that Ubuntu resolves alternative build dependencies, and gpgv is installed in the buildd image.
| * debian: Add default policy to allow SHA-1 self-signatures until 2026Julian Andres Klode2024-12-222-0/+3
| | | | | | | | | | | | | | | | Many repositories still have SHA-1 self-signatures, and they are not security relevant for APT repositories in the first place since we do not use a web of trust model, but rather a set of trusted keyrings, and the subkey can essentially be always considered trusted even if it cannot be verified.
| * methods: Add new sqv methodJulian Andres Klode2024-12-2213-49/+456
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new sqv method uses sequoia's sqv tool to verify files. The tool's interface is quite simple: It returns 0 on success, and prints one line per good signer with the fingerprint. sqv has a configurable crypto policy. We have defined apt-specific override mechanisms for sequoia's standard policy, allowing both users, distributions, and apt package to provide overrides for Sequoia's default policy in meaningful ways. The sqv method will be built and be the standard method for verifying OpenPGP signatures provided that `sqv` is in the PATH during building. It is not built if there was no sqv at build time, so you need a rebuild to enable sqv later on. On the flip side, the gpgv method is always built, but it does need to be always built: If APT::Key::GPGVCommand is set, we need to fallback to it - this is important to support existing users of that interface such as mmdebstrap. Also we want to fall back to it when /usr/bin/sqv disappears - for example in our CI :D A couple of concessions have been made for test suite purposes: - Failure to split a clearsigned file only shows the summary, as the gpgv method also only showed it, and no details why it failed. - We write "Got GOODSIG <fingerprint>" in debug mode to mimic the gpgv code to keep the test suite happy. - In various places in the test suite we assert minimal output from sqv, but sqv's human output is not intended to be stable. This will incur additional work when it breaks. However we do not _parse_ the output, so actual operation of apt is unaffected. A couple of things are suboptimal here: - We are still doing clearsigned splitting ourselves. sqv only has support for detached signatures right now, whereas sqopv has support for clearsigned files as well (but sqopv does not provide any reasons for why signature verification fails or means to set a policy). - Deprecation of algorithms happens on a timebomb basis in sequoia. We have no means to give users warnings ahead of time if their configuration is outdated. We have implemented various bits that probably should be going away: - Fallback to trusted.gpg This is just annoying... - Support for fingerprints in Signed-By (no subkey matching though) The extra work here is arguably less compared to gpgv. - Check the keyring for correctness. With Signed-By everywhere, we should just error out rather than skip broken keyrings. Moo
* Merge branch 'refactor-hashes' into 'main'Julian Andres Klode2024-12-2213-327/+374
|\ | | | | | | | | Switch to OpenSSL in a convoluted path of commits See merge request apt-team/apt!412
| * Remove GnuTLS and gcrypt supportJulian Andres Klode2024-12-228-471/+6
| | | | | | | | | | OpenSSL is mandatory now, it is no longer possible to build without https support either.
| * hashes, methods: Add OpenSSL backendsJulian Andres Klode2024-12-229-20/+409
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an OpenSSL::Crypto backend for the hashes library and an OpenSSL::SSL backend for the TLS support in our https method. Many thanks to curl for showing the way with how to handle a CRL file. There are some memory leaks here with the TlsFd itself as well as the proxy support; and we should reorganize the code to generate the ssl object as late as possible. A peculiar aspect of OpenSSL is that SSL_has_pending() returns 1 even if SSL_read() will fail to read anything and return the equivalent of EAGAIN. We work around this here by also peeking ahead 1 byte. I was running a very high RTT connection from Germany to Australia for testing, and with the peeking it's using negligible amounts of CPU; before that, it was busy looping at 100%. Bad OpenSSL!
| * hashes: Add GnuTLS backend, make it defaultJulian Andres Klode2024-12-213-1/+71
| | | | | | | | | | | | | | The GnuTLS backend avoids the need to link in libgcrypt, and gets us another certified library people will be happy with. This should be an intermediate step on the road to OpenSSL.
| * hashes: Refactor backend into PrivateHashesJulian Andres Klode2024-12-211-55/+82
| | | | | | | | Everything is abstracted away now.
| * apt-helper: Add a hash-file helper to debug file hashingJulian Andres Klode2024-12-211-10/+41
| |
| * Remove gnupg and versioned gpgv test dependsJulian Andres Klode2024-12-202-6/+1
|/
* Merge branch 'replace-apt-key-sq' into 'main'Julian Andres Klode2024-12-1913-1433/+102
|\ | | | | | | | | Use sq in the test suite, remove apt-key See merge request apt-team/apt!413
| * Use sq in the test suite, remove apt-keyJulian Andres Klode2024-12-1911-964/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove the test case for MD5 and expired signatures, as we can't create them (can't set signing digest, and can't set signature expiry). Tests for them have been added to test-method-gpgv instead. We override sq in a function with cert-store and key-store set to none. This supports both sq 0.40 and sq 1.0.
| * Remove legacy apt-key testsJulian Andres Klode2024-12-192-469/+0
|/
* Release 2.9.182.9.18Julian Andres Klode2024-12-195-6/+20
|
* apt show: Add pinning information for --fullJulian Andres Klode2024-12-192-0/+15
| | | | | Add new fields `APT-Pin`, `APT-Candidate`, and `APT-Release` to the output, same as in EDSP (limited to one release for now).
* Be more strict about which PAGER to execvp() directlyJulian Andres Klode2024-12-192-1/+14
| | | | | | | | | | | There could be | or ; or other stuff in PAGER that needs special handling, let's encode a list of known-good characters instead. This covers all known pagers. You could also try to execvp() PAGER in its entirety and if it fails with ENOENT fall back to the shell but then you don't get correct error handling if the pager really doesn't exist (in which case we should abort trying to page).
* Merge branch 'pager' into 'main'Julian Andres Klode2024-12-1913-7/+322
|\ | | | | | | | | Introduce automatic pager for read commands See merge request apt-team/apt!410
| * Introduce automatic pager for read commandsJulian Andres Klode2024-12-1813-7/+322
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Automatically show the output of `show`, `policy`, `list`, `search`, `showsrc` in a pager. The pager setup is inspired by git's pager setup. Notably, the pager is found using APT_PAGER and PAGER variables. We wait for the pager to be setup somewhat correctly by using a notify pipe to figure out whether execvp() was succesful - then the pipe will read EOF as the other end got closed by CLOEXEC during exec - or not, then the pipe will contain an errno. We set up the correct handlers for signals and exit to close the fds and wait for the pager. Notably inside the signal handler we cannot flush our streams, only close them, so there is some duplication. We call the InitOutputPager() function from inside the various Do...() functions rather than setting it up generally in InitOutput(). Doing so allows us to first render the progress without a pager, and then setup the pager for the content only which improves user experience. When we setup a pager we also take care to disable standard input, as we should not be prompting users while a pager is running (the pager will be reading from the tty directly). We do this by dup2-ing() a /dev/null over it; if we just close()d the fd, another open() might reuse the fd number and problems could occur.
* | gpgv: Extract VerifyDetachedSignatureFile()Julian Andres Klode2024-12-171-73/+90
|/ | | | | This is a pretty standalone function, extract it for later reuse.
* Fix out-of-bounds read in `apt show :`Julian Andres Klode2024-12-162-0/+7
| | | | | | | | We tried to access str.size() - 1 on a 0-sized string, which does not work, and now that we build with assertions triggers it. Closes: #1090068
* Release 2.9.172.9.17Julian Andres Klode2024-12-0759-4013/+3210
|
* Merge branch 'bye-apt-key' into 'main'Julian Andres Klode2024-12-0715-338/+55
|\ | | | | | | | | Stop using apt-key for verification and move apt-key to test/ See merge request apt-team/apt!406
| * methods/gpgv: Remove apt-key mentionsJulian Andres Klode2024-12-072-5/+5
| |
| * Remove the apt-key manual page and add documentation to apt-secureJulian Andres Klode2024-12-076-273/+37
| | | | | | | | | | | | | | We move the user configuration section to the top of the manual page as that is going to be what most are interested in and rewrite it to cover all the modern ways to configure keys in a succinct way.
| * Stop installing apt-key, make it a test suite helperJulian Andres Klode2024-12-076-56/+9
| |
| * gpgv: Drop references to apt-keyJulian Andres Klode2024-12-071-4/+4
|/
* Merge branch 'gpgv-merge-keyring' into 'main'Julian Andres Klode2024-12-042-24/+28
|\ | | | | | | | | gpgv: Merge all keyrings into a single one again See merge request apt-team/apt!408
| * gpgv: Merge all keyrings into a single one againJulian Andres Klode2024-12-042-24/+28
|/ | | | | | | | | | | | | | | gpgv is quite picky, it takes at most 40 keyrings but it also doesn't even take keyrings with : in the name, generating an ERROR message instead. So instead let's always merge the configured keyrings for the source into a single one. While we are at it, since we are merging now, let's also add some rudimentary error checking to what we write into the merged keyring: If copying into it fails, we should abort. Reported-by: SuShY on IRC
* solver3: Reject all non-candidates outright for strict pinningJulian Andres Klode2024-12-034-30/+24
| | | | | | | | Reimplement strict pinning by rejecting the non-candidates when translating the problem from the depcache to the solver. This is substantially better than restricting the list of alternatives for an or group to only include allowed ones for debugging purposes, albeit a bit slower.
* solver3: Add a missing debug level checkJulian Andres Klode2024-12-031-1/+2
|
* solver3: Fix intransitivity of version comparison on upgradeJulian Andres Klode2024-12-022-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | We only compared candidate to installed version, but candidate should dominate all versions, otherwise we end up in the fancy problem of elpa-notmuch in upgrade-noble-t64-remove-desktop-2024-03-29.edsp Where we had three versions: not-installable 0.38.3-1ubuntu1 candidate 0.38.2-1.1ubuntu2 installed 0.38.2-1ubuntu2 And received an ordering: installed > non-installable > candidate despite candidate > installed This is only visible with no-strict-pinning right now, as we are otherwise filtering out invalid choices (and hence we only have candidate and installed otherwise).
* Release 2.9.162.9.16Julian Andres Klode2024-11-295-6/+14
|
* Avoid extension check for .gpgJulian Andres Klode2024-11-291-12/+12
| | | | | | | | | | | | We only ever documented .gpg and .asc and have ensured that only such files exist in the keyring, but people can set the Signed-By option to keys with any random extension, as that was not validated before by apt-key. This doesn't change the behavior for trusted.gpg.d: We filter the directory listing and only look at .gpg and .asc files. Closes: #1088656
* Release 2.9.152.9.15Julian Andres Klode2024-11-286-6/+38
|
* Merge branch 'prep-bye-apt-key' into 'main'Julian Andres Klode2024-11-2811-90/+313
|\ | | | | | | | | Stop using apt-key See merge request apt-team/apt!407
| * Detect working gpgv using gpgv --dump-optionsJulian Andres Klode2024-11-283-43/+71
| | | | | | | | | | | | | | | | | | | | | | | | This gains us support for not using an absolute path, which is nice, and we can now cache the invocation across fork() in the method. Still keep preferring absolute paths, this avoids execvp() having to iterate the path and reduces bug potential with custom gpgv in /usr/local. Fix the last entry in the list of gpgvs to say gpgv1
| * fileutl: Use execvp() in Popen() instead of execv()Julian Andres Klode2024-11-282-2/+2
| |
| * gpgv: Add direct support for --assert-pubkey-algoJulian Andres Klode2024-11-281-0/+23
| |
| * Directly call gpgv instead of apt-keyJulian Andres Klode2024-11-283-46/+40
| |
| * gpgv: Verify keyrings and dearmor outside apt-keyJulian Andres Klode2024-11-281-5/+54
| |
| * strutl: Add Base64DecodeJulian Andres Klode2024-11-283-1/+88
| | | | | | | | | | | | | | | | Lifted from the dpkg mtree code that mjg59 submitted in https://lists.debian.org/debian-dpkg/2018/05/msg00005.html Which as dpkg is GPL-2.0+ also is GPL-2.0+
| * gpgv: Use std::string instead of const char *Julian Andres Klode2024-11-281-39/+33
| | | | | | | | | | This is a bit more overhead here, but if we need to build temporary strings this is a lot cleaner.
| * gpgv: Explictly pass all the keyrings to gpgv from aptJulian Andres Klode2024-11-281-3/+40
| |
| * apt-key: Temporarily accept 'pub' as an extension for binary gpg keysJulian Andres Klode2024-11-281-1/+1
| |
| * apt-key: Only cat supported keyrings into the merged oneJulian Andres Klode2024-11-281-1/+3
| |