diff options
author | pjd <pjd@FreeBSD.org> | 2006-04-10 18:49:46 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-04-10 18:49:46 +0000 |
commit | 7387c6237a0d559cee34d99e4cd2e52c88652cae (patch) | |
tree | 040336c9c18ed45d6321dd983d065edd9a5b09a8 /sys/dev/safe | |
parent | 23fa0188112e2637e2d02278960def09f6d3cba4 (diff) | |
download | FreeBSD-src-7387c6237a0d559cee34d99e4cd2e52c88652cae.zip FreeBSD-src-7387c6237a0d559cee34d99e4cd2e52c88652cae.tar.gz |
safe(4) doesn't support explicitly provided keys. Return an error instead
of encrypting/decrypting data with a wrong key.
Diffstat (limited to 'sys/dev/safe')
-rw-r--r-- | sys/dev/safe/safe.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index 9d012f1..6dde6ad4 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -904,6 +904,13 @@ safe_process(void *arg, struct cryptop *crp, int hint) } crd2 = crd1->crd_next; + if ((crd1->crd_flags & CRD_F_KEY_EXPLICIT) || + (crd2 != NULL && (crd2->crd_flags & CRD_F_KEY_EXPLICIT))) { + safestats.st_badflags++; + err = EINVAL; + goto errout; + } + cmd0 = SAFE_SA_CMD0_BASIC; /* basic group operation */ cmd1 = 0; if (crd2 == NULL) { |