Merge branch 'master' into doxygen_doc

doxygen_doc
Sofia 2 years ago
commit 5ee6805f8b

17
.gitignore vendored

@ -41,7 +41,7 @@ Makefile.protocols
test/msg_encrypt_for_self.asc
tags
asn.1/pEpEngineASN1/pEpEngineASN1.vcxproj.user
sync/generated
codegen/generated
*.xml
*.dot
*.svg
@ -79,14 +79,9 @@ asn.1/keyreset.asn1
asn.1/sync.asn1
asn.1/distribution.asn1
asn.1/exploration.asn1
asn.1/managedgroup.asn1
asn.1/storage.asn1
asn.1/messagestorage.asn1
sync/.codecs
sync/.messages
sync/.actions
sync/.codegen
sync/.statemachines
sync/.copy
test/msg_2.0.asc
test/*.txt
lldb-history
@ -134,9 +129,7 @@ test/test_mails/ENGINE-654_bob_mail.eml
# ignore generated data
codegen/.actions
codegen/.codecs
codegen/.copy
codegen/.messages
codegen/.statemachines
codegen/generated/
codegen/*.gen
.copy

@ -19,8 +19,8 @@ libasn1.a: $(ALL_OBJECTS)
%.o: %.c %.h
$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTIMIZE) $(ASN1C_INC) -c $< -o $@
Sync.c: sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 pEp.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 $<
Sync.c: sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 pEp.asn1 distribution.asn1
$(ASN1C) -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 $<
rm -f converter-sample.c
touch Sync.c

@ -1,40 +0,0 @@
-- This file is under BSD License 2.0
-- ManagedGroup protocol for p≡p
-- Copyleft 2016-2020 by p≡p foundation
-- Written by Volker Birk
MANAGEDGROUP
{ iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) pEp(47878) distribution(2) managedgroup(2) }
DEFINITIONS AUTOMATIC TAGS EXTENSIBILITY IMPLIED ::=
BEGIN
EXPORTS ManagedGroup;
IMPORTS Version, Identity, IdentityList, TID, Hash, Rating FROM PEP;
GroupCreate ::= SEQUENCE {
groupIdentity Identity,
manager Identity
}
GroupAdopted ::= SEQUENCE {
groupIdentity Identity,
member Identity
}
GroupDissolve ::= SEQUENCE {
groupIdentity Identity,
manager Identity
}
ManagedGroup ::= CHOICE {
groupCreate [APPLICATION 2] GroupCreate,
groupAdopted [APPLICATION 3] GroupAdopted,
groupDissolve [APPLICATION 4] GroupDissolve
}
END

@ -10,37 +10,38 @@ all: .copy
generated:
mkdir -p $@
.actions: sync.fsm gen_actions.ysl2 fsm.yml2 functions.ysl2 $(wildcard cond_act_*.yml2) | generated
$(YML2_PROC) -y gen_actions.ysl2 $< -o $@
statemachines := $(patsubst %.fsm,%.fsm.gen,$(wildcard *.fsm))
.statemachines: sync.fsm gen_statemachine.ysl2 fsm.yml2 functions.ysl2 | generated
$(YML2_PROC) -y gen_statemachine.ysl2 $< -o $@
actions := $(patsubst %.act,%.act.gen,$(wildcard *.act))
.codecs: sync.fsm distribution.fsm storage.fsm gen_codec.ysl2 fsm.yml2 functions.ysl2 | generated
$(YML2_PROC) -y gen_codec.ysl2 $< -o $@
$(YML2_PROC) -y gen_codec.ysl2 distribution.fsm -o $@
$(YML2_PROC) -y gen_codec.ysl2 storage.fsm -o $@
dot := $(patsubst %.fsm,%.dot,$(wildcard *.fsm))
.messages: sync.fsm distribution.fsm storage.fsm gen_messages.ysl2 gen_message_func.ysl2 fsm.yml2 functions.ysl2 | generated
$(YML2_PROC) -y gen_messages.ysl2 $< -o $@
%.fsm.gen: %.fsm gen_statemachine.ysl2 fsm.yml2 functions.ysl2 | generated
$(YML2_PROC) -y gen_statemachine.ysl2 $< > /dev/null
$(YML2_PROC) -y gen_codec.ysl2 $< > /dev/null
$(YML2_PROC) -y gen_messages.ysl2 $< > /dev/null
$(YML2_PROC) -y gen_message_func.ysl2 $< -o $@
$(YML2_PROC) -y gen_messages.ysl2 distribution.fsm -o $@
$(YML2_PROC) -y gen_messages.ysl2 storage.fsm -o $@
%.act.gen: %.act %.fsm gen_actions.ysl2 fsm.yml2 functions.ysl2 | generated
echo 'define actfile = "./$<";' | $(YML2_PROC) - gen_actions.ysl2 | \
$(YML2_PROC) -X - $(subst .act,.fsm,$<) -o $@
clean:
rm -rf generated
rm -f *.xml *.xsl .statemachines .actions .codecs .messages .copy *.dot *.svg
rm -rf generated *.gen
rm -f *.xml *.xsl .copy *.dot *.svg
.copy: .actions .statemachines .codecs .messages
.copy: $(actions) $(statemachines) $(dot)
cp -f generated/*.c generated/*.h ../src
cp -f generated/*.asn1 ../asn.1
touch .copy
%.xml: %.fsm
yml2c $< -o $@
$(YML2_PROC) $< -o $@
svg: $(patsubst %.dot,%.svg,$(wildcard *.dot))
%.dot: sync.fsm gen_dot.ysl2
$(YML2_PROC) -y gen_dot.ysl2 $<
%.dot: %.fsm gen_dot.ysl2
$(YML2_PROC) -y gen_dot.ysl2 $< -o $@
%.svg: %.dot
dot -Tsvg -o $@ $<

@ -66,3 +66,7 @@ decl auto < field >;
decl list < field >;
// emped message from other state machine
decl embed @protocol @type @name;

@ -23,7 +23,7 @@ tstylesheet {
include standardlib.ysl2
include ./functions.ysl2
include ./cond_act_*.yml2
include from *actfile
template "/protocol" {
document "generated/{@name}_actions.c", "text" {

@ -4,7 +4,7 @@
include yslt.yml2
tstylesheet {
template "protocol/fsm" document "{@name}.dot", "text"
template "protocol/fsm[count(state)>0]" document "{@name}.dot", "text"
||
digraph finite_state_machine {
rankdir=LR;

@ -20,7 +20,7 @@ template "/" {
}
template "protocol", mode=header
document "generated/{@name}_func.h", "text"
if "fsm[count(state)]" document "generated/{@name}_func.h", "text"
||
/**
* @file «@name»_func.h
@ -195,7 +195,7 @@ struct _«@name»_state_s {
||
template "protocol", mode=impl
document "generated/{@name}_func.c", "text" {
if "fsm[count(state)]" document "generated/{@name}_func.c", "text" {
||
/**
* @file «@name»_func.c

@ -15,7 +15,7 @@ tstylesheet {
include ./functions.ysl2
function "pEp_imports"
| IMPORTS Version, Identity, IdentityList, TID, Hash, Rating FROM PEP;
| IMPORTS Version, Identity, IdentityList, TID, Hash, Rating FROM PEP
function "header"
||
@ -74,6 +74,8 @@ tstylesheet {
EXPORTS «@name»;
`` call "pEp_imports"
`` apply "message/embed", mode=import
;
`` apply "message//list|message", 0, mode=impl;
«@name» ::= CHOICE {
@ -88,7 +90,7 @@ tstylesheet {
template "message", mode=impl
||
«@name» ::= SEQUENCE {
`` apply "field|auto|list", mode=direct
`` apply "field|auto|list|embed", mode=direct
}
||
@ -101,10 +103,13 @@ tstylesheet {
||
template "field|auto", mode=direct
template "field|auto|embed", mode=direct
| «func:asn1name()» «func:asn1type()»`if "position()!=last()" > ,`
template "list", mode=direct
| «func:asn1name()» SEQUENCE OF «func:asn1type()»`if "position()!=last()" > ,`
template "embed", mode=import
| «@type» FROM «yml:ucase(@protocol)»
}

@ -14,7 +14,7 @@ tstylesheet {
include ./functions.ysl2
template "/protocol" {
document "generated/{@name}_event.h", "text"
if "count(fsm/state)>0" document "generated/{@name}_event.h", "text"
||
/**
* @file «@name»_event.h
@ -93,7 +93,7 @@ tstylesheet {
||
document "generated/{@name}_event.c", "text"
if "count(fsm/state)>0" document "generated/{@name}_event.c", "text"
||
/**
@ -148,7 +148,7 @@ tstylesheet {
||
document "generated/{@name}_impl.h", "text" {
if "count(fsm/state)>0" document "generated/{@name}_impl.h", "text" {
||
/**
* @file «@name»_impl.h
@ -167,7 +167,7 @@ tstylesheet {
#include "../asn.1/«@name».h"
#define «yml:ucase(@name)»_THRESHOLD «@threshold»
`` for "fsm" | #define «yml:ucase(@name)»_THRESHOLD «@threshold»
`` for "fsm[count(state)>0]" | #define «yml:ucase(@name)»_THRESHOLD «@threshold»
#ifdef __cplusplus
extern "C" {
@ -338,7 +338,7 @@ tstylesheet {
||
}
document "generated/{@name}_impl.c", "text" {
if "count(fsm/state)>0" document "generated/{@name}_impl.c", "text" {
||
/**
* @file «@name»_impl.c
@ -354,9 +354,9 @@ tstylesheet {
#include "«yml:lcase(@name)»_codec.h"
#include "baseprotocol.h"
#include "security_checks.h"
`` for "fsm" | #include "«@name»_fsm.h"
`` for "fsm[count(state)>0]" | #include "«@name»_fsm.h"
`` apply "fsm", 0, mode=timeout
`` apply "fsm[count(state)>0]", 0, mode=timeout
PEP_STATUS «@name»_driver(
PEP_SESSION session,
«@name»_PR fsm,
@ -371,12 +371,12 @@ tstylesheet {
case None:
if (!event) {
// timeout occured
`` for "fsm" |>>>> «../@name»_driver(session, «../@name»_PR_«yml:lcase(@name)», None);
`` for "fsm[count(state)>0]" |>>>> «../@name»_driver(session, «../@name»_PR_«yml:lcase(@name)», None);
return PEP_STATUS_OK;
}
return PEP_ILLEGAL_VALUE;
`` apply "fsm", mode=reset_state_machine;
`` apply "fsm[count(state)>0]", mode=reset_state_machine;
default:
return PEP_ILLEGAL_VALUE;
}
@ -384,7 +384,7 @@ tstylesheet {
int next_state = None;
do {
switch (fsm) {
`` apply "fsm", 3, mode=driver
`` apply "fsm[count(state)>0]", 3, mode=driver
default:
return PEP_ILLEGAL_VALUE;
}
@ -480,7 +480,7 @@ tstylesheet {
bool is_own_key = false;
switch (fsm) {
`` apply "fsm", 2, mode=signal_message
`` apply "fsm[count(state)>0]", 2, mode=signal_message
default:
status = PEP_«yml:ucase(@name)»_ILLEGAL_MESSAGE;
goto the_end;
@ -540,7 +540,7 @@ tstylesheet {
time_t now = time(NULL);
switch (fsm) {
||
apply "fsm", 2, mode=send;
apply "fsm[count(state)>0]", 2, mode=send;
||
}
@ -586,7 +586,7 @@ tstylesheet {
switch (fsm) {
||
apply "fsm", 2, mode=send2;
apply "fsm[count(state)>0]", 2, mode=send2;
||
default:
break;
@ -628,8 +628,7 @@ tstylesheet {
m = _m;
break;
`` for "fsm/message[@security='untrusted' and ../@name!='KeySync']" | #error untrusted only allowed with KeySync
`` for "fsm/message[@security='untrusted' and ../@name='KeySync']" |>>> case «../@name»_PR_«yml:mixedCase(@name)»:
`` for "fsm/message[@security='untrusted']" |>>> case «../@name»_PR_«yml:mixedCase(@name)»:
// add fpr of key of comm partner
if (!session->«yml:lcase(@name)»_state.transport.sender_fpr) {
@ -1434,7 +1433,7 @@ tstylesheet {
||
template "fsm", mode=gen {
document "generated/{@name}_fsm.h", "text" {
if "count(state)>0" document "generated/{@name}_fsm.h", "text" {
||
/**
* @file «@name»_fsm.h
@ -1548,7 +1547,7 @@ tstylesheet {
||
}
document "generated/{@name}_fsm.c", "text" {
if "count(state)>0" document "generated/{@name}_fsm.c", "text" {
||
/**
* @file «@name»_fsm.c

@ -728,32 +728,26 @@ protocol Sync 1 {
}
state WaitForGroupUpdate {
on GroupSyncUpdate {
}
}
// reflect incoming ManagedGroup messages
on RequestUpdate {
message GroupSyncCreate 2 {
field Identity groupIdentity;
field Identity manager;
}
}
message GroupSyncAdopted 3 {
field Identity groupIdentity;
field Identity member;
}
// reflect incoming ManagedGroup messages
message GroupSyncDissolve 4 {
field Identity groupIdentity;
field Identity manager;
message GroupSyncUpdate 2 {
embed Distribution ManagedGroup msg;
}
// in case a ManagedGroup message arrives for an unknown group ask the
// other devices
message GroupSyncRequest 5 {
message GroupSyncRequest 3 {
field Identity groupIdentity;
field Identity manager;
}
}
}

@ -103,7 +103,7 @@ clean:
install_headers: $(TARGET)
mkdir -p $(PREFIX)/include/pEp
cp pEpEngine.h keymanagement.h message_api.h dynamic_api.h stringlist.h \
timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h \
timestamp.h identity_list.h bloblist.h stringpair.h message.h mime.h group.h \
cryptotech.h sync_api.h blacklist.h pEp_string.h openpgp_compat.h engine_sql.h \
labeled_int_list.h key_reset.h base64.h sync_codec.h distribution_codec.h storage_codec.h \
status_to_string.h aux_mime_msg.h keyreset_command.h platform.h platform_unix.h ../asn.1/*.h \

@ -538,7 +538,7 @@ member_list* identity_list_to_memberlist(identity_list* ident_list) {
tmp_ident = identity_dup(curr_ident->ident);
if (!tmp_ident)
goto enomem;
pEp_member* member = new_member(curr_ident->ident);
pEp_member* member = new_member(tmp_ident);
if (!member)
goto enomem;
tmp_ident = NULL;

@ -25,11 +25,11 @@ extern "C" {
// RELEASE version this targets
// (string: major.minor.patch)
#define PEP_ENGINE_VERSION "2.2.0"
#define PEP_ENGINE_VERSION_MAJOR 2
#define PEP_ENGINE_VERSION_MINOR 2
#define PEP_ENGINE_VERSION "3.1.0"
#define PEP_ENGINE_VERSION_MAJOR 3
#define PEP_ENGINE_VERSION_MINOR 1
#define PEP_ENGINE_VERSION_PATCH 0
#define PEP_ENGINE_VERSION_RC 4
#define PEP_ENGINE_VERSION_RC 1
#define PEP_OWN_USERID "pEp_own_userId"

@ -211,8 +211,6 @@ DYNAMIC_API stringpair_list_t *stringpair_list_delete_by_key(
const char *key
)
{
assert(sp_list);
assert(key);
if (!key || !sp_list)
return NULL;

Loading…
Cancel
Save