dav/config.c

changeset 606
aa49966e4e85
parent 472
08d2d1263429
child 729
5433f0f3dd48
equal deleted inserted replaced
605:bbc66c72661a 606:aa49966e4e85
191 191
192 Repository* repository_new(void) { 192 Repository* repository_new(void) {
193 Repository *repo = calloc(1, sizeof(Repository)); 193 Repository *repo = calloc(1, sizeof(Repository));
194 repo->encrypt_name = false; 194 repo->encrypt_name = false;
195 repo->encrypt_content = false; 195 repo->encrypt_content = false;
196 repo->encrypt_properties = false;
196 repo->decrypt_name = false; 197 repo->decrypt_name = false;
197 repo->decrypt_content = true; 198 repo->decrypt_content = true;
199 repo->decrypt_properties = false;
198 repo->verification = true; 200 repo->verification = true;
199 repo->ssl_version = CURL_SSLVERSION_DEFAULT; 201 repo->ssl_version = CURL_SSLVERSION_DEFAULT;
200 repo->authmethods = CURLAUTH_BASIC; 202 repo->authmethods = CURLAUTH_BASIC;
201 return repo; 203 return repo;
202 } 204 }
229 repo->default_key = strdup(value); 231 repo->default_key = strdup(value);
230 } else if(xstreq(key, "full-encryption")) { 232 } else if(xstreq(key, "full-encryption")) {
231 if(util_getboolean(value)) { 233 if(util_getboolean(value)) {
232 repo->encrypt_name = true; 234 repo->encrypt_name = true;
233 repo->encrypt_content = true; 235 repo->encrypt_content = true;
236 repo->encrypt_properties = true;
234 repo->decrypt_name = true; 237 repo->decrypt_name = true;
235 repo->decrypt_content = true; 238 repo->decrypt_content = true;
239 repo->decrypt_properties = true;
236 } 240 }
237 } else if(xstreq(key, "content-encryption")) { 241 } else if(xstreq(key, "content-encryption")) {
238 if(util_getboolean(value)) { 242 if(util_getboolean(value)) {
239 repo->encrypt_content = true; 243 repo->encrypt_content = true;
240 repo->decrypt_content = true; 244 repo->decrypt_content = true;
574 flags |= DAV_SESSION_DECRYPT_CONTENT; 578 flags |= DAV_SESSION_DECRYPT_CONTENT;
575 } 579 }
576 if(repo->decrypt_name) { 580 if(repo->decrypt_name) {
577 flags |= DAV_SESSION_DECRYPT_NAME; 581 flags |= DAV_SESSION_DECRYPT_NAME;
578 } 582 }
583 if(repo->decrypt_properties) {
584 flags |= DAV_SESSION_DECRYPT_PROPERTIES;
585 }
579 if(repo->encrypt_content) { 586 if(repo->encrypt_content) {
580 flags |= DAV_SESSION_ENCRYPT_CONTENT; 587 flags |= DAV_SESSION_ENCRYPT_CONTENT;
581 } 588 }
582 if(repo->encrypt_name) { 589 if(repo->encrypt_name) {
583 flags |= DAV_SESSION_ENCRYPT_NAME; 590 flags |= DAV_SESSION_ENCRYPT_NAME;
591 }
592 if(repo->encrypt_properties) {
593 flags |= DAV_SESSION_ENCRYPT_PROPERTIES;
584 } 594 }
585 return flags; 595 return flags;
586 } 596 }
587 597
588 598

mercurial