|
@@ -363,6 +363,16 @@ static int test_aead(struct crypto_aead *tfm, int enc,
|
|
|
|
|
|
switch (ret) {
|
|
switch (ret) {
|
|
case 0:
|
|
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;
|
|
break;
|
|
case -EINPROGRESS:
|
|
case -EINPROGRESS:
|
|
case -EBUSY:
|
|
case -EBUSY:
|
|
@@ -372,6 +382,10 @@ static int test_aead(struct crypto_aead *tfm, int enc,
|
|
INIT_COMPLETION(result.completion);
|
|
INIT_COMPLETION(result.completion);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ case -EBADMSG:
|
|
|
|
+ if (template[i].novrfy)
|
|
|
|
+ /* verification failure was expected */
|
|
|
|
+ continue;
|
|
/* fall through */
|
|
/* fall through */
|
|
default:
|
|
default:
|
|
printk(KERN_ERR "alg: aead: %s failed on test "
|
|
printk(KERN_ERR "alg: aead: %s failed on test "
|
|
@@ -481,6 +495,16 @@ static int test_aead(struct crypto_aead *tfm, int enc,
|
|
|
|
|
|
switch (ret) {
|
|
switch (ret) {
|
|
case 0:
|
|
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;
|
|
break;
|
|
case -EINPROGRESS:
|
|
case -EINPROGRESS:
|
|
case -EBUSY:
|
|
case -EBUSY:
|
|
@@ -490,6 +514,10 @@ static int test_aead(struct crypto_aead *tfm, int enc,
|
|
INIT_COMPLETION(result.completion);
|
|
INIT_COMPLETION(result.completion);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ case -EBADMSG:
|
|
|
|
+ if (template[i].novrfy)
|
|
|
|
+ /* verification failure was expected */
|
|
|
|
+ continue;
|
|
/* fall through */
|
|
/* fall through */
|
|
default:
|
|
default:
|
|
printk(KERN_ERR "alg: aead: %s failed on "
|
|
printk(KERN_ERR "alg: aead: %s failed on "
|