Return-Path: Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Mon, 4 Feb 2019 18:47:08 +0100 (CET) Received: by mail-wm1-x32b.google.com with SMTP id y8so840661wmi.4 for ; Mon, 04 Feb 2019 09:47:08 -0800 (PST) References: <44be54bb-10ce-813d-cfc0-8a97fc097a43@linux.ibm.com> From: Milan Broz Message-ID: <20cb81f4-f170-83a1-76e5-54a973adf447@gmail.com> Date: Mon, 4 Feb 2019 18:47:05 +0100 MIME-Version: 1.0 In-Reply-To: <44be54bb-10ce-813d-cfc0-8a97fc097a43@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dm-crypt] How to get PBKDF settings of an existing key slot via libcryptsetup ? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ingo Franzki , dm-crypt@saout.de On 04/02/2019 16:15, Ingo Franzki wrote: > It would be nice if I could check via #ifdef if that new function is available or not. > For example have a symbol in libcryptsetup.h that contains the current version: > #define LIBCRYPTSETUP_VERSION 0x00020006 > That way one could use > #ifdef LIBCRYPTSETUP_VERSION >= 0x00020006 > to check for a feature. No, sorry, I am not going to provide such strings. Usually, it ends in a big confusion (some distro backports patches without modifying define, etc.) Also, the version of API is not the version of binaries (we use so lib versioning that provides backward compatibility on the symbol level). The proper way would be to use autoconf (or similar tool) that checks availability of symbol and then it automatically defines HAVE_symbol in config.h, but I am not sure if you can use it. I'll try to squeeze it to 2.1 release, there will be some new defines as well, so library name version will be updated appropriately. In the worst case, you can probably "abuse" other defines that appears in libcryptsetup.h (like CRYPT_LOG_DEBUG_JSON) in the same version. Milan