merge key_reset_get_revocations
authorKrista 'DarthMama' Bennett <krista@pep.foundation>
Tue, 10 Dec 2019 17:54:02 +0100
branchkey_reset_get_revocations
changeset 42476bb362f1734e
parent 4246 587727826dc4
parent 4244 8d4faa88ddcf
child 4248 66bea48a09d5
child 4249 b51973da210d
merge
     1.1 --- a/asn.1/Makefile	Tue Dec 10 17:53:24 2019 +0100
     1.2 +++ b/asn.1/Makefile	Tue Dec 10 17:54:02 2019 +0100
     1.3 @@ -30,4 +30,4 @@
     1.4  uninstall:
     1.5  
     1.6  tags: $(wildcard *.c) $(wildcard *.h)
     1.7 -	ctags *.c *.h
     1.8 +	ctags --sort=yes *.c *.h
     2.1 --- a/build-mac/generated-files-asn1.txt	Tue Dec 10 17:53:24 2019 +0100
     2.2 +++ b/build-mac/generated-files-asn1.txt	Tue Dec 10 17:54:02 2019 +0100
     2.3 @@ -16,6 +16,8 @@
     2.4  $(SRCROOT)/../asn.1/CommitReject.h
     2.5  $(SRCROOT)/../asn.1/GroupHandshake.c
     2.6  $(SRCROOT)/../asn.1/GroupHandshake.h
     2.7 +$(SRCROOT)/../asn.1/GroupKeyReset.c
     2.8 +$(SRCROOT)/../asn.1/GroupKeyReset.h
     2.9  $(SRCROOT)/../asn.1/GroupKeys.c
    2.10  $(SRCROOT)/../asn.1/GroupKeys.h
    2.11  $(SRCROOT)/../asn.1/GroupKeysAndClose.c
    2.12 @@ -34,6 +36,8 @@
    2.13  $(SRCROOT)/../asn.1/Identity.h
    2.14  $(SRCROOT)/../asn.1/IdentityList.c
    2.15  $(SRCROOT)/../asn.1/IdentityList.h
    2.16 +$(SRCROOT)/../asn.1/InitGroupKeyReset.c
    2.17 +$(SRCROOT)/../asn.1/InitGroupKeyReset.h
    2.18  $(SRCROOT)/../asn.1/KeySync.c
    2.19  $(SRCROOT)/../asn.1/KeySync.h
    2.20  $(SRCROOT)/../asn.1/NativeEnumerated.c
     3.1 --- a/build-mac/pEpEngine.xcodeproj/project.pbxproj	Tue Dec 10 17:53:24 2019 +0100
     3.2 +++ b/build-mac/pEpEngine.xcodeproj/project.pbxproj	Tue Dec 10 17:54:02 2019 +0100
     3.3 @@ -151,6 +151,8 @@
     3.4  		431F04B722733A7E00CCE960 /* key_reset.h in Headers */ = {isa = PBXBuildFile; fileRef = 431F04B222733A7E00CCE960 /* key_reset.h */; };
     3.5  		43370833203C075A004E6547 /* sqlite3.c in Sources */ = {isa = PBXBuildFile; fileRef = 4337082D203C075A004E6547 /* sqlite3.c */; };
     3.6  		43370834203C075A004E6547 /* sqlite3.h in Headers */ = {isa = PBXBuildFile; fileRef = 43370832203C075A004E6547 /* sqlite3.h */; };
     3.7 +		43495980239E40F200CF1E12 /* InitGroupKeyReset.c in Sources */ = {isa = PBXBuildFile; fileRef = 4349597B239E40F200CF1E12 /* InitGroupKeyReset.c */; };
     3.8 +		43495982239E417300CF1E12 /* GroupKeyReset.c in Sources */ = {isa = PBXBuildFile; fileRef = 43495981239E417300CF1E12 /* GroupKeyReset.c */; };
     3.9  		438C43B52167752C00C7425B /* labeled_int_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 438C43AF2167752C00C7425B /* labeled_int_list.h */; };
    3.10  		438C43B62167752C00C7425B /* labeled_int_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 438C43B42167752C00C7425B /* labeled_int_list.c */; };
    3.11  		43E4FBB22362C05600BC01F4 /* NegotiationRequestGrouped.c in Sources */ = {isa = PBXBuildFile; fileRef = 43E4FBAD2362C05600BC01F4 /* NegotiationRequestGrouped.c */; };
    3.12 @@ -383,6 +385,8 @@
    3.13  		431F04B222733A7E00CCE960 /* key_reset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = key_reset.h; path = ../src/key_reset.h; sourceTree = "<group>"; };
    3.14  		4337082D203C075A004E6547 /* sqlite3.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sqlite3.c; path = ../src/sqlite3.c; sourceTree = "<group>"; };
    3.15  		43370832203C075A004E6547 /* sqlite3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sqlite3.h; path = ../src/sqlite3.h; sourceTree = "<group>"; };
    3.16 +		4349597B239E40F200CF1E12 /* InitGroupKeyReset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = InitGroupKeyReset.c; path = ../asn.1/InitGroupKeyReset.c; sourceTree = "<group>"; };
    3.17 +		43495981239E417300CF1E12 /* GroupKeyReset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = GroupKeyReset.c; path = ../asn.1/GroupKeyReset.c; sourceTree = "<group>"; };
    3.18  		438C43962167582400C7425B /* sync_api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sync_api.h; path = ../src/sync_api.h; sourceTree = "<group>"; };
    3.19  		438C43AF2167752C00C7425B /* labeled_int_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = labeled_int_list.h; path = ../src/labeled_int_list.h; sourceTree = "<group>"; };
    3.20  		438C43B42167752C00C7425B /* labeled_int_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = labeled_int_list.c; path = ../src/labeled_int_list.c; sourceTree = "<group>"; };
    3.21 @@ -490,6 +494,8 @@
    3.22  		6406CE811CE382F400C14D77 /* asn.1 */ = {
    3.23  			isa = PBXGroup;
    3.24  			children = (
    3.25 +				43495981239E417300CF1E12 /* GroupKeyReset.c */,
    3.26 +				4349597B239E40F200CF1E12 /* InitGroupKeyReset.c */,
    3.27  				15147EED237E9EA7003989FE /* GroupHandshake.h */,
    3.28  				15147EEE237E9EA7003989FE /* GroupKeysAndClose.c */,
    3.29  				15147EEF237E9EA7003989FE /* GroupKeysAndClose.h */,
    3.30 @@ -993,6 +999,7 @@
    3.31  			buildActionMask = 2147483647;
    3.32  			files = (
    3.33  				64A826871B455D0800EECAF0 /* stringpair.c in Sources */,
    3.34 +				43495980239E40F200CF1E12 /* InitGroupKeyReset.c in Sources */,
    3.35  				15B037C122B2B822002D664C /* Identity.c in Sources */,
    3.36  				15B037B522B2B822002D664C /* OCTET_STRING.c in Sources */,
    3.37  				64A826831B455D0800EECAF0 /* platform_unix.c in Sources */,
    3.38 @@ -1001,6 +1008,7 @@
    3.39  				154918B322B940200091B6D6 /* Sync_impl.c in Sources */,
    3.40  				15147EF2237E9EA7003989FE /* GroupKeysAndClose.c in Sources */,
    3.41  				15B037E322B2B822002D664C /* GroupKeys.c in Sources */,
    3.42 +				43495982239E417300CF1E12 /* GroupKeyReset.c in Sources */,
    3.43  				15B037B122B2B822002D664C /* NegotiationRequest.c in Sources */,
    3.44  				15B037FC22B2B822002D664C /* Hex.c in Sources */,
    3.45  				43E4FBB22362C05600BC01F4 /* NegotiationRequestGrouped.c in Sources */,
     4.1 --- a/src/Makefile	Tue Dec 10 17:53:24 2019 +0100
     4.2 +++ b/src/Makefile	Tue Dec 10 17:54:02 2019 +0100
     4.3 @@ -122,5 +122,5 @@
     4.4  	rm -rf $(PREFIX)/include/pEp
     4.5  
     4.6  tags: $(wildcard *.c) $(wildcard *.h)
     4.7 -	ctags *.c *.h
     4.8 +	ctags --sort=yes *.c *.h
     4.9  
     5.1 --- a/src/sync_api.c	Tue Dec 10 17:53:24 2019 +0100
     5.2 +++ b/src/sync_api.c	Tue Dec 10 17:54:02 2019 +0100
     5.3 @@ -224,7 +224,7 @@
     5.4      return status;
     5.5  }
     5.6  
     5.7 -DYNAMIC_API PEP_STATUS leave_device_group(PEP_SESSION session)
     5.8 +PEP_STATUS disable_sync(PEP_SESSION session)
     5.9  {
    5.10      assert(session);
    5.11      if (!session)
    5.12 @@ -249,6 +249,14 @@
    5.13      return status;
    5.14  }
    5.15  
    5.16 +DYNAMIC_API PEP_STATUS leave_device_group(PEP_SESSION session) {
    5.17 +    assert(session);
    5.18 +    if (!session)
    5.19 +        return PEP_ILLEGAL_VALUE;
    5.20 +        
    5.21 +    return signal_Sync_event(session, Sync_PR_keysync, GroupKeyResetRequiredAndDisable, NULL);
    5.22 +}
    5.23 +
    5.24  DYNAMIC_API PEP_STATUS enable_identity_for_sync(PEP_SESSION session,
    5.25          pEp_identity *ident)
    5.26  {
    5.27 @@ -294,4 +302,3 @@
    5.28      status = set_identity_flags(session, ident, PEP_idf_not_for_sync);
    5.29      return status;
    5.30  }
    5.31 -
     6.1 --- a/src/sync_api.h	Tue Dec 10 17:53:24 2019 +0100
     6.2 +++ b/src/sync_api.h	Tue Dec 10 17:54:02 2019 +0100
     6.3 @@ -201,14 +201,21 @@
     6.4      );
     6.5  
     6.6  
     6.7 -// leave_device_group() - leave a device group and shutdown sync
     6.8 +// disable_sync() - leave a device group and shutdown sync
     6.9 +//
    6.10 +//  parameters:
    6.11 +//      session                 pEp session
    6.12 +
    6.13 +PEP_STATUS disable_sync(PEP_SESSION session);
    6.14 +
    6.15 +// leave_device_group() - Issue a group key reset request and 
    6.16 +// leave the device group, shutting down sync \
    6.17  //
    6.18  //  parameters:
    6.19  //      session                 pEp session
    6.20  
    6.21  DYNAMIC_API PEP_STATUS leave_device_group(PEP_SESSION session);
    6.22  
    6.23 -
    6.24  // enable_identity_for_sync() - enable sync for this identity
    6.25  //  parameters:
    6.26  //      session                 pEp session
    6.27 @@ -226,7 +233,7 @@
    6.28  DYNAMIC_API PEP_STATUS disable_identity_for_sync(PEP_SESSION session,
    6.29          pEp_identity *ident);
    6.30  
    6.31 +
    6.32  #ifdef __cplusplus
    6.33  }
    6.34  #endif
    6.35 -
     7.1 --- a/sync/cond_act_sync.yml2	Tue Dec 10 17:53:24 2019 +0100
     7.2 +++ b/sync/cond_act_sync.yml2	Tue Dec 10 17:54:02 2019 +0100
     7.3 @@ -574,11 +574,5 @@
     7.4  
     7.5  action disable
     7.6  ||
     7.7 -    leave_device_group(session);
     7.8 -    // ignore the result, disable anyway
     7.9 -
    7.10 -    if (!session->inject_sync_event)
    7.11 -        return PEP_SYNC_NO_INJECT_CALLBACK;
    7.12 -
    7.13 -    session->inject_sync_event((void *) SHUTDOWN, NULL);
    7.14 +    disable_sync(session);
    7.15  ||
     8.1 --- a/sync/sync.fsm	Tue Dec 10 17:53:24 2019 +0100
     8.2 +++ b/sync/sync.fsm	Tue Dec 10 17:54:02 2019 +0100
     8.3 @@ -312,6 +312,26 @@
     8.4  
     8.5              on GroupTrustThisKey
     8.6                  do trustThisKey;
     8.7 +
     8.8 +            on GroupKeyResetRequired
     8.9 +                send InitGroupKeyReset;
    8.10 +
    8.11 +            on GroupKeyResetRequiredAndDisable {
    8.12 +                send InitGroupKeyReset;
    8.13 +                go DisableOnInitGroupKeyReset;
    8.14 +            }
    8.15 +
    8.16 +            on InitGroupKeyReset
    8.17 +                send GroupKeyReset;
    8.18 +
    8.19 +            on GroupKeyReset {
    8.20 +
    8.21 +            }
    8.22 +        }
    8.23 +
    8.24 +        state DisableOnInitGroupKeyReset {
    8.25 +            on InitGroupKeyReset
    8.26 +                do disable;
    8.27          }
    8.28  
    8.29          // sole device handshaking with group
    8.30 @@ -580,6 +600,15 @@
    8.31              field TID negotiation;
    8.32              field Hash key;
    8.33          }
    8.34 +
    8.35 +        // key reset for group
    8.36 +        message InitGroupKeyReset 18 {
    8.37 +        }
    8.38 +
    8.39 +        message GroupKeyReset 19, security=key_reset {
    8.40 +            field TID challenge;
    8.41 +            field IdentityList ownIdentities;
    8.42 +        }
    8.43      }
    8.44  }
    8.45