more cleanup
This commit is contained in:
parent
0c88dda5ad
commit
cd4bb2ce9e
|
|
@ -38,13 +38,19 @@
|
||||||
#define PSYNC_AES256_BLOCK_SIZE 16
|
#define PSYNC_AES256_BLOCK_SIZE 16
|
||||||
#define PSYNC_AES256_KEY_SIZE 32
|
#define PSYNC_AES256_KEY_SIZE 32
|
||||||
|
|
||||||
#if defined(P_SSL_OPENSSL)
|
// XXX: let's just pick one, shall we...?
|
||||||
#include "pssl-openssl.h"
|
//
|
||||||
#elif defined(P_SSL_MBEDTLS)
|
// 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"
|
#include "pssl-mbedtls.h"
|
||||||
#else
|
// #else
|
||||||
#error "Please specify SSL library to use"
|
// #error "Please specify SSL library to use"
|
||||||
#endif
|
// #endif
|
||||||
|
|
||||||
extern PSYNC_THREAD int psync_ssl_errno;
|
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_rsa_privatekey_t
|
||||||
psync_ssl_rsa_binary_to_private(psync_binary_rsa_key_t bin);
|
psync_ssl_rsa_binary_to_private(psync_binary_rsa_key_t bin);
|
||||||
void psync_ssl_rsa_free_binary(psync_binary_rsa_key_t bin);
|
void psync_ssl_rsa_free_binary(psync_binary_rsa_key_t bin);
|
||||||
|
|
||||||
psync_symmetric_key_t
|
psync_symmetric_key_t
|
||||||
psync_ssl_gen_symmetric_key_from_pass(const char *password, size_t keylen,
|
psync_ssl_gen_symmetric_key_from_pass(const char *password, size_t keylen,
|
||||||
const unsigned char *salt, size_t saltlen,
|
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_encrypted_symmetric_key_t
|
||||||
psync_ssl_copy_encrypted_symmetric_key(psync_encrypted_symmetric_key_t src);
|
psync_ssl_copy_encrypted_symmetric_key(psync_encrypted_symmetric_key_t src);
|
||||||
void psync_ssl_free_symmetric_key(psync_symmetric_key_t key);
|
void psync_ssl_free_symmetric_key(psync_symmetric_key_t key);
|
||||||
|
|
||||||
psync_encrypted_symmetric_key_t
|
psync_encrypted_symmetric_key_t
|
||||||
psync_ssl_rsa_encrypt_data(psync_rsa_publickey_t rsa, const unsigned char *data,
|
psync_ssl_rsa_encrypt_data(psync_rsa_publickey_t rsa, const unsigned char *data,
|
||||||
size_t datalen);
|
size_t datalen);
|
||||||
|
|
@ -130,14 +134,13 @@ psync_ssl_rsa_encrypt_symmetric_key(psync_rsa_publickey_t rsa,
|
||||||
const psync_symmetric_key_t key);
|
const psync_symmetric_key_t key);
|
||||||
psync_symmetric_key_t psync_ssl_rsa_decrypt_symmetric_key(
|
psync_symmetric_key_t psync_ssl_rsa_decrypt_symmetric_key(
|
||||||
psync_rsa_privatekey_t rsa, const psync_encrypted_symmetric_key_t enckey);
|
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);
|
psync_aes256_encoder psync_ssl_aes256_create_encoder(psync_symmetric_key_t key);
|
||||||
void psync_ssl_aes256_free_encoder(psync_aes256_encoder aes);
|
void psync_ssl_aes256_free_encoder(psync_aes256_encoder aes);
|
||||||
psync_aes256_encoder psync_ssl_aes256_create_decoder(psync_symmetric_key_t key);
|
psync_aes256_encoder psync_ssl_aes256_create_decoder(psync_symmetric_key_t key);
|
||||||
void psync_ssl_aes256_free_decoder(psync_aes256_encoder aes);
|
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,
|
psync_rsa_signature_t psync_ssl_rsa_sign_sha256_hash(psync_rsa_privatekey_t rsa,
|
||||||
const unsigned char *data);
|
const unsigned char *data);
|
||||||
|
|
||||||
psync_symmetric_key_t psync_ssl_rsa_decrypt_symm_key_lock(
|
psync_symmetric_key_t psync_ssl_rsa_decrypt_symm_key_lock(
|
||||||
psync_rsa_privatekey_t *rsa, const psync_encrypted_symmetric_key_t *enckey);
|
psync_rsa_privatekey_t *rsa, const psync_encrypted_symmetric_key_t *enckey);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -31,13 +31,17 @@
|
||||||
Library containing tool functions, not used in the main
|
Library containing tool functions, not used in the main
|
||||||
functionality. Keeping statistics, getting data for them etc.
|
functionality. Keeping statistics, getting data for them etc.
|
||||||
*/
|
*/
|
||||||
#include "ptools.h"
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "papi.h"
|
||||||
|
|
||||||
#include "plibs.h"
|
#include "plibs.h"
|
||||||
#include "pnetlibs.h"
|
#include "pnetlibs.h"
|
||||||
#include "psettings.h"
|
#include "psettings.h"
|
||||||
|
#include "ptools.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#if defined(P_OS_LINUX)
|
#if defined(P_OS_LINUX)
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ptree.h"
|
#include "ptree.h"
|
||||||
#include "plibs.h"
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static inline long int psync_tree_max(long int a, long int b) {
|
static inline long int psync_tree_max(long int a, long int b) {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@
|
||||||
#ifndef _PSYNC_TREE_H
|
#ifndef _PSYNC_TREE_H
|
||||||
#define _PSYNC_TREE_H
|
#define _PSYNC_TREE_H
|
||||||
|
|
||||||
#include "pcompiler.h"
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@
|
||||||
#include "pupload.h"
|
#include "pupload.h"
|
||||||
#include "papi.h"
|
#include "papi.h"
|
||||||
#include "pcallbacks.h"
|
#include "pcallbacks.h"
|
||||||
|
#include "pcompat.h"
|
||||||
|
#include "pcompiler.h"
|
||||||
#include "pdiff.h"
|
#include "pdiff.h"
|
||||||
#include "pfileops.h"
|
#include "pfileops.h"
|
||||||
#include "pfolder.h"
|
#include "pfolder.h"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue