From nobody Tue Sep 06 22:45:25 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MMgT225fWz4bs5T; Tue, 6 Sep 2022 22:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MMgT21fQZz426g; Tue, 6 Sep 2022 22:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662504326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9D/DZs50+Dv0bA7VUDU+91di+5g9oAIAle+I/4jqtG0=; b=LCx+JgGEsmkz7j8tHAUSpHsgIZ4mcTAjDkzHdUOsU+OfGBxMQR88qXwJLmi2NrIatwj5+b 9nz1hQ+vaJjWqi4yCJH747SDT2eTSSXrOEEhAcLsMSBUu8nkuFAUi9yKsoKGpCEGHYmDKV 2kIOZijg20hBmqBfrAbVfWmhSUf91FxYEiJdGUBdK6IzdePOXDDk7wChUSddKnWvOZtbT5 aGVINFbjLI0SljHUEMe+3cWLz6Hfb6z7KWylTFgN6Hem6FOrneFwyjy2c61J/GOGRZrWCZ fG6EE/MMgU9Fn978bA6ELJ9Bk9CSEKGTbCyyyJRtPM+7tHpUW5xnc+6A0zJZMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MMgT20Y2czKF1; Tue, 6 Sep 2022 22:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 286MjPAx081781; Tue, 6 Sep 2022 22:45:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 286MjP7F081780; Tue, 6 Sep 2022 22:45:25 GMT (envelope-from git) Date: Tue, 6 Sep 2022 22:45:25 GMT Message-Id: <202209062245.286MjP7F081780@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Nuno Teixeira Subject: git: cc0b41d49276 - main - security/kdbxviewer: Update to 0.1.11 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc0b41d49276447c1bbd052df4181829d44fe653 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662504326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9D/DZs50+Dv0bA7VUDU+91di+5g9oAIAle+I/4jqtG0=; b=UbZntwVLGv5zB7roYq+7N9+HD1lsmtFMSaF9X+IVwIFDdv44kz6Ua7CYa2KvjcD+M5T9fI yXjlAMDGQaDjwtXe55/Q04U95lLFzd8C/3Jkx5CrIW+SBufszKCRtL/lZSfPzTLpy6YBqP SsAEXRAQv3fEatrQNrnQaeH7GwARbLRXWXRa3BxVf+MbbtoczNMJtwkVGzYEXNfegvvpc9 l3O/LZzAZQjQ8Kuz9CQO1VqD+RyLE0yj9JOiap08lKgdLhlvITSD1F9f+dXsrWtrgtZn/2 zaQOGHi5j8OkyoDggTnPR6YxoL/8ysOtjgVtcfm2fVcM9XpaPP48zTx3j7KDiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662504326; a=rsa-sha256; cv=none; b=djNgyYisxhKVEH3rhBqzGk20UYoRMcZ8/vnSrOCDfi0lOGMHhSfRgtLZMau+bDJFHfJ3tu rPalw7QEpNFhvgfm+KPan8LVwOY5+5IQ/E1rkQstNqGZ50NwYEh1i2MOusqbEPBUTprA97 xzU3Ko+RLAr2gxVzcUHQru0jNbl8P5okpGoOfe7m8PVka/ukfhim0UumfkKfybY8RVU4jk 5ScZhjlkBfNXNR5bjeTrpHJ7zU5Cj2K16zr0MAq3W3y6qRJnwWyW/5Ooaekazhd0d5gEuu D+G5LL7aZDFBM8S8v/BknSNLW3/ova1YIczQiDpwlOsZDaBcbicmVl0RY8JTMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=cc0b41d49276447c1bbd052df4181829d44fe653 commit cc0b41d49276447c1bbd052df4181829d44fe653 Author: Robert Clausecker AuthorDate: 2022-09-06 22:42:46 +0000 Commit: Nuno Teixeira CommitDate: 2022-09-06 22:42:46 +0000 security/kdbxviewer: Update to 0.1.11 - patch two instances of undefined behaviour - patch a potential buffer overflow Changelog: https://github.com/pepa65/kdbxviewer/releases/tag/v0.1.11 PR: 266258 MFH: 2022Q3 --- security/kdbxviewer/Makefile | 2 +- security/kdbxviewer/distinfo | 6 ++--- security/kdbxviewer/files/patch-libcx9r_kdbx.c | 32 ++++++++++++++++++++++++++ security/kdbxviewer/files/patch-src_main.c | 29 +++++++++++++++++++++++ 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/security/kdbxviewer/Makefile b/security/kdbxviewer/Makefile index eaa700656279..02a1f0e6e973 100644 --- a/security/kdbxviewer/Makefile +++ b/security/kdbxviewer/Makefile @@ -1,5 +1,5 @@ PORTNAME= kdbxviewer -PORTVERSION= 0.1.10 +PORTVERSION= 0.1.11 DISTVERSIONPREFIX=v CATEGORIES= security diff --git a/security/kdbxviewer/distinfo b/security/kdbxviewer/distinfo index 98e9295e771f..a2b1cac88dec 100644 --- a/security/kdbxviewer/distinfo +++ b/security/kdbxviewer/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1635952892 -SHA256 (pepa65-kdbxviewer-v0.1.10_GH0.tar.gz) = 0ef77f637b34cb603634b7c2f8247fb5f38e12951961c8e2ae6b7dbf7858fc6d -SIZE (pepa65-kdbxviewer-v0.1.10_GH0.tar.gz) = 140203 +TIMESTAMP = 1662483072 +SHA256 (pepa65-kdbxviewer-v0.1.11_GH0.tar.gz) = de714ca964d637bcb83f591729fc2e9e6a1100d549278f4315129ec4ceb743d0 +SIZE (pepa65-kdbxviewer-v0.1.11_GH0.tar.gz) = 140203 diff --git a/security/kdbxviewer/files/patch-libcx9r_kdbx.c b/security/kdbxviewer/files/patch-libcx9r_kdbx.c new file mode 100644 index 000000000000..a09c9cc7fbe4 --- /dev/null +++ b/security/kdbxviewer/files/patch-libcx9r_kdbx.c @@ -0,0 +1,32 @@ +--- libcx9r/kdbx.c.orig 2022-09-06 17:07:27 UTC ++++ libcx9r/kdbx.c +@@ -112,22 +112,25 @@ static cx9r_err kdbx_read_magic(cx9r_stream_t *stream) + uint8_t const kdbx_magic[KDBX_MAGIC_LENGTH] = { 0x03, 0xd9, 0xa2, 0x9a, + 0x67, 0xfb, 0x4b, 0xb5 }; + DEBUG("Reading magic...\n"); +- uint8_t magic[KDBX_MAGIC_LENGTH]; ++ union { ++ uint8_t magic[KDBX_MAGIC_LENGTH]; ++ uint64_t joined; ++ } m; + + // default return value + cx9r_err err = CX9R_OK; + // read magic bytes +- CHECK((cx9r_sread(magic, 1, KDBX_MAGIC_LENGTH, stream) == KDBX_MAGIC_LENGTH), ++ CHECK((cx9r_sread(m.magic, 1, KDBX_MAGIC_LENGTH, stream) == KDBX_MAGIC_LENGTH), + err, CX9R_FILE_READ_ERR, kdbx_magic_bail); + DEBUG("Proper magic length\n"); + + // compare magic bytes to expected +- CHECK((memcmp(magic, kdbx_magic, KDBX_MAGIC_LENGTH) == 0), err, ++ CHECK((memcmp(m.magic, kdbx_magic, KDBX_MAGIC_LENGTH) == 0), err, + CX9R_BAD_MAGIC, kdbx_magic_bail); + DEBUG("Proper magic content\n"); + + kdbx_magic_bail: +-DEBUG("%016lX (%d)\n", *(uint64_t*)&magic, err); ++DEBUG("%016llX (%d)\n", (unsigned long long)m.joined, err); + return err; + } + diff --git a/security/kdbxviewer/files/patch-src_main.c b/security/kdbxviewer/files/patch-src_main.c new file mode 100644 index 000000000000..8ab02829a5de --- /dev/null +++ b/security/kdbxviewer/files/patch-src_main.c @@ -0,0 +1,29 @@ +--- src/main.c.orig 2022-09-06 17:00:52 UTC ++++ src/main.c +@@ -159,7 +159,7 @@ void print_key_table(cx9r_kt_group *g, int level) { + + // Process commandline + int main(int argc, char **argv) { +- long unsigned int len = PATHLEN, opt, flags = 0; ++ size_t len = PATHLEN, opt, flags = 0; + char *kdbxfilename = malloc(len), *filename = malloc(len), command = 0, + *password = NULL, *self = argv[0] + strlen(argv[0]), + *configfilename = strcat(getenv("HOME"), CONFIGFILENAME); +@@ -246,14 +246,14 @@ int main(int argc, char **argv) { + *filename = 0; + if ((configfile = fopen(configfilename, "r")) != NULL) + while (getline(&filename, &len, configfile) != -1) { +- *(filename+strlen(filename)-1) = 0; ++ filename[strcspn(filename, "\n")] = '\0'; + // Check the latest found file +- if ((kdbxfile = fopen(filename, "r")) != NULL) strcpy(kdbxfilename, filename); ++ if ((kdbxfile = fopen(filename, "r")) != NULL) kdbxfilename = strdup(filename); + *filename = 0; + } + if (*kdbxfilename == 0) + abort(-7, "No database specified on commandline or in configfile\n"); +- else strcpy(filename, kdbxfilename); ++ else filename = strdup(kdbxfilename); + } + + // Set default mode depending on search