revert: restore pre-upstream-merge baseline (tree of 3b673150b)
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m51s
CI Code / Linux (debian) (pull_request) Successful in 6m59s
CI Code / Linux (arch) (pull_request) Successful in 10m12s
CI Code / Code Coverage (pull_request) Successful in 6m44s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 18s
CI Code / Check coding style (pull_request) Successful in 30s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m51s
CI Code / Linux (debian) (pull_request) Successful in 6m59s
CI Code / Linux (arch) (pull_request) Successful in 10m12s
CI Code / Code Coverage (pull_request) Successful in 6m44s
Roll the tree back to the pre-merge tip3b673150b, undoing the upstream sync merge72f4f186d(303 files) and the 13 post-merge commits layered on top of it. Purpose: restore the last pre-sync baseline so the reported OMEMO/OTR encryption regressions can be reproduced against a known-good state and the upstream sync ruled in or out as the cause. Nothing is dropped from history; the merge and every post-merge commit remain reachable and can be cherry-picked back selectively. Baseline:3b673150bchore(chatlog): disable background message file logging (stage 1) Undoes merge:72f4f186dmerge: sync upstream profanity-im/profanity
This commit is contained in:
@@ -4,18 +4,39 @@
|
||||
*
|
||||
* Copyright (C) 2019 Paul Fariello <paul@fariello.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
* Profanity is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Profanity is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Profanity. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link the code of portions of this program with the OpenSSL library under
|
||||
* certain conditions as described in each individual source file, and
|
||||
* distribute linked combinations including the two.
|
||||
*
|
||||
* You must obey the GNU General Public License in all respects for all of the
|
||||
* code used other than OpenSSL. If you modify file(s) with this exception, you
|
||||
* may extend this exception to your version of the file(s), but you are not
|
||||
* obligated to do so. If you do not wish to do so, delete this exception
|
||||
* statement from your version. If you delete this exception statement from all
|
||||
* source files in the program, then also delete it here.
|
||||
*
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#ifdef HAVE_LIBOMEMO_C
|
||||
#include <omemo/signal_protocol.h>
|
||||
#include <omemo/signal_protocol_types.h>
|
||||
#else
|
||||
#include <signal/signal_protocol.h>
|
||||
#include <signal/signal_protocol_types.h>
|
||||
#endif
|
||||
|
||||
#include "log.h"
|
||||
#include "omemo/omemo.h"
|
||||
@@ -233,7 +254,7 @@ omemo_decrypt_func(signal_buffer** output, int cipher, const uint8_t* key, size_
|
||||
{
|
||||
int ret = SG_SUCCESS;
|
||||
gcry_cipher_hd_t hd;
|
||||
unsigned char* plaintext = NULL;
|
||||
unsigned char* plaintext;
|
||||
size_t plaintext_len;
|
||||
int mode;
|
||||
int algo;
|
||||
@@ -268,13 +289,6 @@ omemo_decrypt_func(signal_buffer** output, int cipher, const uint8_t* key, size_
|
||||
}
|
||||
|
||||
plaintext_len = ciphertext_len;
|
||||
// PKCS#5/PKCS#7 padding requires at least one byte of plaintext;
|
||||
// reject malformed empty ciphertext before any plaintext[len - 1]
|
||||
// access could underflow / read out-of-bounds.
|
||||
if (plaintext_len == 0) {
|
||||
ret = SG_ERR_INVAL;
|
||||
goto out;
|
||||
}
|
||||
plaintext = malloc(plaintext_len);
|
||||
gcry_cipher_decrypt(hd, plaintext, plaintext_len, ciphertext, ciphertext_len);
|
||||
|
||||
@@ -286,12 +300,6 @@ omemo_decrypt_func(signal_buffer** output, int cipher, const uint8_t* key, size_
|
||||
assert(FALSE);
|
||||
}
|
||||
|
||||
// padding byte must address bytes that exist in plaintext.
|
||||
if (padding == 0 || (size_t)padding > plaintext_len) {
|
||||
ret = SG_ERR_UNKNOWN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (int i = 0; i < padding; i++) {
|
||||
if (plaintext[plaintext_len - 1 - i] != padding) {
|
||||
ret = SG_ERR_UNKNOWN;
|
||||
@@ -381,7 +389,7 @@ out:
|
||||
|
||||
gcry_error_t
|
||||
aes256gcm_crypt_file(FILE* in, FILE* out, off_t file_size,
|
||||
unsigned char key[], unsigned char nonce[], gboolean encrypt)
|
||||
unsigned char key[], unsigned char nonce[], bool encrypt)
|
||||
{
|
||||
|
||||
if (!gcry_control(GCRYCTL_INITIALIZATION_FINISHED_P)) {
|
||||
@@ -414,7 +422,7 @@ aes256gcm_crypt_file(FILE* in, FILE* out, off_t file_size,
|
||||
|
||||
unsigned char buffer[AES256_GCM_BUFFER_SIZE];
|
||||
|
||||
size_t bytes = 0;
|
||||
int bytes = 0;
|
||||
off_t bytes_read = 0, bytes_available = 0, read_size = 0;
|
||||
while (bytes_read < file_size) {
|
||||
bytes_available = file_size - bytes_read;
|
||||
@@ -429,8 +437,8 @@ aes256gcm_crypt_file(FILE* in, FILE* out, off_t file_size,
|
||||
read_size = AES256_GCM_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
bytes = fread(buffer, 1, (size_t)read_size, in);
|
||||
bytes_read += (off_t)bytes;
|
||||
bytes = fread(buffer, 1, read_size, in);
|
||||
bytes_read += bytes;
|
||||
|
||||
if (encrypt) {
|
||||
res = gcry_cipher_encrypt(hd, buffer, bytes, NULL, 0);
|
||||
|
||||
@@ -4,18 +4,37 @@
|
||||
*
|
||||
* Copyright (C) 2019 Paul Fariello <paul@fariello.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
* Profanity is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Profanity is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Profanity. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link the code of portions of this program with the OpenSSL library under
|
||||
* certain conditions as described in each individual source file, and
|
||||
* distribute linked combinations including the two.
|
||||
*
|
||||
* You must obey the GNU General Public License in all respects for all of the
|
||||
* code used other than OpenSSL. If you modify file(s) with this exception, you
|
||||
* may extend this exception to your version of the file(s), but you are not
|
||||
* obligated to do so. If you do not wish to do so, delete this exception
|
||||
* statement from your version. If you delete this exception statement from all
|
||||
* source files in the program, then also delete it here.
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_LIBOMEMO_C
|
||||
#include <omemo/signal_protocol_types.h>
|
||||
#else
|
||||
#include <signal/signal_protocol_types.h>
|
||||
#endif
|
||||
|
||||
#include <gcrypt.h>
|
||||
|
||||
#define AES128_GCM_KEY_LENGTH 16
|
||||
@@ -166,7 +185,7 @@ int aes128gcm_decrypt(unsigned char* plaintext,
|
||||
const unsigned char* const key, const unsigned char* const tag);
|
||||
|
||||
gcry_error_t aes256gcm_crypt_file(FILE* in, FILE* out, off_t file_size,
|
||||
unsigned char key[], unsigned char nonce[], gboolean encrypt);
|
||||
unsigned char key[], unsigned char nonce[], bool encrypt);
|
||||
|
||||
char* aes256gcm_create_secure_fragment(unsigned char* key,
|
||||
unsigned char* nonce);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,33 @@
|
||||
*
|
||||
* Copyright (C) 2019 Paul Fariello <paul@fariello.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
* Profanity is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Profanity is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Profanity. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link the code of portions of this program with the OpenSSL library under
|
||||
* certain conditions as described in each individual source file, and
|
||||
* distribute linked combinations including the two.
|
||||
*
|
||||
* You must obey the GNU General Public License in all respects for all of the
|
||||
* code used other than OpenSSL. If you modify file(s) with this exception, you
|
||||
* may extend this exception to your version of the file(s), but you are not
|
||||
* obligated to do so. If you do not wish to do so, delete this exception
|
||||
* statement from your version. If you delete this exception statement from all
|
||||
* source files in the program, then also delete it here.
|
||||
*
|
||||
*/
|
||||
#include <glib.h>
|
||||
#include <gcrypt.h>
|
||||
@@ -59,9 +85,6 @@ void omemo_trust(const char* const jid, const char* const fingerprint);
|
||||
void omemo_untrust(const char* const jid, const char* const fingerprint);
|
||||
GList* omemo_known_device_identities(const char* const jid);
|
||||
gboolean omemo_is_trusted_identity(const char* const jid, const char* const fingerprint);
|
||||
gboolean omemo_is_jid_trusted(const char* const jid);
|
||||
GList* omemo_get_jid_untrusted_fingerprints(const char* const jid);
|
||||
gboolean omemo_is_device_active(const char* const jid, const char* const fingerprint);
|
||||
char* omemo_fingerprint_autocomplete(const char* const search_str, gboolean previous, void* context);
|
||||
void omemo_fingerprint_autocomplete_reset(void);
|
||||
gboolean omemo_automatic_start(const char* const recipient);
|
||||
@@ -72,9 +95,8 @@ void omemo_start_muc_sessions(const char* const roomjid);
|
||||
void omemo_start_device_session(const char* const jid, uint32_t device_id, GList* prekeys, uint32_t signed_prekey_id, const unsigned char* const signed_prekey, size_t signed_prekey_len, const unsigned char* const signature, size_t signature_len, const unsigned char* const identity_key, size_t identity_key_len);
|
||||
|
||||
gboolean omemo_loaded(void);
|
||||
|
||||
char* omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_receipt, gboolean muc, const char* const replace_id);
|
||||
char* omemo_on_message_recv(const char* const from, uint32_t sid, const unsigned char* const iv, size_t iv_len, GList* keys, const unsigned char* const payload, size_t payload_len, gboolean muc, gboolean* trusted, omemo_error_t* error) __attribute__((nonnull(9, 10)));
|
||||
char* omemo_on_message_recv(const char* const from, uint32_t sid, const unsigned char* const iv, size_t iv_len, GList* keys, const unsigned char* const payload, size_t payload_len, gboolean muc, gboolean* trusted);
|
||||
|
||||
char* omemo_encrypt_file(FILE* in, FILE* out, off_t file_size, int* gcry_res);
|
||||
gcry_error_t omemo_decrypt_file(FILE* in, FILE* out, off_t file_size, const char* fragment);
|
||||
|
||||
@@ -4,17 +4,38 @@
|
||||
*
|
||||
* Copyright (C) 2019 Paul Fariello <paul@fariello.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
* Profanity is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Profanity is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Profanity. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link the code of portions of this program with the OpenSSL library under
|
||||
* certain conditions as described in each individual source file, and
|
||||
* distribute linked combinations including the two.
|
||||
*
|
||||
* You must obey the GNU General Public License in all respects for all of the
|
||||
* code used other than OpenSSL. If you modify file(s) with this exception, you
|
||||
* may extend this exception to your version of the file(s), but you are not
|
||||
* obligated to do so. If you do not wish to do so, delete this exception
|
||||
* statement from your version. If you delete this exception statement from all
|
||||
* source files in the program, then also delete it here.
|
||||
*
|
||||
*/
|
||||
#include <glib.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_LIBOMEMO_C
|
||||
#include <omemo/signal_protocol.h>
|
||||
#else
|
||||
#include <signal/signal_protocol.h>
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "omemo/omemo.h"
|
||||
#include "omemo/store.h"
|
||||
|
||||
@@ -4,15 +4,37 @@
|
||||
*
|
||||
* Copyright (C) 2019 Paul Fariello <paul@fariello.eu>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later WITH OpenSSL-exception
|
||||
* This file is part of Profanity.
|
||||
*
|
||||
* Profanity is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Profanity is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Profanity. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give permission to
|
||||
* link the code of portions of this program with the OpenSSL library under
|
||||
* certain conditions as described in each individual source file, and
|
||||
* distribute linked combinations including the two.
|
||||
*
|
||||
* You must obey the GNU General Public License in all respects for all of the
|
||||
* code used other than OpenSSL. If you modify file(s) with this exception, you
|
||||
* may extend this exception to your version of the file(s), but you are not
|
||||
* obligated to do so. If you do not wish to do so, delete this exception
|
||||
* statement from your version. If you delete this exception statement from all
|
||||
* source files in the program, then also delete it here.
|
||||
*
|
||||
*/
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_LIBOMEMO_C
|
||||
#include <omemo/signal_protocol.h>
|
||||
#else
|
||||
#include <signal/signal_protocol.h>
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define OMEMO_STORE_GROUP_IDENTITY "identity"
|
||||
#define OMEMO_STORE_GROUP_PREKEYS "prekeys"
|
||||
@@ -28,7 +50,7 @@ typedef struct
|
||||
signal_buffer* private;
|
||||
uint32_t registration_id;
|
||||
GHashTable* trusted;
|
||||
gboolean recv;
|
||||
bool recv;
|
||||
} identity_key_store_t;
|
||||
|
||||
GHashTable* session_store_new(void);
|
||||
|
||||
Reference in New Issue
Block a user