History

crypto: clarify name of WEAK_KEY request flag

CRYPTO_TFM_REQ_WEAK_KEY confuses newcomers to the crypto API because it sounds like it is requesting a weak key. Actually, it is requesting that weak keys be forbidden (for algorithms that have the notion of "weak keys"; currently only DES and XTS do). Also it is only one letter away from CRYPTO_TFM_RES_WEAK_KEY, with which it can be easily confused. (This in fact happened in the UX500 driver, though just in some debugging messages.) Therefore, make the intent clear by renaming it to CRYPTO_TFM_REQ_FORBID_WEAK_KEYS.

Eric Biggers committed 7 years ago

Commit 231baec1 parent 37ebfff25 files · +55 −49Browse files

Showing the changes to include/linux (1 of 25 files). Show all

Unified · Split

include/linux/crypto.h+1−1
@@ -118,7 +118,7 @@ · 117 unmodified lines
118#define CRYPTO_TFM_REQ_MASK 0x000fff00118#define CRYPTO_TFM_REQ_MASK 0x000fff00
119#define CRYPTO_TFM_RES_MASK 0xfff00000119#define CRYPTO_TFM_RES_MASK 0xfff00000
120 120
121#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100121#define CRYPTO_TFM_REQ_FORBID_WEAK_KEYS 0x00000100
122#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200122#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
123#define CRYPTO_TFM_REQ_MAY_BACKLOG 0x00000400123#define CRYPTO_TFM_REQ_MAY_BACKLOG 0x00000400
124#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000124#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t