add new session flags for properties encryption

Sun, 16 Jun 2019 13:14:24 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 16 Jun 2019 13:14:24 +0200
changeset 606
aa49966e4e85
parent 605
bbc66c72661a
child 607
5dc7fe41e8f8

add new session flags for properties encryption

dav/config.c file | annotate | diff | comparison | revisions
dav/config.h file | annotate | diff | comparison | revisions
libidav/webdav.h file | annotate | diff | comparison | revisions
--- a/dav/config.c	Sat Jun 15 11:01:37 2019 +0200
+++ b/dav/config.c	Sun Jun 16 13:14:24 2019 +0200
@@ -193,8 +193,10 @@
     Repository *repo = calloc(1, sizeof(Repository));
     repo->encrypt_name = false;
     repo->encrypt_content = false;
+    repo->encrypt_properties = false;
     repo->decrypt_name = false;
     repo->decrypt_content = true;
+    repo->decrypt_properties = false;
     repo->verification = true;
     repo->ssl_version = CURL_SSLVERSION_DEFAULT;
     repo->authmethods = CURLAUTH_BASIC;
@@ -231,8 +233,10 @@
         if(util_getboolean(value)) {
             repo->encrypt_name = true;
             repo->encrypt_content = true;
+            repo->encrypt_properties = true;
             repo->decrypt_name = true;
             repo->decrypt_content = true;
+            repo->decrypt_properties = true;
         }
     } else if(xstreq(key, "content-encryption")) {
         if(util_getboolean(value)) {
@@ -576,12 +580,18 @@
     if(repo->decrypt_name) {
         flags |= DAV_SESSION_DECRYPT_NAME;
     }
+    if(repo->decrypt_properties) {
+        flags |= DAV_SESSION_DECRYPT_PROPERTIES;
+    }
     if(repo->encrypt_content) {
         flags |= DAV_SESSION_ENCRYPT_CONTENT;
     }
     if(repo->encrypt_name) {
         flags |= DAV_SESSION_ENCRYPT_NAME;
     }
+    if(repo->encrypt_properties) {
+        flags |= DAV_SESSION_ENCRYPT_PROPERTIES;
+    }
     return flags;
 }
 
--- a/dav/config.h	Sat Jun 15 11:01:37 2019 +0200
+++ b/dav/config.h	Sun Jun 16 13:14:24 2019 +0200
@@ -63,8 +63,10 @@
     bool verification;
     bool encrypt_content;
     bool encrypt_name;
+    bool encrypt_properties;
     bool decrypt_content;
     bool decrypt_name;
+    bool decrypt_properties;
     int ssl_version;
     unsigned long authmethods;
 };
--- a/libidav/webdav.h	Sat Jun 15 11:01:37 2019 +0200
+++ b/libidav/webdav.h	Sun Jun 16 13:14:24 2019 +0200
@@ -104,12 +104,14 @@
 
 #define DAV_SESSION_ENCRYPT_CONTENT     0x0001
 #define DAV_SESSION_ENCRYPT_NAME        0x0002
-#define DAV_SESSION_DECRYPT_CONTENT     0x0004
-#define DAV_SESSION_DECRYPT_NAME        0x0008
-#define DAV_SESSION_STORE_HASH          0x0010
+#define DAV_SESSION_ENCRYPT_PROPERTIES  0x0004
+#define DAV_SESSION_DECRYPT_CONTENT     0x0008
+#define DAV_SESSION_DECRYPT_NAME        0x0010
+#define DAV_SESSION_DECRYPT_PROPERTIES  0x0020
+#define DAV_SESSION_STORE_HASH          0x0040
 
-#define DAV_SESSION_CONTENT_ENCRYPTION  0x0005
-#define DAV_SESSION_FULL_ENCRYPTION     0x000f
+#define DAV_SESSION_CONTENT_ENCRYPTION  0x0009
+#define DAV_SESSION_FULL_ENCRYPTION     0x003f
 
 
 #define DAV_NS "http://davutils.org/"

mercurial