Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7063
b: refs/heads/master
c: 64baf3c
h: refs/heads/master
i:
  7061: 6c2b63b
  7059: 8694785
  7055: 2d939b3
v: v3
  • Loading branch information
Herbert Xu authored and David S. Miller committed Sep 2, 2005
1 parent 3929cad commit 0cb91a9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fb4f10ed50f01b0f953068456bfb6e2885921b01
refs/heads/master: 64baf3cfea974d2b9e671ccfdbc03e030ea5ebc6
3 changes: 2 additions & 1 deletion trunk/crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name)

static int crypto_init_flags(struct crypto_tfm *tfm, u32 flags)
{
tfm->crt_flags = 0;
tfm->crt_flags = flags & CRYPTO_TFM_REQ_MASK;
flags &= ~CRYPTO_TFM_REQ_MASK;

switch (crypto_tfm_alg_type(tfm)) {
case CRYPTO_ALG_TYPE_CIPHER:
Expand Down
4 changes: 0 additions & 4 deletions trunk/crypto/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,7 @@ static int nocrypt_iv(struct crypto_tfm *tfm,
int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags)
{
u32 mode = flags & CRYPTO_TFM_MODE_MASK;

tfm->crt_cipher.cit_mode = mode ? mode : CRYPTO_TFM_MODE_ECB;
if (flags & CRYPTO_TFM_REQ_WEAK_KEY)
tfm->crt_flags = CRYPTO_TFM_REQ_WEAK_KEY;

return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion trunk/crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <asm/kmap_types.h>

extern enum km_type crypto_km_types[];
Expand All @@ -38,7 +39,7 @@ static inline void crypto_kunmap(void *vaddr, int out)

static inline void crypto_yield(struct crypto_tfm *tfm)
{
if (!in_atomic())
if (tfm->crt_flags & CRYPTO_TFM_REQ_MAY_SLEEP)
cond_resched();
}

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#define CRYPTO_TFM_MODE_CTR 0x00000008

#define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100
#define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200
#define CRYPTO_TFM_RES_WEAK_KEY 0x00100000
#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000
#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000
Expand Down

0 comments on commit 0cb91a9

Please sign in to comment.