summaryrefslogtreecommitdiff
path: root/security/keys/dh.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-06-05 11:02:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-06-05 11:02:00 -0700
commitd834502e2fca9380a1579fecd134ef94c063b662 (patch)
tree5f180e522792facbe222c3c28b69df8003c93304 /security/keys/dh.c
parenteedf265aa003b4781de24cfed40a655a664457e6 (diff)
parent4693fc734d675c5518ea9bd4c9623db45bc37402 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull key handling update from James Morris: "This alters a new keyctl function added in the current merge window to allow for a future extension planned for the next merge window" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: KEYS: Add placeholder for KDF usage with DH
Diffstat (limited to 'security/keys/dh.c')
-rw-r--r--security/keys/dh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/security/keys/dh.c b/security/keys/dh.c
index 880505a4b9f1..531ed2ec132f 100644
--- a/security/keys/dh.c
+++ b/security/keys/dh.c
@@ -78,7 +78,8 @@ error:
}
long keyctl_dh_compute(struct keyctl_dh_params __user *params,
- char __user *buffer, size_t buflen)
+ char __user *buffer, size_t buflen,
+ void __user *reserved)
{
long ret;
MPI base, private, prime, result;
@@ -97,6 +98,11 @@ long keyctl_dh_compute(struct keyctl_dh_params __user *params,
goto out;
}
+ if (reserved) {
+ ret = -EINVAL;
+ goto out;
+ }
+
keylen = mpi_from_key(pcopy.prime, buflen, &prime);
if (keylen < 0 || !prime) {
/* buflen == 0 may be used to query the required buffer size,