Browse Source

limit size of key attachements and their number per mail for import

doc_update_sequoia
Volker Birk 6 years ago
parent
commit
3a305b4e8d
4 changed files with 13 additions and 5 deletions
  1. +1
    -1
      asn.1/devicegroup.asn1
  2. +1
    -1
      asn.1/pEp.asn1
  3. +5
    -2
      src/message_api.c
  4. +6
    -1
      src/pEp_internal.h

+ 1
- 1
asn.1/devicegroup.asn1 View File

@ -1,5 +1,5 @@
DEVICEGROUP
{ iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp (47878) sync (1) keysync (1) }
{ iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp (47878) sync(1) keysync(1) }
DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=


+ 1
- 1
asn.1/pEp.asn1 View File

@ -1,5 +1,5 @@
PEP
{ iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp (47878) basic (0) }
{ iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) basic(0) }
DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=


+ 5
- 2
src/message_api.c View File

@ -925,9 +925,12 @@ bool import_attached_keys(
bool remove = false;
bloblist_t *bl;
for (bl = msg->attachments; bl && bl->value; bl = bl->next)
int i = 0;
for (bl = msg->attachments; i < MAX_KEYS_TO_IMPORT && bl && bl->value;
bl = bl->next, i++)
{
if (bl && bl->value && bl->size && is_key(bl))
if (bl && bl->value && bl->size && bl->size < MAX_KEY_SIZE
&& is_key(bl))
{
import_key(session, bl->value, bl->size, private_idents);
remove = true;


+ 6
- 1
src/pEp_internal.h View File

@ -1,4 +1,9 @@
#define PEP_ENGINE_VERSION "0.6.0"
#define PEP_ENGINE_VERSION "0.6.1"
// maximum attachment size to import as key 1MB, maximum of 20 attachments
#define MAX_KEY_SIZE (1024 * 1024)
#define MAX_KEYS_TO_IMPORT 20
// this is 20 trustwords with 79 chars max
#define MAX_TRUSTWORDS_SPACE (20 * 80)


Loading…
Cancel
Save