# HG changeset patch # User Olaf Wintermann # Date 1486213412 -3600 # Node ID f60d742a62a0f58c84485fe2f0113ad57c40c2d2 # Parent 26f5f817429e015b3f7b8fb5a5a84a8b597b9c7d fixes build with ancient openssl diff -r 26f5f817429e -r f60d742a62a0 dav/db.c --- a/dav/db.c Sat Feb 04 12:41:11 2017 +0100 +++ b/dav/db.c Sat Feb 04 14:03:32 2017 +0100 @@ -279,7 +279,7 @@ } if(res->skipped) { - r = xmlTextWriterStartElement(writer, "skipped"); + r = xmlTextWriterStartElement(writer, BAD_CAST "skipped"); r += xmlTextWriterEndElement(writer); if(r < 0) { fprintf(stderr, "Cannot write skipped\n"); diff -r 26f5f817429e -r f60d742a62a0 libidav/crypto.c --- a/libidav/crypto.c Sat Feb 04 12:41:11 2017 +0100 +++ b/libidav/crypto.c Sat Feb 04 14:03:32 2017 +0100 @@ -34,6 +34,24 @@ #include #include "crypto.h" +#if OPENSSL_VERSION_NUMBER < 10000000 + +static EVP_CIPHER_CTX* create_evp_cipher_ctx() { + EVP_CIPHER_CTX *ctx = malloc(sizeof(EVP_CIPHER_CTX)); + EVP_CIPHER_CTX_init(ctx); + return ctx; +} + +static void free_evp_cipher_ctx(EVP_CIPHER_CTX *ctx) { + EVP_CIPHER_CTX_cleanup(ctx); + free(ctx); +} + +#define EVP_CIPHER_CTX_new() create_evp_cipher_ctx() +#define EVP_CIPHER_CTX_free(ctx) free_evp_cipher_ctx(ctx) + +#endif + AESDecrypter* aes_decrypter_new(DavKey *key, void *stream, dav_write_func write_func) { AESDecrypter *dec = calloc(1, sizeof(AESDecrypter)); SHA256_Init(&dec->sha256); diff -r 26f5f817429e -r f60d742a62a0 libidav/resource.c --- a/libidav/resource.c Sat Feb 04 12:41:11 2017 +0100 +++ b/libidav/resource.c Sat Feb 04 14:03:32 2017 +0100 @@ -1022,7 +1022,6 @@ curl_easy_getinfo (handle, CURLINFO_RESPONSE_CODE, &status); if(ret == CURLE_OK && (status >= 200 && status < 300)) { dav_remove_lock(sn, res->path, lock); - return 0; } else { dav_session_set_error(sn, ret, status); return 1;