Skip to content

Commit

Permalink
Update to release 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
paolostivanin committed Mar 9, 2022
1 parent 0b72c5c commit ffdddbb
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

set(GTKCRYPTO_VERSION_MAJOR "1")
set(GTKCRYPTO_VERSION_MINOR "0")
set(GTKCRYPTO_VERSION_PATCH "1")
set(GTKCRYPTO_VERSION_PATCH "2")
set(GTKCRYPTO_VERSION "${GTKCRYPTO_VERSION_MAJOR}.${GTKCRYPTO_VERSION_MINOR}.${GTKCRYPTO_VERSION_PATCH}")

set(CMAKE_C_STANDARD 11)
Expand Down
12 changes: 12 additions & 0 deletions data/com.github.paolostivanin.GTKCrypto.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ Supported hash algorithms: MD5, SHA-1, SHA-2, SHA-3, GOST, Whirlpool.
</content_rating>

<releases>
<release version="1.0.2" date="2022-03-09">
<description>
<p>GTKCrypto 1.0.2 brings some fixes</p>
<ul>
<li>fix double free when decrypting a file</li>
<li>fix incorrect version set on header bar</li>
<li>fix UI bug when listing GPG keys</li>
<li>fix signature verification workflow</li>
<li>fix UI file path</li>
</ul>
</description>
</release>
<release version="1.0.1" date="2022-03-08">
<description>
<p>GTKCrypto 1.0.1 brings some small fixes</p>
Expand Down
13 changes: 9 additions & 4 deletions src/cleanup.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ gfile_cleanup (GFile *ifile,
g_object_unref(ofile);
}


void
gstream_cleanup (GFileInputStream *istream,
GFileOutputStream *ostream)
{
g_input_stream_close (G_INPUT_STREAM (istream), NULL, NULL);
g_output_stream_close (G_OUTPUT_STREAM (ostream), NULL, NULL);
g_object_unref (istream);
g_object_unref (ostream);
if (istream != NULL) {
g_input_stream_close (G_INPUT_STREAM (istream), NULL, NULL);
g_object_unref (istream);
}
if (ostream != NULL) {
g_output_stream_close (G_OUTPUT_STREAM (ostream), NULL, NULL);
g_object_unref (ostream);
}
}


Expand Down
2 changes: 1 addition & 1 deletion src/decrypt-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ get_g_file_with_encrypted_data (GFileInputStream *in_stream,
}
}

gstream_cleanup (in_stream, out_enc_stream);
gstream_cleanup (NULL, out_enc_stream);
g_free (buf);

return tmp_encrypted_file;
Expand Down
3 changes: 1 addition & 2 deletions src/decrypt-files-cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ prepare_multi_decryption_cb (GtkWidget *widget __attribute__((unused)),

g_mutex_init (&thread_data->mutex);

data->thread_pool = g_thread_pool_new (exec_thread, thread_data, g_get_num_processors (), TRUE, NULL);
data->thread_pool = g_thread_pool_new (exec_thread, thread_data, (gint)g_get_num_processors (), TRUE, NULL);
for (guint i = 0; i < thread_data->list_len; i++) {
g_thread_pool_push (data->thread_pool, g_slist_nth_data (data->files_list, i), NULL);
}
Expand Down Expand Up @@ -126,7 +126,6 @@ exec_thread (gpointer data,
if (thread_data->delete_file && ret == NULL) {
g_unlink (filename);
}

g_mutex_lock (&thread_data->mutex);
thread_data->widgets->running_threads--;
thread_data->widgets->first_run = FALSE;
Expand Down
9 changes: 3 additions & 6 deletions src/gpgme-misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ get_available_keys ()
GSList *list = NULL;
KeyInfo *key_info;

key_info = g_new0 (KeyInfo, 1);
while (1) {
err = gpgme_op_keylist_next (ctx, &key);
if (err) {
break;
}

key_info = g_new0 (KeyInfo, 1);
key_info->key_id = g_strdup (key->subkeys->keyid);
if (key->uids && key->uids->name) {
key_info->name = g_strdup (key->uids->name);
Expand All @@ -193,15 +194,11 @@ get_available_keys ()

list = g_slist_append (list, g_memdupX (key_info, (guint)bytes_to_copy));

g_free (key_info->key_id);
g_free (key_info->name);
g_free (key_info->email);
g_free (key_info->key_fpr);
g_free (key_info);

gpgme_key_release (key);
}

g_free (key_info);
gpgme_release (ctx);

return list;
Expand Down
2 changes: 1 addition & 1 deletion src/gtkcrypto.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#define PARTIAL_PATH_TO_UI_FILE "share/gtkcrypto/widgets.ui"
#define PARTIAL_PATH_TO_UI_FILE "share/gtkcrypto/gtkcrypto.ui"

void show_message_dialog (GtkWidget *parent, const gchar *message, GtkMessageType);

Expand Down
2 changes: 1 addition & 1 deletion src/main.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#define APP_NAME "GTKCrypto"
#define APP_VERSION "1.0.0"
#define APP_VERSION "1.0.2"
#define GCRYPT_MIN_VERSION "1.7.0"
#define SECURE_MEMORY_POOL_SIZE 32768

Expand Down
23 changes: 14 additions & 9 deletions src/verify-signature-cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ verify_signature_cb (GtkWidget *btn __attribute__((unused)),
verify_widgets->signed_file_entry = gtk_entry_new ();
gtk_widget_set_name (GTK_WIDGET (verify_widgets->signed_file_entry), "signed_file_entry");
gtk_entry_set_placeholder_text (GTK_ENTRY (verify_widgets->signed_file_entry), "Choose signed file");
verify_widgets->signature_file_entry = gtk_entry_new ();
gtk_widget_set_name (GTK_WIDGET (verify_widgets->signed_file_entry), "signature_file_entry");
gtk_entry_set_placeholder_text (GTK_ENTRY (verify_widgets->signature_file_entry), "Choose signature (.sig) file");
gtk_editable_set_editable (GTK_EDITABLE (verify_widgets->signed_file_entry), FALSE);
gtk_editable_set_editable (GTK_EDITABLE (verify_widgets->signature_file_entry), FALSE);
gtk_widget_set_hexpand (verify_widgets->signed_file_entry, TRUE);
gtk_widget_set_hexpand (verify_widgets->signature_file_entry, TRUE);

gtk_entry_set_icon_from_icon_name (GTK_ENTRY (verify_widgets->signed_file_entry), GTK_ENTRY_ICON_SECONDARY,
"document-open-symbolic");

verify_widgets->signature_file_entry = gtk_entry_new ();
gtk_widget_set_name (GTK_WIDGET (verify_widgets->signature_file_entry), "signature_file_entry");
gtk_entry_set_placeholder_text (GTK_ENTRY (verify_widgets->signature_file_entry), "Choose signature (.sig) file");
gtk_editable_set_editable (GTK_EDITABLE (verify_widgets->signature_file_entry), FALSE);
gtk_widget_set_hexpand (verify_widgets->signature_file_entry, TRUE);
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (verify_widgets->signature_file_entry), GTK_ENTRY_ICON_SECONDARY,
"document-open-symbolic");

Expand Down Expand Up @@ -158,7 +158,9 @@ select_file_cb (GtkEntry *entry,
verify_widgets->entry_data.entry1_filename = g_strdup (filename);
} else {
verify_widgets->entry_data.entry2_filename = g_strdup (filename);

}
gtk_entry_set_text (entry, filename);

g_free (filename);
}
Expand Down Expand Up @@ -191,9 +193,12 @@ entry_changed_cb (GtkWidget *btn,
gtk_widget_show (thread_data->spinner);
start_spinner (thread_data->spinner);

change_widgets_sensitivity (3, FALSE, &verify_widgets->cancel_btn,
verify_widgets->signed_file_entry,
verify_widgets->signature_file_entry);
if (gtk_widget_get_sensitive (verify_widgets->signed_file_entry) != FALSE) {
gtk_widget_set_sensitive (verify_widgets->signed_file_entry, FALSE);
}
if (gtk_widget_get_sensitive (verify_widgets->signature_file_entry) != FALSE) {
gtk_widget_set_sensitive (verify_widgets->signature_file_entry, FALSE);
}

verify_widgets->thread = g_thread_new (NULL, exec_thread, thread_data);
}
Expand Down

0 comments on commit ffdddbb

Please sign in to comment.