diff options
author | phk <phk@FreeBSD.org> | 2004-01-23 11:47:06 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-01-23 11:47:06 +0000 |
commit | a3cc95eec930b8a454ff879d14c67ad45e87c9a8 (patch) | |
tree | a0d383d0d880e80096fbe7468bec20d9bc0825d3 /sys/geom/bde | |
parent | 02c00b4d8aa516fa6e9cb73181cd1e7119a10be5 (diff) | |
download | FreeBSD-src-a3cc95eec930b8a454ff879d14c67ad45e87c9a8.zip FreeBSD-src-a3cc95eec930b8a454ff879d14c67ad45e87c9a8.tar.gz |
Remove the MD5_KEY debugging tool
Diffstat (limited to 'sys/geom/bde')
-rw-r--r-- | sys/geom/bde/g_bde_crypt.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/sys/geom/bde/g_bde_crypt.c b/sys/geom/bde/g_bde_crypt.c index 0a3c947..2ace5b4 100644 --- a/sys/geom/bde/g_bde_crypt.c +++ b/sys/geom/bde/g_bde_crypt.c @@ -132,30 +132,8 @@ g_bde_crypt_read(struct g_bde_work *wp) g_bde_kkey(sc, &ki, DIR_DECRYPT, wp->offset + o); AES_decrypt(&ci, &ki, d, skey, sizeof skey); d = (u_char *)wp->data + o; -#ifdef MD5_KEY - { - MD5_CTX ct; - u_char rkey[16]; - int i; - - MD5Init(&ct); - MD5Update(&ct, d, sc->sectorsize); - MD5Final(rkey, &ct); - if (bcmp(rkey, skey, 16) != 0) { -#if 0 - printf("MD5_KEY failed at %jd (t=%d)\n", - (intmax_t)(wp->offset + o), time_second); -#endif - for (i = 0; i < sc->sectorsize; i++) - d[i] = 'A' + i % 26; - sprintf(d, "MD5_KEY failed at %jd (t=%d)", - (intmax_t)(wp->offset + o), time_second); - } - } -#else AES_makekey(&ki, DIR_DECRYPT, G_BDE_SKEYBITS, skey); AES_decrypt(&ci, &ki, d, d, sc->sectorsize); -#endif } bzero(skey, sizeof skey); bzero(&ci, sizeof ci); @@ -187,20 +165,9 @@ g_bde_crypt_write(struct g_bde_work *wp) s = (u_char *)wp->data + o; d = (u_char *)wp->sp->data + o; -#ifdef MD5_KEY - { - MD5_CTX ct; - - MD5Init(&ct); - MD5Update(&ct, s, sc->sectorsize); - MD5Final(skey, &ct); - bcopy(s, d, sc->sectorsize); - } -#else arc4rand(skey, sizeof skey, 0); AES_makekey(&ki, DIR_ENCRYPT, G_BDE_SKEYBITS, skey); AES_encrypt(&ci, &ki, s, d, sc->sectorsize); -#endif d = (u_char *)wp->ksp->data + wp->ko + n * G_BDE_SKEYLEN; g_bde_kkey(sc, &ki, DIR_ENCRYPT, wp->offset + o); |