Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package otpclient for openSUSE:Factory checked in at 2021-11-17 01:13:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/otpclient (Old) and /work/SRC/openSUSE:Factory/.otpclient.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "otpclient" Wed Nov 17 01:13:47 2021 rev:9 rq:931612 version:2.4.6 Changes: -------- --- /work/SRC/openSUSE:Factory/otpclient/otpclient.changes 2021-04-15 16:57:53.838719869 +0200 +++ /work/SRC/openSUSE:Factory/.otpclient.new.1890/otpclient.changes 2021-11-17 01:14:45.546183474 +0100 @@ -1,0 +2,9 @@ +Mon Nov 15 13:46:23 UTC 2021 - Paolo Stivanin <i...@paolostivanin.com> + +- Update to 2.4.6: + * Use secure_strdup when trimming the account key. + * Use g_memdup2 when available. + * Fix account/issuer when importing andOTP db. + * Check for NULL when comparing account and issuer. + +------------------------------------------------------------------- Old: ---- v2.4.4.tar.gz v2.4.4.tar.gz.asc New: ---- v2.4.6.tar.gz v2.4.6.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ otpclient.spec ++++++ --- /var/tmp/diff_new_pack.42KLXf/_old 2021-11-17 01:14:46.062183668 +0100 +++ /var/tmp/diff_new_pack.42KLXf/_new 2021-11-17 01:14:46.066183669 +0100 @@ -18,7 +18,7 @@ %define uclname OTPClient Name: otpclient -Version: 2.4.4 +Version: 2.4.6 Release: 0 Summary: Simple GTK+ client for managing TOTP and HOTP License: GPL-3.0-or-later ++++++ v2.4.4.tar.gz -> v2.4.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/.ci/install_deps.sh new/OTPClient-2.4.6/.ci/install_deps.sh --- old/OTPClient-2.4.4/.ci/install_deps.sh 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/.ci/install_deps.sh 2021-11-15 14:34:24.000000000 +0100 @@ -2,7 +2,7 @@ set -e -function __compile_and_install { +__compile_and_install() { cmake .. -DCMAKE_INSTALL_PREFIX=/usr make -j2 make install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/.ci/install_otpclient.sh new/OTPClient-2.4.6/.ci/install_otpclient.sh --- old/OTPClient-2.4.4/.ci/install_otpclient.sh 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/.ci/install_otpclient.sh 2021-11-15 14:34:24.000000000 +0100 @@ -2,7 +2,7 @@ set -e -function __compile_and_install { +__compile_and_install() { cmake .. -DCMAKE_INSTALL_PREFIX=/usr make -j2 make install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/.circleci/config.yml new/OTPClient-2.4.6/.circleci/config.yml --- old/OTPClient-2.4.4/.circleci/config.yml 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/.circleci/config.yml 2021-11-15 14:34:24.000000000 +0100 @@ -53,5 +53,5 @@ - ubuntu1804 - ubuntuLatestRolling - debianLatestStable - - fedoraLatestStable - #- archlinux + #- fedoraLatestStable + - archlinux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/.github/workflows/codeql-analysis.yml new/OTPClient-2.4.6/.github/workflows/codeql-analysis.yml --- old/OTPClient-2.4.4/.github/workflows/codeql-analysis.yml 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/.github/workflows/codeql-analysis.yml 2021-11-15 14:34:24.000000000 +0100 @@ -35,7 +35,7 @@ cd OTPClient && chmod +x .ci/install_deps.sh && sudo .ci/install_deps.sh - name: Build - run: | + run: | mkdir build && cd $_ cmake .. make diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/LICENSE new/OTPClient-2.4.6/LICENSE --- old/OTPClient-2.4.4/LICENSE 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/LICENSE 2021-11-15 14:34:24.000000000 +0100 @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -631,8 +631,8 @@ state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - OTPClient - Simple GTK+ software to generate OTPs - Copyright (C) 2019 Paolo Stivanin + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -645,14 +645,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + along with this program. If not, see <https://www.gnu.org/licenses/>. Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - OTPClient Copyright (C) 2021 Paolo Stivanin + <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. @@ -664,11 +664,11 @@ You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. +<https://www.gnu.org/licenses/>. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. +<https://www.gnu.org/licenses/why-not-lgpl.html>. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/README.md new/OTPClient-2.4.6/README.md --- old/OTPClient-2.4.4/README.md 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/README.md 2021-11-15 14:34:24.000000000 +0100 @@ -16,6 +16,7 @@ |libpng|1.2.0|-| |[libcotp](https://github.com/paolostivanin/libcotp)|1.2.1|-| |zbar|0.10|0.20 ([linuxtv](https://linuxtv.org/downloads/zbar/))| +|cmake|3.5|-| ## Features - support both TOTP and HOTP @@ -36,19 +37,19 @@ * With every commit to master, OTPClient is compiled in CircleCI against different distros ## Wiki -For things like roadmap, screenshots, how to use OTPClient, etc, please have a lookt at the [project's wiki](https://github.com/paolostivanin/OTPClient/wiki). You'll find a lot of useful information there. +For things like roadmap, screenshots, how to use OTPClient, etc, please have a look at the [project's wiki](https://github.com/paolostivanin/OTPClient/wiki). You'll find a lot of useful information there. ## Manual installation If OTPClient hasn't been packaged for your distro ([check here](https://github.com/paolostivanin/OTPClient/wiki/Tested-OS-&-Packages#packages)) and your distro doesn't support Flatpak, then you'll have to manually compile and install OTPClient. 1. install all the needed libraries listed under [requirements](#requirements) 2. clone and install OTPClient: ``` -$ git clone https://github.com/paolostivanin/OTPClient.git -$ cd OTPClient -$ mkdir build && cd $_ -$ cmake -DCMAKE_INSTALL_PREFIX=/usr .. -$ make -$ sudo make install +git clone https://github.com/paolostivanin/OTPClient.git +cd OTPClient +mkdir build && cd build +cmake -DCMAKE_INSTALL_PREFIX=/usr .. +make +sudo make install ``` ## License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/SECURITY.md new/OTPClient-2.4.6/SECURITY.md --- old/OTPClient-2.4.4/SECURITY.md 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/SECURITY.md 2021-11-15 14:34:24.000000000 +0100 @@ -20,5 +20,5 @@ The following is the workflow: - security issue is found, e-mail is sent to me - within 24 hours I will reply to your e-mail with some info like, for example, whether it actually is a security issue and how serious it is -- within 30 days I will develop and ship a fix +- within 15 days I will develop and ship a fix - once the update is out I will open a [security advisory](https://github.com/paolostivanin/OTPClient/security/advisories) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/data/com.github.paolostivanin.OTPClient.appdata.xml new/OTPClient-2.4.6/data/com.github.paolostivanin.OTPClient.appdata.xml --- old/OTPClient-2.4.4/data/com.github.paolostivanin.OTPClient.appdata.xml 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/data/com.github.paolostivanin.OTPClient.appdata.xml 2021-11-15 14:34:24.000000000 +0100 @@ -282,4 +282,8 @@ </description> </release> </releases> + <custom> + <value key="Purism::form_factor">workstation</value> + <value key="Purism::form_factor">mobile</value> + </custom> </component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/data/com.github.paolostivanin.OTPClient.desktop new/OTPClient-2.4.6/data/com.github.paolostivanin.OTPClient.desktop --- old/OTPClient-2.4.4/data/com.github.paolostivanin.OTPClient.desktop 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/data/com.github.paolostivanin.OTPClient.desktop 2021-11-15 14:34:24.000000000 +0100 @@ -8,3 +8,4 @@ Comment=GTK+ TOTP and HOTP client Categories=GTK;GNOME;Utility; StartupWMClass=otpclient +X-Purism-FormFactor=Workstation;Mobile; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/flatpak/build-flatpak.sh new/OTPClient-2.4.6/flatpak/build-flatpak.sh --- old/OTPClient-2.4.4/flatpak/build-flatpak.sh 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/flatpak/build-flatpak.sh 2021-11-15 14:34:24.000000000 +0100 @@ -5,6 +5,6 @@ --ccache \ --require-changes \ --repo=repo \ - --arch=$(flatpak --default-arch) \ + --arch="$(flatpak --default-arch)" \ --subject="build of com.github.paolostivanin.OTPClient, $(date)" \ build com.github.paolostivanin.OTPClient.yaml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/flatpak/com.github.paolostivanin.OTPClient.yaml new/OTPClient-2.4.6/flatpak/com.github.paolostivanin.OTPClient.yaml --- old/OTPClient-2.4.4/flatpak/com.github.paolostivanin.OTPClient.yaml 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/flatpak/com.github.paolostivanin.OTPClient.yaml 2021-11-15 14:34:24.000000000 +0100 @@ -94,4 +94,4 @@ sources: - type: git url: https://github.com/paolostivanin/OTPClient.git - branch: master + branch: master diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/flatpak/run-flatpak.sh new/OTPClient-2.4.6/flatpak/run-flatpak.sh --- old/OTPClient-2.4.4/flatpak/run-flatpak.sh 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/flatpak/run-flatpak.sh 2021-11-15 14:34:24.000000000 +0100 @@ -1,3 +1,3 @@ #!/bin/bash -flatpak-builder --run build com.github.paolostivanin.OTPClient.yaml otpclient +flatpak-builder --run build com.github.paolostivanin.OTPClient.yaml otpclient diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/add-common.c new/OTPClient-2.4.6/src/add-common.c --- old/OTPClient-2.4.4/src/add-common.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/add-common.c 2021-11-15 14:34:24.000000000 +0100 @@ -17,7 +17,7 @@ } gchar *err_msg = check_params (otps); - if (err_msg != NULL){ + if (err_msg != NULL) { return err_msg; } @@ -53,4 +53,4 @@ } return NULL; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/add-common.h new/OTPClient-2.4.6/src/add-common.h --- old/OTPClient-2.4.4/src/add-common.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/add-common.h 2021-11-15 14:34:24.000000000 +0100 @@ -7,4 +7,4 @@ gchar *add_data_to_db (const gchar *otp_uri, AppData *app_data); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/add-from-qr.c new/OTPClient-2.4.6/src/add-from-qr.c --- old/OTPClient-2.4.4/src/add-from-qr.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/add-from-qr.c 2021-11-15 14:34:24.000000000 +0100 @@ -191,4 +191,4 @@ } else { show_message_dialog (app_data->main_window, "Couldn't get QR code image from clipboard", GTK_MESSAGE_ERROR); } -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/app.c new/OTPClient-2.4.6/src/app.c --- old/OTPClient-2.4.4/src/app.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/app.c 2021-11-15 14:34:24.000000000 +0100 @@ -242,10 +242,10 @@ show_memlock_warn_dialog (gint32 max_file_size, GtkBuilder *builder) { - gchar *msg = g_strdup_printf ("Your OS's memlock limit (%d) may be too low for you.\n" - "This could crash the program when importing data from 3rd party apps\n" - "or when a certain amount of tokens is reached.\n" - "Please have a look at the <a href=\"https://github.com/paolostivanin/OTPClient/wiki/Secure-Memory-Limitations\">secure memory wiki</a> page before\n" + gchar *msg = g_strdup_printf ("Your OS's memlock limit (%d) may be too low for you. " + "This could crash the program when importing data from 3rd party apps " + "or when a certain amount of tokens is reached. " + "Please have a look at the <a href=\"https://github.com/paolostivanin/OTPClient/wiki/Secure-Memory-Limitations\">secure memory wiki</a> page before " "using this software with the current settings.", max_file_size); GtkWidget *warn_diag = GTK_WIDGET(gtk_builder_get_object (builder, "warning_diag_id")); GtkLabel *warn_label = GTK_LABEL(gtk_builder_get_object (builder, "warning_diag_label_id")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/authplus.c new/OTPClient-2.4.6/src/authplus.c --- old/OTPClient-2.4.4/src/authplus.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/authplus.c 2021-11-15 14:34:24.000000000 +0100 @@ -70,4 +70,4 @@ gcry_free (sec_buf); return otps; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/cli/get-data.c new/OTPClient-2.4.6/src/cli/get-data.c --- old/OTPClient-2.4.4/src/cli/get-data.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/cli/get-data.c 2021-11-15 14:34:24.000000000 +0100 @@ -24,22 +24,39 @@ json_t *obj; gboolean found = FALSE; json_array_foreach (db_data->json_data, index, obj) { - if (compare_strings (json_string_value (json_object_get (obj, "label")), account, match_exactly) == 0){ - if (issuer != NULL) { - if (compare_strings (json_string_value (json_object_get (obj, "issuer")), issuer, match_exactly) == 0) { + const gchar *account_from_db = json_string_value (json_object_get (obj, "label")); + const gchar *issuer_from_db = NULL; + if (issuer != NULL) { + issuer_from_db = json_string_value (json_object_get (obj, "issuer")); + } + if (account_from_db != NULL && issuer_from_db != NULL && account != NULL) { + // both account and issuer are present + if (compare_strings (account_from_db, account, match_exactly) == 0 && compare_strings (issuer_from_db, issuer, match_exactly) == 0) { + get_token (obj, db_data, show_next_token); + found = TRUE; + } + } else { + if (account_from_db != NULL && account != NULL) { + // account is present, but issuer is not + if (compare_strings (account_from_db, account, match_exactly) == 0) { get_token (obj, db_data, show_next_token); found = TRUE; } } else { - get_token (obj, db_data, show_next_token); - found = TRUE; + // account was null, but issue may be present + if (issuer_from_db != NULL) { + if (compare_strings (issuer_from_db, issuer, match_exactly) == 0) { + get_token (obj, db_data, show_next_token); + found = TRUE; + } + } } } } if (!found) { g_printerr ("Couldn't find the data. Either the given data is wrong or is not in the database.\n"); - g_printerr ("Given account: %s\n", account); - if (issuer != NULL) g_printerr ("Given issuer: %s\n", issuer); + g_printerr ("Given account: %s\n", account != NULL ? account : "<none>"); + g_printerr ("Given issuer: %s\n", issuer != NULL ? issuer : "<none>"); return; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/cli/get-data.h new/OTPClient-2.4.6/src/cli/get-data.h --- old/OTPClient-2.4.4/src/cli/get-data.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/cli/get-data.h 2021-11-15 14:34:24.000000000 +0100 @@ -13,4 +13,4 @@ void list_all_acc_iss (DatabaseData *db_data); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/cli/help.c new/OTPClient-2.4.6/src/cli/help.c --- old/OTPClient-2.4.4/src/cli/help.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/cli/help.c 2021-11-15 14:34:24.000000000 +0100 @@ -76,4 +76,4 @@ g_print (" -d, --directory\tThe output directory where the exported file will be saved.\n"); g_print ("\t\t\tIf nothing is specified OR flatpak is being used, the output folder will be the user's HOME directory.\n"); g_print ("\n"); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/cli/help.h new/OTPClient-2.4.6/src/cli/help.h --- old/OTPClient-2.4.4/src/cli/help.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/cli/help.h 2021-11-15 14:34:24.000000000 +0100 @@ -7,4 +7,4 @@ gboolean show_help (const gchar *prg_name, const gchar *help_command); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/cli/main.c new/OTPClient-2.4.6/src/cli/main.c --- old/OTPClient-2.4.4/src/cli/main.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/cli/main.c 2021-11-15 14:34:24.000000000 +0100 @@ -249,4 +249,4 @@ gchar *realloc_pwd = gcry_realloc (pwd, g_utf8_strlen (pwd, -1) + 1); return realloc_pwd; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/aegis.c new/OTPClient-2.4.6/src/common/aegis.c --- old/OTPClient-2.4.4/src/common/aegis.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/aegis.c 2021-11-15 14:34:24.000000000 +0100 @@ -5,6 +5,7 @@ #include "../imports.h" #include "../gui-common.h" #include "../gquarks.h" +#include "common.h" static GSList *parse_json_data (const gchar *data, @@ -173,7 +174,7 @@ return NULL; } - otps = g_slist_append (otps, g_memdup (otp, sizeof (otp_t))); + otps = g_slist_append (otps, g_memdupX (otp, sizeof (otp_t))); g_free (otp); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/andotp.c new/OTPClient-2.4.6/src/common/andotp.c --- old/OTPClient-2.4.4/src/common/andotp.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/andotp.c 2021-11-15 14:34:24.000000000 +0100 @@ -7,6 +7,7 @@ #include "../imports.h" #include "../gui-common.h" #include "../gquarks.h" +#include "common.h" #define ANDOTP_IV_SIZE 12 #define ANDOTP_SALT_SIZE 12 @@ -317,15 +318,18 @@ otp->secret = secure_strdup (json_string_value (json_object_get (obj, "secret"))); const gchar *issuer = json_string_value (json_object_get (obj, "issuer")); - otp->issuer = g_strstrip (g_strdup (issuer)); - + if (issuer != NULL && g_utf8_strlen (issuer, -1) > 1) { + otp->issuer = g_strstrip (g_strdup (issuer)); + } + const gchar *label_with_prefix = json_string_value (json_object_get (obj, "label")); gchar **tokens = g_strsplit (label_with_prefix, ":", -1); if (tokens[0] && tokens[1]) { - if(issuer != NULL && g_ascii_strcasecmp(issuer, tokens[0]) == 0) { + if (issuer != NULL && g_ascii_strcasecmp(issuer, tokens[0]) == 0) { otp->account_name = g_strstrip (g_strdup (tokens[1])); } else { - otp->account_name = g_strstrip (g_strdup (label_with_prefix)); + otp->issuer = g_strstrip (g_strdup (tokens[0])); + otp->account_name = g_strstrip (g_strdup (tokens[1])); } } else { otp->account_name = g_strstrip (g_strdup (tokens[0])); @@ -371,7 +375,7 @@ return NULL; } - otps = g_slist_append (otps, g_memdup (otp, sizeof (otp_t))); + otps = g_slist_append (otps, g_memdupX (otp, sizeof (otp_t))); g_free (otp); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/common.c new/OTPClient-2.4.6/src/common/common.c --- old/OTPClient-2.4.4/src/common/common.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/common.c 2021-11-15 14:34:24.000000000 +0100 @@ -64,7 +64,7 @@ jenkins_one_at_a_time_hash (const gchar *key, gsize len) { guint32 hash, i; - for(hash = i = 0; i < len; ++i) { + for (hash = i = 0; i < len; ++i) { hash += key[i]; hash += (hash << 10); hash ^= (hash >> 6); @@ -98,3 +98,32 @@ return hash; } + +gchar * +secure_strdup (const gchar *src) +{ + gchar *sec_buf = gcry_calloc_secure (strlen (src) + 1, 1); + memcpy (sec_buf, src, strlen (src) + 1); + + return sec_buf; +} + + +gchar * +g_trim_whitespace (const gchar *str) +{ + if (g_utf8_strlen (str, -1) == 0) { + return NULL; + } + gchar *sec_buf = gcry_calloc_secure (strlen (str) + 1, 1); + int pos = 0; + for (int i = 0; str[i]; i++) { + if (str[i] != ' ') { + sec_buf[pos++] = str[i]; + } + } + sec_buf[pos] = '\0'; + gcry_realloc (sec_buf, g_utf8_strlen(sec_buf, -1) + 1); + + return sec_buf; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/common.h new/OTPClient-2.4.6/src/common/common.h --- old/OTPClient-2.4.4/src/common/common.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/common.h 2021-11-15 14:34:24.000000000 +0100 @@ -5,6 +5,12 @@ G_BEGIN_DECLS +#if GLIB_CHECK_VERSION(2, 68, 0) + #define g_memdupX g_memdup2 +#else + #define g_memdupX g_memdup +#endif + gint32 get_max_file_size_from_memlock (void); gchar *init_libs (gint32 max_file_size); @@ -16,4 +22,8 @@ guint32 json_object_get_hash (json_t *obj); -G_END_DECLS \ No newline at end of file +gchar *secure_strdup (const gchar *src); + +gchar *g_trim_whitespace (const gchar *str); + +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/exports.h new/OTPClient-2.4.6/src/common/exports.h --- old/OTPClient-2.4.4/src/common/exports.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/exports.h 2021-11-15 14:34:24.000000000 +0100 @@ -25,4 +25,4 @@ gchar *export_aegis (const gchar *export_path, json_t *json_db_data); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/get-providers-data.h new/OTPClient-2.4.6/src/common/get-providers-data.h --- old/OTPClient-2.4.4/src/common/get-providers-data.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/get-providers-data.h 2021-11-15 14:34:24.000000000 +0100 @@ -21,4 +21,4 @@ GSList *get_aegis_data (const gchar *path, GError **err); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/common/version.h.in new/OTPClient-2.4.6/src/common/version.h.in --- old/OTPClient-2.4.4/src/common/version.h.in 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/common/version.h.in 2021-11-15 14:34:24.000000000 +0100 @@ -2,4 +2,4 @@ #define PROJECT_NAME "@PROJECT_NAME@" #define PROJECT_VER "@PROJECT_VERSION@" -#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" \ No newline at end of file +#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/data.h new/OTPClient-2.4.6/src/data.h --- old/OTPClient-2.4.4/src/data.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/data.h 2021-11-15 14:34:24.000000000 +0100 @@ -59,4 +59,4 @@ GtkFileChooserAction open_db_file_action; } AppData; -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/db-misc.c new/OTPClient-2.4.6/src/db-misc.c --- old/OTPClient-2.4.4/src/db-misc.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/db-misc.c 2021-11-15 14:34:24.000000000 +0100 @@ -69,7 +69,7 @@ json_t *obj; json_array_foreach (db_data->json_data, index, obj) { guint32 hash = json_object_get_hash (obj); - db_data->objects_hash = g_slist_append (db_data->objects_hash, g_memdup (&hash, sizeof (guint32))); + db_data->objects_hash = g_slist_append (db_data->objects_hash, g_memdupX (&hash, sizeof (guint32))); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/db-misc.h new/OTPClient-2.4.6/src/db-misc.h --- old/OTPClient-2.4.4/src/db-misc.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/db-misc.h 2021-11-15 14:34:24.000000000 +0100 @@ -26,4 +26,4 @@ gint check_duplicate (gconstpointer data, gconstpointer user_data); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/edit-data.c new/OTPClient-2.4.6/src/edit-data.c --- old/OTPClient-2.4.4/src/edit-data.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/edit-data.c 2021-11-15 14:34:24.000000000 +0100 @@ -133,4 +133,4 @@ json_t *obj = json_array_get (edit_data->db_data->json_data, row_number); json_object_set (obj, "label", json_string (label)); json_object_set (obj, "issuer", json_string (issuer)); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/file-size.c new/OTPClient-2.4.6/src/file-size.c --- old/OTPClient-2.4.4/src/file-size.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/file-size.c 2021-11-15 14:34:24.000000000 +0100 @@ -24,4 +24,4 @@ g_object_unref (file); return file_size; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/file-size.h new/OTPClient-2.4.6/src/file-size.h --- old/OTPClient-2.4.4/src/file-size.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/file-size.h 2021-11-15 14:34:24.000000000 +0100 @@ -4,4 +4,4 @@ goffset get_file_size (const gchar *path); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/get-builder.c new/OTPClient-2.4.6/src/get-builder.c --- old/OTPClient-2.4.4/src/get-builder.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/get-builder.c 2021-11-15 14:34:24.000000000 +0100 @@ -18,4 +18,4 @@ g_free (path); return builder; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/get-builder.h new/OTPClient-2.4.6/src/get-builder.h --- old/OTPClient-2.4.4/src/get-builder.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/get-builder.h 2021-11-15 14:34:24.000000000 +0100 @@ -6,4 +6,4 @@ GtkBuilder *get_builder_from_partial_path (const gchar *partial_path); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/gquarks.c new/OTPClient-2.4.6/src/gquarks.c --- old/OTPClient-2.4.4/src/gquarks.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/gquarks.c 2021-11-15 14:34:24.000000000 +0100 @@ -40,4 +40,4 @@ memlock_error_gquark (void) { return g_quark_from_static_string ("memlock_error"); -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/gquarks.h new/OTPClient-2.4.6/src/gquarks.h --- old/OTPClient-2.4.4/src/gquarks.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/gquarks.h 2021-11-15 14:34:24.000000000 +0100 @@ -23,4 +23,4 @@ GQuark memlock_error_gquark (void); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/gui-common.c new/OTPClient-2.4.6/src/gui-common.c --- old/OTPClient-2.4.4/src/gui-common.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/gui-common.c 2021-11-15 14:34:24.000000000 +0100 @@ -26,16 +26,6 @@ } -gchar * -secure_strdup (const gchar *src) -{ - gchar *sec_buf = gcry_calloc_secure (strlen (src) + 1, 1); - memcpy (sec_buf, src, strlen (src) + 1); - - return sec_buf; -} - - json_t * build_json_obj (const gchar *type, const gchar *acc_label, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/gui-common.h new/OTPClient-2.4.6/src/gui-common.h --- old/OTPClient-2.4.4/src/gui-common.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/gui-common.h 2021-11-15 14:34:24.000000000 +0100 @@ -13,8 +13,6 @@ guint get_row_number_from_iter (GtkListStore *list_store, GtkTreeIter iter); -gchar *secure_strdup (const gchar *src); - json_t *build_json_obj (const gchar *type, const gchar *acc_label, const gchar *acc_iss, @@ -27,4 +25,4 @@ void send_ok_cb (GtkWidget *entry, gpointer user_data); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/imports.c new/OTPClient-2.4.6/src/imports.c --- old/OTPClient-2.4.4/src/imports.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/imports.c 2021-11-15 14:34:24.000000000 +0100 @@ -66,7 +66,7 @@ obj = build_json_obj (otp->type, otp->account_name, otp->issuer, otp->secret, otp->digits, otp->algo, otp->period, otp->counter); guint hash = json_object_get_hash (obj); if (g_slist_find_custom (app_data->db_data->objects_hash, GUINT_TO_POINTER(hash), check_duplicate) == NULL) { - app_data->db_data->objects_hash = g_slist_append (app_data->db_data->objects_hash, g_memdup (&hash, sizeof (guint))); + app_data->db_data->objects_hash = g_slist_append (app_data->db_data->objects_hash, g_memdupX (&hash, sizeof (guint))); app_data->db_data->data_to_add = g_slist_append (app_data->db_data->data_to_add, obj); } else { g_print ("[INFO] Duplicate element not added\n"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/imports.h new/OTPClient-2.4.6/src/imports.h --- old/OTPClient-2.4.4/src/imports.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/imports.h 2021-11-15 14:34:24.000000000 +0100 @@ -40,4 +40,4 @@ void free_otps_gslist (GSList *otps, guint list_len); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/liststore-misc.h new/OTPClient-2.4.6/src/liststore-misc.h --- old/OTPClient-2.4.4/src/liststore-misc.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/liststore-misc.h 2021-11-15 14:34:24.000000000 +0100 @@ -10,4 +10,4 @@ GtkTreeIter iter, AppData *app_data); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/lock-app.c new/OTPClient-2.4.6/src/lock-app.c --- old/OTPClient-2.4.4/src/lock-app.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/lock-app.c 2021-11-15 14:34:24.000000000 +0100 @@ -116,4 +116,4 @@ app_data->subscription_ids[i] = g_dbus_connection_signal_subscribe (app_data->connection, interfaces[i], interfaces[i], signal_names[i], paths[i], NULL, G_DBUS_SIGNAL_FLAGS_NONE, signal_triggered_cb, app_data, NULL); } -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/manual-add-cb.c new/OTPClient-2.4.6/src/manual-add-cb.c --- old/OTPClient-2.4.4/src/manual-add-cb.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/manual-add-cb.c 2021-11-15 14:34:24.000000000 +0100 @@ -97,4 +97,4 @@ gtk_entry_set_text (GTK_ENTRY(widgets->period_entry), ""); gtk_entry_set_text (GTK_ENTRY(widgets->counter_entry), ""); } -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/manual-add-cb.h new/OTPClient-2.4.6/src/manual-add-cb.h --- old/OTPClient-2.4.4/src/manual-add-cb.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/manual-add-cb.h 2021-11-15 14:34:24.000000000 +0100 @@ -15,4 +15,4 @@ gboolean parse_user_data (Widgets *widgets, - DatabaseData *db_data); \ No newline at end of file + DatabaseData *db_data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/message-dialogs.c new/OTPClient-2.4.6/src/message-dialogs.c --- old/OTPClient-2.4.4/src/message-dialogs.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/message-dialogs.c 2021-11-15 14:34:24.000000000 +0100 @@ -49,4 +49,4 @@ gtk_widget_destroy (dialog); return confirm; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/message-dialogs.h new/OTPClient-2.4.6/src/message-dialogs.h --- old/OTPClient-2.4.4/src/message-dialogs.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/message-dialogs.h 2021-11-15 14:34:24.000000000 +0100 @@ -11,4 +11,4 @@ gboolean get_confirmation_from_dialog (GtkWidget *parent, const gchar *message); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/parse-data.c new/OTPClient-2.4.6/src/parse-data.c --- old/OTPClient-2.4.4/src/parse-data.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/parse-data.c 2021-11-15 14:34:24.000000000 +0100 @@ -1,6 +1,7 @@ #include <gtk/gtk.h> #include <string.h> #include <jansson.h> +#include <gcrypt.h> #include "otpclient.h" #include "db-misc.h" #include "manual-add-cb.h" @@ -47,18 +48,21 @@ const gchar *counter = gtk_entry_get_text (GTK_ENTRY (widgets->counter_entry)); gboolean period_active = gtk_widget_get_sensitive (widgets->period_entry); gboolean counter_active = gtk_widget_get_sensitive (widgets->counter_entry); - if (is_input_valid (widgets->dialog, acc_label, acc_iss, acc_key, digits, period, period_active, counter, counter_active)) { - obj = get_json_obj (widgets, acc_label, acc_iss, acc_key, digits, period, counter); + gchar *acc_key_trimmed = g_trim_whitespace (acc_key); + if (is_input_valid (widgets->dialog, acc_label, acc_iss, acc_key_trimmed, digits, period, period_active, counter, counter_active)) { + obj = get_json_obj (widgets, acc_label, acc_iss, acc_key_trimmed, digits, period, counter); guint32 hash = json_object_get_hash (obj); if (g_slist_find_custom (db_data->objects_hash, GUINT_TO_POINTER (hash), check_duplicate) == NULL) { - db_data->objects_hash = g_slist_append (db_data->objects_hash, g_memdup (&hash, sizeof (guint))); + db_data->objects_hash = g_slist_append (db_data->objects_hash, g_memdupX (&hash, sizeof (guint))); db_data->data_to_add = g_slist_append (db_data->data_to_add, obj); } else { g_print ("[INFO] Duplicate element not added\n"); } } else { + gcry_free (acc_key_trimmed); return FALSE; } + gcry_free (acc_key_trimmed); return TRUE; } @@ -160,4 +164,4 @@ g_free (algo); return jn; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/parse-uri.c new/OTPClient-2.4.6/src/parse-uri.c --- old/OTPClient-2.4.4/src/parse-uri.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/parse-uri.c 2021-11-15 14:34:24.000000000 +0100 @@ -1,6 +1,7 @@ #include <glib.h> #include "gui-common.h" #include "imports.h" +#include "common/common.h" static void parse_uri (const gchar *uri, @@ -59,7 +60,7 @@ } parse_parameters (uri_copy, otp); - *otps = g_slist_append (*otps, g_memdup (otp, sizeof (otp_t))); + *otps = g_slist_append (*otps, g_memdupX (otp, sizeof (otp_t))); g_free (otp); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/parse-uri.h new/OTPClient-2.4.6/src/parse-uri.h --- old/OTPClient-2.4.4/src/parse-uri.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/parse-uri.h 2021-11-15 14:34:24.000000000 +0100 @@ -7,4 +7,4 @@ void set_otps_from_uris (const gchar *otpauth_uris, GSList **otps); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/password-cb.c new/OTPClient-2.4.6/src/password-cb.c --- old/OTPClient-2.4.4/src/password-cb.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/password-cb.c 2021-11-15 14:34:24.000000000 +0100 @@ -4,6 +4,7 @@ #include "message-dialogs.h" #include "get-builder.h" #include "otpclient.h" +#include "common/common.h" typedef struct _entrywidgets { GtkWidget *entry_old; @@ -40,7 +41,7 @@ pwd_must_be_checked = FALSE; dialog = GTK_WIDGET(gtk_builder_get_object (builder, "decpwd_diag_id")); gchar *text = NULL, *markup = NULL; - if (action_name == NULL){ + if (action_name == NULL) { markup = g_markup_printf_escaped ("%s <span font_family=\"monospace\">%s</span>", "Enter the decryption password for\n", app_data->db_data->db_path); } else { text = g_strdup ("Enter the decryption password"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/password-cb.h new/OTPClient-2.4.6/src/password-cb.h --- old/OTPClient-2.4.4/src/password-cb.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/password-cb.h 2021-11-15 14:34:24.000000000 +0100 @@ -7,4 +7,4 @@ gchar *prompt_for_password (AppData *app_data, gchar *current_key, const gchar *action_name, gboolean is_export_pwd); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/qrcode-parser.c new/OTPClient-2.4.6/src/qrcode-parser.c --- old/OTPClient-2.4.4/src/qrcode-parser.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/qrcode-parser.c 2021-11-15 14:34:24.000000000 +0100 @@ -3,10 +3,11 @@ #include <png.h> #include <glib/gstdio.h> #include "gui-common.h" +#include "common/common.h" typedef struct _image_data_t { - guint width; - guint height; + gulong width; + gulong height; guchar *raw_data; } ImageData; @@ -144,4 +145,4 @@ fclose (file); return NULL; -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/qrcode-parser.h new/OTPClient-2.4.6/src/qrcode-parser.h --- old/OTPClient-2.4.4/src/qrcode-parser.h 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/qrcode-parser.h 2021-11-15 14:34:24.000000000 +0100 @@ -7,4 +7,4 @@ gchar *parse_qrcode (const gchar *png_path, gchar **otpauth_uri); -G_END_DECLS \ No newline at end of file +G_END_DECLS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/shortcuts.c new/OTPClient-2.4.6/src/shortcuts.c --- old/OTPClient-2.4.4/src/shortcuts.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/shortcuts.c 2021-11-15 14:34:24.000000000 +0100 @@ -25,4 +25,4 @@ gtk_widget_show (overlay); g_object_unref (builder); #endif -} \ No newline at end of file +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/ui/otpclient.ui new/OTPClient-2.4.6/src/ui/otpclient.ui --- old/OTPClient-2.4.4/src/ui/otpclient.ui 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/ui/otpclient.ui 2021-11-15 14:34:24.000000000 +0100 @@ -180,6 +180,7 @@ Please note that <b>there is no way to recover a forgotten password.</b></property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -256,8 +257,8 @@ </action-widgets> </object> <object class="GtkDialog" id="decpwd_diag_id"> - <property name="width_request">400</property> - <property name="height_request">150</property> + <property name="default-width">400</property> + <property name="default-height">150</property> <property name="can_focus">False</property> <property name="border_width">5</property> <property name="title" translatable="yes">Password</property> @@ -317,6 +318,7 @@ <property name="margin_bottom">5</property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -395,13 +397,12 @@ <property name="can_focus">False</property> <property name="label" translatable="yes">Select the file with the QR code and copy it (CTRL-C). -If you are using <b>KDE</b>, then you must copy the file <b>before</b> -selecting this option, otherwise the content won't be parsed. +If you are using <b>KDE</b>, then you must copy the file <b>before</b> selecting this option, otherwise the content won't be parsed. -This dialog will close automatically as soon as a valid qrcode -has been found or after 30 seconds if nothing has been detected.</property> +This dialog will close automatically as soon as a valid qrcode has been found or after 30 seconds if nothing has been detected.</property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">True</property> @@ -462,10 +463,10 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="label" translatable="yes">Please place the qrcode <b>in front of the webcam</b>. -This dialog will automatically close as soon as a valid qrcode -has been found or after 30 seconds if nothing has been detected.</property> +This dialog will automatically close as soon as a valid qrcode has been found or after 30 seconds if nothing has been detected.</property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">True</property> @@ -530,10 +531,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_bottom">5</property> - <property name="label" translatable="yes">This seems to be the first time you run OTPClient -on this device. Please select whether you want to -restore an existing database or create a new one.</property> + <property name="label" translatable="yes">This seems to be the first time you run OTPClient on this device. Please select whether you want to restore an existing database or create a new one.</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -640,10 +640,10 @@ <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Please note that "account" is <b>mandatory</b> and "issuer", while optional, -is <b>highly recommended</b></property> + <property name="label" translatable="yes">Please note that "account" is <b>mandatory</b> and "issuer", while optional, is <b>highly recommended</b></property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -753,6 +753,7 @@ <property name="border_width">10</property> <property name="title" translatable="yes">Add Token</property> <property name="window_position">center</property> + <property name="default_width">500</property> <property name="type_hint">dialog</property> <property name="gravity">center</property> <child type="titlebar"> @@ -811,7 +812,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="spacing">2</property> - <property name="homogeneous">True</property> <child> <object class="GtkComboBoxText" id="otp_combotext_id"> <property name="name">otp_cb</property> @@ -942,7 +942,9 @@ <property name="can_focus">True</property> <property name="tooltip_text" translatable="yes">Between 4 and 10</property> <property name="max_length">10</property> + <property name="width_chars">10</property> <property name="text" translatable="yes">6</property> + <property name="caps_lock_warning">False</property> <property name="input_purpose">digits</property> </object> <packing> @@ -981,7 +983,9 @@ <property name="can_focus">True</property> <property name="tooltip_text" translatable="yes">In seconds between 10 and 120</property> <property name="max_length">3</property> + <property name="width_chars">10</property> <property name="text" translatable="yes">30</property> + <property name="caps_lock_warning">False</property> <property name="input_purpose">digits</property> </object> <packing> @@ -1019,6 +1023,8 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="tooltip_text" translatable="yes">Value decided by the server (HOTP only)</property> + <property name="width_chars">10</property> + <property name="caps_lock_warning">False</property> <property name="input_purpose">digits</property> </object> <packing> @@ -1121,6 +1127,7 @@ Please note that <b>there is no way to recover a forgotten password.</b></property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -1795,6 +1802,7 @@ Please type your password to unlock it</property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">False</property> @@ -1840,6 +1848,7 @@ <property name="window_position">center</property> <property name="type_hint">dialog</property> <property name="gravity">center</property> + <property name="default-width">400</property> <child type="titlebar"> <placeholder/> </child> @@ -1897,6 +1906,7 @@ <property name="can_focus">False</property> <property name="use_markup">True</property> <property name="justify">center</property> + <property name="wrap">True</property> </object> <packing> <property name="expand">True</property> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/ui/shortcuts.ui new/OTPClient-2.4.6/src/ui/shortcuts.ui --- old/OTPClient-2.4.4/src/ui/shortcuts.ui 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/ui/shortcuts.ui 2021-11-15 14:34:24.000000000 +0100 @@ -4,7 +4,7 @@ <object class="GtkShortcutsWindow" id="shortcuts-otpclient"> <property name="modal">1</property> - + <child> <object class="GtkShortcutsSection"> <property name="visible">1</property> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OTPClient-2.4.4/src/webcam-add-cb.c new/OTPClient-2.4.6/src/webcam-add-cb.c --- old/OTPClient-2.4.4/src/webcam-add-cb.c 2021-03-30 15:49:00.000000000 +0200 +++ new/OTPClient-2.4.6/src/webcam-add-cb.c 2021-11-15 14:34:24.000000000 +0100 @@ -7,6 +7,7 @@ #include "message-dialogs.h" #include "add-common.h" #include "get-builder.h" +#include "common/common.h" typedef struct _config_data {