Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148802
b: refs/heads/master
c: e44a1b4
h: refs/heads/master
v: v3
  • Loading branch information
Jarod Wilson authored and Herbert Xu committed Jun 2, 2009
1 parent 91e98c5 commit 61932eb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f8174187f409213e63c3589af163c627e8a182a
refs/heads/master: e44a1b44c3a9794236fe038b89a0fbef5adcd523
28 changes: 28 additions & 0 deletions trunk/crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ static int test_aead(struct crypto_aead *tfm, int enc,

switch (ret) {
case 0:
if (template[i].novrfy) {
/* verification was supposed to fail */
printk(KERN_ERR "alg: aead: %s failed "
"on test %d for %s: ret was 0, "
"expected -EBADMSG\n",
e, j, algo);
/* so really, we got a bad message */
ret = -EBADMSG;
goto out;
}
break;
case -EINPROGRESS:
case -EBUSY:
Expand All @@ -372,6 +382,10 @@ static int test_aead(struct crypto_aead *tfm, int enc,
INIT_COMPLETION(result.completion);
break;
}
case -EBADMSG:
if (template[i].novrfy)
/* verification failure was expected */
continue;
/* fall through */
default:
printk(KERN_ERR "alg: aead: %s failed on test "
Expand Down Expand Up @@ -481,6 +495,16 @@ static int test_aead(struct crypto_aead *tfm, int enc,

switch (ret) {
case 0:
if (template[i].novrfy) {
/* verification was supposed to fail */
printk(KERN_ERR "alg: aead: %s failed "
"on chunk test %d for %s: ret "
"was 0, expected -EBADMSG\n",
e, j, algo);
/* so really, we got a bad message */
ret = -EBADMSG;
goto out;
}
break;
case -EINPROGRESS:
case -EBUSY:
Expand All @@ -490,6 +514,10 @@ static int test_aead(struct crypto_aead *tfm, int enc,
INIT_COMPLETION(result.completion);
break;
}
case -EBADMSG:
if (template[i].novrfy)
/* verification failure was expected */
continue;
/* fall through */
default:
printk(KERN_ERR "alg: aead: %s failed on "
Expand Down
1 change: 1 addition & 0 deletions trunk/crypto/testmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct aead_testvec {
int np;
int anp;
unsigned char fail;
unsigned char novrfy; /* ccm dec verification failure expected */
unsigned char wk; /* weak key flag */
unsigned char klen;
unsigned short ilen;
Expand Down

0 comments on commit 61932eb

Please sign in to comment.