more cleanup

This commit is contained in:
Levi Neely 2024-06-30 13:12:56 +02:00
parent 0c88dda5ad
commit cd4bb2ce9e
5 changed files with 22 additions and 14 deletions

View File

@ -38,13 +38,19 @@
#define PSYNC_AES256_BLOCK_SIZE 16
#define PSYNC_AES256_KEY_SIZE 32
#if defined(P_SSL_OPENSSL)
#include "pssl-openssl.h"
#elif defined(P_SSL_MBEDTLS)
// XXX: let's just pick one, shall we...?
//
// XXX: right now, pcloudcc seems designed to used mbedtls by
// default. what are the pros/cons of migrating to openssl or
// libressl?
//
// #if defined(P_SSL_OPENSSL)
// #include "pssl-openssl.h"
// #elif defined(P_SSL_MBEDTLS)
#include "pssl-mbedtls.h"
#else
#error "Please specify SSL library to use"
#endif
// #else
// #error "Please specify SSL library to use"
// #endif
extern PSYNC_THREAD int psync_ssl_errno;
@ -106,7 +112,6 @@ psync_ssl_rsa_binary_to_public(psync_binary_rsa_key_t bin);
psync_rsa_privatekey_t
psync_ssl_rsa_binary_to_private(psync_binary_rsa_key_t bin);
void psync_ssl_rsa_free_binary(psync_binary_rsa_key_t bin);
psync_symmetric_key_t
psync_ssl_gen_symmetric_key_from_pass(const char *password, size_t keylen,
const unsigned char *salt, size_t saltlen,
@ -118,7 +123,6 @@ psync_ssl_alloc_encrypted_symmetric_key(size_t len);
psync_encrypted_symmetric_key_t
psync_ssl_copy_encrypted_symmetric_key(psync_encrypted_symmetric_key_t src);
void psync_ssl_free_symmetric_key(psync_symmetric_key_t key);
psync_encrypted_symmetric_key_t
psync_ssl_rsa_encrypt_data(psync_rsa_publickey_t rsa, const unsigned char *data,
size_t datalen);
@ -130,14 +134,13 @@ psync_ssl_rsa_encrypt_symmetric_key(psync_rsa_publickey_t rsa,
const psync_symmetric_key_t key);
psync_symmetric_key_t psync_ssl_rsa_decrypt_symmetric_key(
psync_rsa_privatekey_t rsa, const psync_encrypted_symmetric_key_t enckey);
psync_aes256_encoder psync_ssl_aes256_create_encoder(psync_symmetric_key_t key);
void psync_ssl_aes256_free_encoder(psync_aes256_encoder aes);
psync_aes256_encoder psync_ssl_aes256_create_decoder(psync_symmetric_key_t key);
void psync_ssl_aes256_free_decoder(psync_aes256_encoder aes);
psync_rsa_signature_t psync_ssl_rsa_sign_sha256_hash(psync_rsa_privatekey_t rsa,
const unsigned char *data);
psync_symmetric_key_t psync_ssl_rsa_decrypt_symm_key_lock(
psync_rsa_privatekey_t *rsa, const psync_encrypted_symmetric_key_t *enckey);
#endif

View File

@ -31,13 +31,17 @@
Library containing tool functions, not used in the main
functionality. Keeping statistics, getting data for them etc.
*/
#include "ptools.h"
#include <stdio.h>
#include "papi.h"
#include "plibs.h"
#include "pnetlibs.h"
#include "psettings.h"
#include "ptools.h"
#include "stdlib.h"
#include "string.h"
#include <stdio.h>
#if defined(P_OS_LINUX)
#include <net/if.h>

View File

@ -30,7 +30,7 @@
*/
#include "ptree.h"
#include "plibs.h"
#include <assert.h>
#include <string.h>
static inline long int psync_tree_max(long int a, long int b) {

View File

@ -32,7 +32,6 @@
#ifndef _PSYNC_TREE_H
#define _PSYNC_TREE_H
#include "pcompiler.h"
#include <stddef.h>
#include <stdlib.h>

View File

@ -32,6 +32,8 @@
#include "pupload.h"
#include "papi.h"
#include "pcallbacks.h"
#include "pcompat.h"
#include "pcompiler.h"
#include "pdiff.h"
#include "pfileops.h"
#include "pfolder.h"