merging
authorVolker Birk <vb@pep-project.org>
Tue, 17 May 2016 20:59:37 +0200
changeset 646926cb97b8256
parent 645 0bb373719dce
parent 644 91574e3ca5fb
child 647 e4cfa409ceef
merging
     1.1 --- a/build-mac/pEpEngine.xcodeproj/project.pbxproj	Tue May 17 20:56:41 2016 +0200
     1.2 +++ b/build-mac/pEpEngine.xcodeproj/project.pbxproj	Tue May 17 20:59:37 2016 +0200
     1.3 @@ -60,8 +60,6 @@
     1.4  		6406CEF41CE3835300C14D77 /* per_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406CEB61CE3835300C14D77 /* per_support.h */; };
     1.5  		6406CEF51CE3835300C14D77 /* PrintableString.c in Sources */ = {isa = PBXBuildFile; fileRef = 6406CEB71CE3835300C14D77 /* PrintableString.c */; };
     1.6  		6406CEF61CE3835300C14D77 /* PrintableString.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406CEB81CE3835300C14D77 /* PrintableString.h */; };
     1.7 -		6406CEF71CE3835300C14D77 /* Stringlist.c in Sources */ = {isa = PBXBuildFile; fileRef = 6406CEB91CE3835300C14D77 /* Stringlist.c */; };
     1.8 -		6406CEF81CE3835300C14D77 /* Stringlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406CEBA1CE3835300C14D77 /* Stringlist.h */; };
     1.9  		6406CEF91CE3835300C14D77 /* UTF8String.c in Sources */ = {isa = PBXBuildFile; fileRef = 6406CEBB1CE3835300C14D77 /* UTF8String.c */; };
    1.10  		6406CEFA1CE3835300C14D77 /* UTF8String.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406CEBC1CE3835300C14D77 /* UTF8String.h */; };
    1.11  		6406CEFB1CE3835300C14D77 /* Version.c in Sources */ = {isa = PBXBuildFile; fileRef = 6406CEBD1CE3835300C14D77 /* Version.c */; };
    1.12 @@ -73,6 +71,11 @@
    1.13  		6406CF011CE3835300C14D77 /* xer_support.c in Sources */ = {isa = PBXBuildFile; fileRef = 6406CEC31CE3835300C14D77 /* xer_support.c */; };
    1.14  		6406CF021CE3835300C14D77 /* xer_support.h in Headers */ = {isa = PBXBuildFile; fileRef = 6406CEC41CE3835300C14D77 /* xer_support.h */; };
    1.15  		644297C51BE11CE0002BC73B /* system.db in Resources */ = {isa = PBXBuildFile; fileRef = 64951A1B1BE0FCD800B10E71 /* system.db */; };
    1.16 +		6467888C1CEB3D120001F54C /* map_asn1.c in Sources */ = {isa = PBXBuildFile; fileRef = 646788871CEB3D120001F54C /* map_asn1.c */; };
    1.17 +		6467888D1CEB3D120001F54C /* map_asn1.h in Headers */ = {isa = PBXBuildFile; fileRef = 646788881CEB3D120001F54C /* map_asn1.h */; };
    1.18 +		6467888E1CEB3D120001F54C /* sync_actions.c in Sources */ = {isa = PBXBuildFile; fileRef = 646788891CEB3D120001F54C /* sync_actions.c */; };
    1.19 +		6467888F1CEB3D120001F54C /* sync_driver.c in Sources */ = {isa = PBXBuildFile; fileRef = 6467888A1CEB3D120001F54C /* sync_driver.c */; };
    1.20 +		646788901CEB3D120001F54C /* sync_fsm.h in Headers */ = {isa = PBXBuildFile; fileRef = 6467888B1CEB3D120001F54C /* sync_fsm.h */; };
    1.21  		649DE08B1B45C19100912F72 /* libcurl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 649DE08A1B45C19100912F72 /* libcurl.a */; };
    1.22  		64A826781B455D0800EECAF0 /* bloblist.c in Sources */ = {isa = PBXBuildFile; fileRef = 64A8264C1B455D0800EECAF0 /* bloblist.c */; };
    1.23  		64A826791B455D0800EECAF0 /* cryptotech.c in Sources */ = {isa = PBXBuildFile; fileRef = 64A8264E1B455D0800EECAF0 /* cryptotech.c */; };
    1.24 @@ -94,7 +97,6 @@
    1.25  		64A8268A1B455D0800EECAF0 /* transport.c in Sources */ = {isa = PBXBuildFile; fileRef = 64A826751B455D0800EECAF0 /* transport.c */; };
    1.26  		64A8268C1B455D9D00EECAF0 /* pEpEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 64A826611B455D0800EECAF0 /* pEpEngine.h */; };
    1.27  		64D2C8411CE2241C002CD757 /* sync_fsm.c in Sources */ = {isa = PBXBuildFile; fileRef = 64D2C8401CE2241C002CD757 /* sync_fsm.c */; };
    1.28 -		64D2C8491CE2245D002CD757 /* sync_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 64D2C8461CE2245D002CD757 /* sync_internal.h */; };
    1.29  		64D2C84A1CE2245D002CD757 /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 64D2C8471CE2245D002CD757 /* sync.c */; };
    1.30  		64D2C84B1CE2245D002CD757 /* sync.h in Headers */ = {isa = PBXBuildFile; fileRef = 64D2C8481CE2245D002CD757 /* sync.h */; };
    1.31  /* End PBXBuildFile section */
    1.32 @@ -209,8 +211,6 @@
    1.33  		6406CEB61CE3835300C14D77 /* per_support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = per_support.h; path = ../asn.1/per_support.h; sourceTree = "<group>"; };
    1.34  		6406CEB71CE3835300C14D77 /* PrintableString.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = PrintableString.c; path = ../asn.1/PrintableString.c; sourceTree = "<group>"; };
    1.35  		6406CEB81CE3835300C14D77 /* PrintableString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrintableString.h; path = ../asn.1/PrintableString.h; sourceTree = "<group>"; };
    1.36 -		6406CEB91CE3835300C14D77 /* Stringlist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Stringlist.c; path = ../asn.1/Stringlist.c; sourceTree = "<group>"; };
    1.37 -		6406CEBA1CE3835300C14D77 /* Stringlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stringlist.h; path = ../asn.1/Stringlist.h; sourceTree = "<group>"; };
    1.38  		6406CEBB1CE3835300C14D77 /* UTF8String.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = UTF8String.c; path = ../asn.1/UTF8String.c; sourceTree = "<group>"; };
    1.39  		6406CEBC1CE3835300C14D77 /* UTF8String.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UTF8String.h; path = ../asn.1/UTF8String.h; sourceTree = "<group>"; };
    1.40  		6406CEBD1CE3835300C14D77 /* Version.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Version.c; path = ../asn.1/Version.c; sourceTree = "<group>"; };
    1.41 @@ -223,6 +223,11 @@
    1.42  		6406CEC41CE3835300C14D77 /* xer_support.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xer_support.h; path = ../asn.1/xer_support.h; sourceTree = "<group>"; };
    1.43  		644297BF1BE11C65002BC73B /* pEpTrustWords.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = pEpTrustWords.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
    1.44  		644297C11BE11C65002BC73B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
    1.45 +		646788871CEB3D120001F54C /* map_asn1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = map_asn1.c; path = ../src/map_asn1.c; sourceTree = "<group>"; };
    1.46 +		646788881CEB3D120001F54C /* map_asn1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = map_asn1.h; path = ../src/map_asn1.h; sourceTree = "<group>"; };
    1.47 +		646788891CEB3D120001F54C /* sync_actions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync_actions.c; path = ../src/sync_actions.c; sourceTree = "<group>"; };
    1.48 +		6467888A1CEB3D120001F54C /* sync_driver.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync_driver.c; path = ../src/sync_driver.c; sourceTree = "<group>"; };
    1.49 +		6467888B1CEB3D120001F54C /* sync_fsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sync_fsm.h; path = ../src/sync_fsm.h; sourceTree = "<group>"; };
    1.50  		64796A3F1B455AA5004B1C24 /* libpEpEngine.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libpEpEngine.a; sourceTree = BUILT_PRODUCTS_DIR; };
    1.51  		64951A1B1BE0FCD800B10E71 /* system.db */ = {isa = PBXFileReference; lastKnownFileType = file; name = system.db; path = ../db/system.db; sourceTree = "<group>"; };
    1.52  		649DE08A1B45C19100912F72 /* libcurl.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libcurl.a; sourceTree = "<group>"; };
    1.53 @@ -269,7 +274,6 @@
    1.54  		64A826761B455D0800EECAF0 /* transport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = transport.h; path = ../src/transport.h; sourceTree = "<group>"; };
    1.55  		64A826771B455D0800EECAF0 /* wrappers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wrappers.h; path = ../src/wrappers.h; sourceTree = "<group>"; };
    1.56  		64D2C8401CE2241C002CD757 /* sync_fsm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync_fsm.c; path = ../src/sync_fsm.c; sourceTree = "<group>"; };
    1.57 -		64D2C8461CE2245D002CD757 /* sync_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sync_internal.h; path = ../src/sync_internal.h; sourceTree = "<group>"; };
    1.58  		64D2C8471CE2245D002CD757 /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = ../src/sync.c; sourceTree = "<group>"; };
    1.59  		64D2C8481CE2245D002CD757 /* sync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sync.h; path = ../src/sync.h; sourceTree = "<group>"; };
    1.60  		64DA240C1B832EA0000BEE80 /* netpgp.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = netpgp.xcodeproj; path = "../../netpgp-et/netpgp-xcode/netpgp.xcodeproj"; sourceTree = "<group>"; };
    1.61 @@ -351,8 +355,6 @@
    1.62  				6406CEB61CE3835300C14D77 /* per_support.h */,
    1.63  				6406CEB71CE3835300C14D77 /* PrintableString.c */,
    1.64  				6406CEB81CE3835300C14D77 /* PrintableString.h */,
    1.65 -				6406CEB91CE3835300C14D77 /* Stringlist.c */,
    1.66 -				6406CEBA1CE3835300C14D77 /* Stringlist.h */,
    1.67  				6406CEBB1CE3835300C14D77 /* UTF8String.c */,
    1.68  				6406CEBC1CE3835300C14D77 /* UTF8String.h */,
    1.69  				6406CEBD1CE3835300C14D77 /* Version.c */,
    1.70 @@ -419,7 +421,11 @@
    1.71  		64A8264B1B455C5600EECAF0 /* srcref */ = {
    1.72  			isa = PBXGroup;
    1.73  			children = (
    1.74 -				64D2C8461CE2245D002CD757 /* sync_internal.h */,
    1.75 +				646788871CEB3D120001F54C /* map_asn1.c */,
    1.76 +				646788881CEB3D120001F54C /* map_asn1.h */,
    1.77 +				646788891CEB3D120001F54C /* sync_actions.c */,
    1.78 +				6467888A1CEB3D120001F54C /* sync_driver.c */,
    1.79 +				6467888B1CEB3D120001F54C /* sync_fsm.h */,
    1.80  				64D2C8471CE2245D002CD757 /* sync.c */,
    1.81  				64D2C8481CE2245D002CD757 /* sync.h */,
    1.82  				64D2C8401CE2241C002CD757 /* sync_fsm.c */,
    1.83 @@ -483,9 +489,9 @@
    1.84  				6406CEE21CE3835300C14D77 /* der_encoder.h in Headers */,
    1.85  				6406CED01CE3835300C14D77 /* ber_decoder.h in Headers */,
    1.86  				6406CF001CE3835300C14D77 /* xer_encoder.h in Headers */,
    1.87 +				6467888D1CEB3D120001F54C /* map_asn1.h in Headers */,
    1.88  				6406CEEC1CE3835300C14D77 /* OCTET_STRING.h in Headers */,
    1.89  				6406CEC51CE3835300C14D77 /* asn_application.h in Headers */,
    1.90 -				64D2C8491CE2245D002CD757 /* sync_internal.h in Headers */,
    1.91  				6406CEFC1CE3835300C14D77 /* Version.h in Headers */,
    1.92  				6406CEDC1CE3835300C14D77 /* constr_SET_OF.h in Headers */,
    1.93  				6406CEC71CE3835300C14D77 /* asn_codecs_prim.h in Headers */,
    1.94 @@ -496,10 +502,10 @@
    1.95  				6406CEE01CE3835300C14D77 /* constraints.h in Headers */,
    1.96  				6406CEDA1CE3835300C14D77 /* constr_SEQUENCE.h in Headers */,
    1.97  				6406CF021CE3835300C14D77 /* xer_support.h in Headers */,
    1.98 -				6406CEF81CE3835300C14D77 /* Stringlist.h in Headers */,
    1.99  				6406CEC91CE3835300C14D77 /* asn_internal.h in Headers */,
   1.100  				6406CECB1CE3835300C14D77 /* asn_SEQUENCE_OF.h in Headers */,
   1.101  				6406CECE1CE3835300C14D77 /* asn_system.h in Headers */,
   1.102 +				646788901CEB3D120001F54C /* sync_fsm.h in Headers */,
   1.103  				6406CEF21CE3835300C14D77 /* per_opentype.h in Headers */,
   1.104  				6406CECD1CE3835300C14D77 /* asn_SET_OF.h in Headers */,
   1.105  				64D2C84B1CE2245D002CD757 /* sync.h in Headers */,
   1.106 @@ -689,10 +695,10 @@
   1.107  			files = (
   1.108  				64A826871B455D0800EECAF0 /* stringpair.c in Sources */,
   1.109  				6406CEE91CE3835300C14D77 /* NativeInteger.c in Sources */,
   1.110 +				6467888F1CEB3D120001F54C /* sync_driver.c in Sources */,
   1.111  				6406CEFD1CE3835300C14D77 /* xer_decoder.c in Sources */,
   1.112  				6406CEFB1CE3835300C14D77 /* Version.c in Sources */,
   1.113  				64D2C8411CE2241C002CD757 /* sync_fsm.c in Sources */,
   1.114 -				6406CEF71CE3835300C14D77 /* Stringlist.c in Sources */,
   1.115  				6406CEE31CE3835300C14D77 /* Identity.c in Sources */,
   1.116  				64A826831B455D0800EECAF0 /* platform_unix.c in Sources */,
   1.117  				6406CEE51CE3835300C14D77 /* INTEGER.c in Sources */,
   1.118 @@ -729,7 +735,9 @@
   1.119  				64A826881B455D0800EECAF0 /* timestamp.c in Sources */,
   1.120  				6406CEFF1CE3835300C14D77 /* xer_encoder.c in Sources */,
   1.121  				430D258B1C9ED75A00B94535 /* blacklist.c in Sources */,
   1.122 +				6467888C1CEB3D120001F54C /* map_asn1.c in Sources */,
   1.123  				6406CEF11CE3835300C14D77 /* per_opentype.c in Sources */,
   1.124 +				6467888E1CEB3D120001F54C /* sync_actions.c in Sources */,
   1.125  				6406CEED1CE3835300C14D77 /* per_decoder.c in Sources */,
   1.126  				64A826801B455D0800EECAF0 /* mime.c in Sources */,
   1.127  				6406CEC61CE3835300C14D77 /* asn_codecs_prim.c in Sources */,
     2.1 --- a/src/pEpEngine.c	Tue May 17 20:56:41 2016 +0200
     2.2 +++ b/src/pEpEngine.c	Tue May 17 20:59:37 2016 +0200
     2.3 @@ -217,8 +217,12 @@
     2.4          sql_trustword = "select id, word from wordlist where lang = lower(?1) "
     2.5                         "and id = ?2 ;";
     2.6  
     2.7 -        sql_set_person = "insert or replace into person (id, username, lang) "
     2.8 -                         "values (?1, ?2, ?3) ;";
     2.9 +        // Set person, but if already exist, only update.
    2.10 +        // if main_key_id already set, don't touch.
    2.11 +        sql_set_person = "insert or replace into person (id, username, lang, main_key_id)"
    2.12 +                         "  values (?1, ?2, ?3,"
    2.13 +                         "    (select coalesce((select main_key_id from person "
    2.14 +                         "      where id = ?1), upper(replace(?4,' ',''))))) ;";
    2.15  
    2.16          sql_set_pgp_keypair = "insert or replace into pgp_keypair (fpr) "
    2.17                                "values (upper(replace(?1,' ',''))) ;";
    2.18 @@ -822,6 +826,8 @@
    2.19                  SQLITE_STATIC);
    2.20      else
    2.21          sqlite3_bind_null(session->set_person, 3);
    2.22 +    sqlite3_bind_text(session->set_person, 4, identity->fpr, -1,
    2.23 +                      SQLITE_STATIC);
    2.24      result = sqlite3_step(session->set_person);
    2.25      sqlite3_reset(session->set_person);
    2.26      if (result != SQLITE_DONE) {