Skip to contentSkip to conversation

tcrypt failing on hmac(crc32)

DISCUSSION Marcus Meissner 2 participants 7 messages May 25, 2016 – May 27, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

Hi,

when enabling the testmgr framework and FIPS in 4.6 and 4.4 and running "modprobe tcrypt"

[ 1153.298266] alg: hash: Failed to load transform for hmac(crc32): -2
[ 1153.340636] tcrypt: one or more tests failed!

I spent some hours making sense of what is missing, but I got lost in the maze of the crypto apis between sync and async hashes somewhere.

Does anyone know the solution for this, otherwise I will need to continue looking.

Ciao, Marcus

#1 lore raw

Am Mittwoch, 25. Mai 2016, 09:07:52 schrieb Marcus Meissner:

Hi Marcus,

Quoted 4 lines

Hi,

when enabling the testmgr framework and FIPS in 4.6 and 4.4 and running "modprobe tcrypt"

        }, {
                .alg = "hmac(crc32)",
                .test = alg_test_hash,

...

fips_allowed = 1 missing?

Quoted 7 lines
[ 1153.298266] alg: hash: Failed to load transform for hmac(crc32): -2
[ 1153.340636] tcrypt: one or more tests failed!

I spent some hours making sense of what is missing, but I got lost in the maze of the crypto apis between sync and async hashes somewhere.

Quoted 8 lines

Does anyone know the solution for this, otherwise I will need to continue looking.

Ciao, Marcus
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Ciao
Stephan

#2 lore raw

Hi,

Quoted 9 lines · Stephan Mueller

Am Mittwoch, 25. Mai 2016, 09:07:52 schrieb Marcus Meissner:

Hi Marcus,

Quoted 4 lines

Hi,

when enabling the testmgr framework and FIPS in 4.6 and 4.4 and running "modprobe tcrypt"

Quoted 6 lines
        }, {
                .alg = "hmac(crc32)",
                .test = alg_test_hash,

...

fips_allowed = 1 missing?

The kernel was not in FIPS mode, and adding it did not help. :/

Ciao, Marcus

#3 lore raw

Am Mittwoch, 25. Mai 2016, 13:36:10 schrieb Marcus Meissner:

Hi Marcus,

Quoted 14 lines

Hi,

Quoted 11 lines · Stephan Mueller

Am Mittwoch, 25. Mai 2016, 09:07:52 schrieb Marcus Meissner:

Hi Marcus,

Quoted 5 lines

Hi,

when enabling the testmgr framework and FIPS in 4.6 and 4.4 and running "modprobe tcrypt"

        }, {
Quoted 8 lines
Quoted 6 lines

.alg = "hmac(crc32)",
.test = alg_test_hash,

...

fips_allowed = 1 missing?

The kernel was not in FIPS mode, and adding it did not help. :/

Sorry, I read FIPS and implied fips=1 :-)

Ciao
Stephan

#4 lore raw
Quoted 21 lines · Stephan Mueller

Am Mittwoch, 25. Mai 2016, 13:36:10 schrieb Marcus Meissner:

Hi Marcus,

Quoted 17 lines

Hi,

Quoted 14 lines · Stephan Mueller

Am Mittwoch, 25. Mai 2016, 09:07:52 schrieb Marcus Meissner:

Hi Marcus,

Quoted 5 lines

Hi,

when enabling the testmgr framework and FIPS in 4.6 and 4.4 and running "modprobe tcrypt"

        }, {
        
                .alg = "hmac(crc32)",
                .test = alg_test_hash,
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

...

fips_allowed = 1 missing?

The kernel was not in FIPS mode, and adding it did not help. :/

Sorry, I read FIPS and implied fips=1 :-)

I think we are running in a precondition

        ds = salg->digestsize;		// is CHKSUM_DIGEST_SIZE == 4 for CRC32
        ss = salg->statesize;		// ? cant find it
        alg = &salg->base; 		// base.cra_blocksize seems CHKSUM_BLOCKSIZE == 1
        if (ds > alg->cra_blocksize ||
            ss < alg->cra_blocksize)
                goto out_put_alg;

	4 > 1 ... so EINVAL return.

If this is the case, hmac(crc32) might be kind of non-sensical?

Ciao, Marcus

#5 lore raw
Quoted 41 lines · Marcus Meissner
Quoted 21 lines · Stephan Mueller

Am Mittwoch, 25. Mai 2016, 13:36:10 schrieb Marcus Meissner:

Hi Marcus,

Quoted 17 lines

Hi,

Quoted 14 lines · Stephan Mueller

Am Mittwoch, 25. Mai 2016, 09:07:52 schrieb Marcus Meissner:

Hi Marcus,

Quoted 5 lines

Hi,

when enabling the testmgr framework and FIPS in 4.6 and 4.4 and running "modprobe tcrypt"

        }, {
        
                .alg = "hmac(crc32)",
                .test = alg_test_hash,
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

...

fips_allowed = 1 missing?

The kernel was not in FIPS mode, and adding it did not help. :/

Sorry, I read FIPS and implied fips=1 :-)

I think we are running in a precondition

        ds = salg->digestsize;		// is CHKSUM_DIGEST_SIZE == 4 for CRC32
        ss = salg->statesize;		// ? cant find it
        alg = &salg->base; 		// base.cra_blocksize seems CHKSUM_BLOCKSIZE == 1
        if (ds > alg->cra_blocksize ||
            ss < alg->cra_blocksize)
                goto out_put_alg;

	4 > 1 ... so EINVAL return.
Quoted 1 line

If this is the case, hmac(crc32) might be kind of non-sensical?

And it actually is:

[  180.942532] hmac: blocksize check failed, ds=4, cra_blocksize=1, ss=4
[  180.942541] alg: hash: Failed to load transform for hmac(crc32): -2
[  180.989191] tcrypt: one or more tests failed!

Should I remove hmac(crc32) from the testmgr list?

Ciao, Marcus

#6 lore raw

Am Freitag, 27. Mai 2016, 11:19:32 schrieb Marcus Meissner:

Hi Marcus,

Quoted 8 lines

And it actually is:

[  180.942532] hmac: blocksize check failed, ds=4, cra_blocksize=1, ss=4
[  180.942541] alg: hash: Failed to load transform for hmac(crc32): -2
[  180.989191] tcrypt: one or more tests failed!

Should I remove hmac(crc32) from the testmgr list?

I am wondering about that: there are test vectors for this cipher, so there seem to be valid use cases. But the implementation is broken and nobody noticed up to now. So, it seems it is not in use?

Given that, I would think that hmac(crc32) could be removed from testmgr.

Ciao
Stephan