mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
updated values for min/normal partial packet size to 1MB, so that we do not create partial packets for everyday use. We will have to properly extend openpgp-sdk to support parsing of partial packets if we want to PGP-encrypt chunks larger than 1MB.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6553 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ab68f1d123
commit
c34ede4b1c
5 changed files with 26 additions and 9 deletions
|
@ -26,6 +26,16 @@
|
|||
#include "types.h"
|
||||
#include "writer.h"
|
||||
|
||||
// (Cyril) Originally 2048. But for the moment openpgp-sdk cannot read partial packets, so in order
|
||||
// to allow to PGP-encrypt messages of reasonnable size, I had to turn it into larger value.
|
||||
//
|
||||
#define PARTIAL_PACKET_SIZE 1048576
|
||||
|
||||
// (Cyril) Originally 512. But for the moment openpgp-sdk cannot read partial packets, so in order
|
||||
// to allow to PGP-encrypt messages of reasonnable size, I had to turn it into larger value.
|
||||
//
|
||||
#define MIN_PARTIAL_DATA_LENGTH 1048576
|
||||
|
||||
/**
|
||||
* Function that writes out a packet header. See
|
||||
* ops_writer_push_partial
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include <openpgpsdk/literal.h>
|
||||
#include <openpgpsdk/partial.h>
|
||||
|
||||
#define MIN_PARTIAL_DATA_LENGTH 512
|
||||
//#define MIN_PARTIAL_DATA_LENGTH 512 // now defined in partial.h
|
||||
#define MAX_PARTIAL_DATA_LENGTH 1073741824
|
||||
|
||||
|
||||
|
|
|
@ -40,8 +40,6 @@
|
|||
|
||||
static const int debug = 0;
|
||||
|
||||
#define PACKET_SIZE 2048
|
||||
#define MIN_PARTIAL_DATA_LENGTH 512
|
||||
#define MAX_PARTIAL_DATA_LENGTH 1073741824
|
||||
|
||||
typedef struct
|
||||
|
@ -349,7 +347,7 @@ void ops_writer_push_partial_with_trailer(
|
|||
void *trailer_data)
|
||||
{
|
||||
if (packet_size == 0)
|
||||
packet_size = PACKET_SIZE;
|
||||
packet_size = MIN_PARTIAL_DATA_LENGTH;
|
||||
assert(packet_size >= MIN_PARTIAL_DATA_LENGTH);
|
||||
// Verify that the packet size is a valid power of 2.
|
||||
assert(ops_calc_partial_data_length(packet_size) == packet_size);
|
||||
|
|
|
@ -118,7 +118,7 @@ void ops_writer_push_stream_encrypt_se_ip(ops_create_info_t *cinfo,
|
|||
// This is a streaming writer, so we don't know the length in
|
||||
// advance. Use a partial writer to handle the partial body
|
||||
// packet lengths.
|
||||
ops_writer_push_partial(2048, cinfo, OPS_PTAG_CT_SE_IP_DATA,
|
||||
ops_writer_push_partial(PARTIAL_PACKET_SIZE, cinfo, OPS_PTAG_CT_SE_IP_DATA,
|
||||
write_encrypt_se_ip_header, arg);
|
||||
|
||||
// And push encryption writer on stack
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue