# HG changeset patch # User Olaf Wintermann # Date 1565720603 -7200 # Node ID 27985062cd2cd09aa7d3bb73892d7db39530ead0 # Parent 7870656d302dc185b10d610fc0f65a4dbb405819 fix build on Solaris 10 diff -r 7870656d302d -r 27985062cd2c libidav/crypto.c --- a/libidav/crypto.c Sun Aug 11 18:41:06 2019 +0200 +++ b/libidav/crypto.c Tue Aug 13 20:23:23 2019 +0200 @@ -355,7 +355,10 @@ char* dav_create_hash(const char *data, size_t len) { unsigned char hash[DAV_SHA256_DIGEST_LENGTH]; - SHA256((const unsigned char*)data, len, hash); + DAV_SHA_CTX ctx; + SHA256_Init(&ctx); + SHA256_Update(&ctx, data, len); + SHA256_Final(hash, &ctx); return util_hexstr(hash, DAV_SHA256_DIGEST_LENGTH); } @@ -374,6 +377,17 @@ free(ctx); } +#if OPENSSL_VERSION_NUMBER < 0x10100000L +static int crypto_pw2key_error = 0; +DavKey* dav_pw2key(const char *password, const unsigned char *salt, int saltlen, int pwfunc, int enc) { + if(!crypto_pw2key_error) { + fprintf(stderr, "Error: password key derivation not supported on this platform: openssl to old\n"); + crypto_pw2key_error = 1; + } + return 0; +} + +#else DavKey* dav_pw2key(const char *password, const unsigned char *salt, int saltlen, int pwfunc, int enc) { if(!password) { return NULL; @@ -430,6 +444,7 @@ memcpy(key->data, keydata, keylen); return key; } +#endif #endif diff -r 7870656d302d -r 27985062cd2c libidav/utils.c --- a/libidav/utils.c Sun Aug 11 18:41:06 2019 +0200 +++ b/libidav/utils.c Tue Aug 13 20:23:23 2019 +0200 @@ -1066,4 +1066,4 @@ fclose(in); return util_hexstr(hash, DAV_SHA256_DIGEST_LENGTH); -} \ No newline at end of file +} diff -r 7870656d302d -r 27985062cd2c libidav/versioning.c --- a/libidav/versioning.c Sun Aug 11 18:41:06 2019 +0200 +++ b/libidav/versioning.c Tue Aug 13 20:23:23 2019 +0200 @@ -170,4 +170,4 @@ } return versions; -} \ No newline at end of file +}