diff options
Diffstat (limited to 'security/keys/keyring.c')
-rw-r--r-- | security/keys/keyring.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 5620f084dede..cdd2f3f88c88 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -352,7 +352,7 @@ key_ref_t keyring_search_aux(key_ref_t keyring_ref, | |||
352 | goto error_2; | 352 | goto error_2; |
353 | if (key->expiry && now.tv_sec >= key->expiry) | 353 | if (key->expiry && now.tv_sec >= key->expiry) |
354 | goto error_2; | 354 | goto error_2; |
355 | key_ref = ERR_PTR(-ENOKEY); | 355 | key_ref = ERR_PTR(key->type_data.reject_error); |
356 | if (kflags & (1 << KEY_FLAG_NEGATIVE)) | 356 | if (kflags & (1 << KEY_FLAG_NEGATIVE)) |
357 | goto error_2; | 357 | goto error_2; |
358 | goto found; | 358 | goto found; |
@@ -401,7 +401,7 @@ descend: | |||
401 | 401 | ||
402 | /* we set a different error code if we pass a negative key */ | 402 | /* we set a different error code if we pass a negative key */ |
403 | if (kflags & (1 << KEY_FLAG_NEGATIVE)) { | 403 | if (kflags & (1 << KEY_FLAG_NEGATIVE)) { |
404 | err = -ENOKEY; | 404 | err = key->type_data.reject_error; |
405 | continue; | 405 | continue; |
406 | } | 406 | } |
407 | 407 | ||