safe(4) doesn't support explicitly provided keys. Return an error instead
of encrypting/decrypting data with a wrong key.
This commit is contained in:
parent
483194fb9a
commit
2c87962602
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157641
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user