aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Vu-Brugier <cvubrugier@fastmail.fm>2020-07-02 10:57:21 +0200
committerDavid Howells <dhowells@redhat.com>2020-07-06 18:00:28 +0100
commit9b815047340ad7e1d9e3be496b232a29f1b5b232 (patch)
treecfdc3e59484eb592291d94fb22186f527b9d422e
parent839b6280b9da081d4a051fa7ffc6e5b516024c7d (diff)
downloadkeyutils-9b815047340ad7e1d9e3be496b232a29f1b5b232.tar.gz
Fix compilation error when keyutils.h is used in C++
The declaration of the keyctl_dh_compute_kdf() function contains a parameter named "private". Unfortunately, "private" is a C++ reserved keyword. As a consequence, compiling a C++ program that includes keyutils.h fails. This patch renames the "private" variable to "priv" since a similar parameter is named this way in the nearby keyctl_dh_compute() function. Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm> Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--keyutils.c4
-rw-r--r--keyutils.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/keyutils.c b/keyutils.c
index 6f2d797..48b779e 100644
--- a/keyutils.c
+++ b/keyutils.c
@@ -244,11 +244,11 @@ long keyctl_dh_compute(key_serial_t priv, key_serial_t prime,
return keyctl(KEYCTL_DH_COMPUTE, &params, buffer, buflen, 0);
}
-long keyctl_dh_compute_kdf(key_serial_t private, key_serial_t prime,
+long keyctl_dh_compute_kdf(key_serial_t priv, key_serial_t prime,
key_serial_t base, char *hashname, char *otherinfo,
size_t otherinfolen, char *buffer, size_t buflen)
{
- struct keyctl_dh_params params = { .priv = private,
+ struct keyctl_dh_params params = { .priv = priv,
.prime = prime,
.base = base };
struct keyctl_kdf_params kdfparams = { .hashname = hashname,
diff --git a/keyutils.h b/keyutils.h
index 8570045..8b34353 100644
--- a/keyutils.h
+++ b/keyutils.h
@@ -222,7 +222,7 @@ extern long keyctl_invalidate(key_serial_t id);
extern long keyctl_get_persistent(uid_t uid, key_serial_t id);
extern long keyctl_dh_compute(key_serial_t priv, key_serial_t prime,
key_serial_t base, char *buffer, size_t buflen);
-extern long keyctl_dh_compute_kdf(key_serial_t private, key_serial_t prime,
+extern long keyctl_dh_compute_kdf(key_serial_t priv, key_serial_t prime,
key_serial_t base, char *hashname,
char *otherinfo, size_t otherinfolen,
char *buffer, size_t buflen);