Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316380 Details for
Bug 461537
crypto: hmac(md5) self-test panics system
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[CRYPTO] hmac: Avoid calling virt_to_page on key
p (text/plain), 1.53 KB, created by
Herbert Xu
on 2008-09-11 00:43:08 UTC
(
hide
)
Description:
[CRYPTO] hmac: Avoid calling virt_to_page on key
Filename:
MIME Type:
Creator:
Herbert Xu
Created:
2008-09-11 00:43:08 UTC
Size:
1.53 KB
patch
obsolete
>commit 5492ac24ac216f0227aad356e753ce0471c69fd6 >Author: Herbert Xu <herbert@gondor.apana.org.au> >Date: Thu Sep 11 10:42:31 2008 +1000 > > [CRYPTO] hmac: Avoid calling virt_to_page on key > > When HMAC gets a key longer than the block size of the hash, it needs > to feed it as input to the hash to reduce it to a fixed length. As > it is HMAC converts the key to a scatter and gather list. However, > this doesn't work on certain platforms if the key is not allocated > via kmalloc. For example, the keys from tcrypt are stored in the > rodata section and this causes it to fail with HMAC on x86-64. > > This patch fixes this by copying the key to memory obtained via > kmalloc before hashing it. > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> > >diff --git a/crypto/hmac.c b/crypto/hmac.c >index 28a713b..a2faf9d 100644 >--- a/crypto/hmac.c >+++ b/crypto/hmac.c >@@ -56,9 +56,25 @@ static int hmac_setkey(struct crypto_hash *parent, > > if (keylen > bs) { > struct scatterlist tmp; >+ int tmplen; > >- sg_init_one(&tmp, (u8 *)inkey, keylen); >- crypto_digest_digest(tfm, &tmp, 1, digest); >+ crypto_digest_init(tfm); >+ >+ tmplen = bs * 2 + ds; >+ sg_init_one(&tmp, ipad, tmplen); >+ >+ for (; keylen > tmplen; inkey += tmplen, keylen -= tmplen) { >+ memcpy(ipad, inkey, tmplen); >+ crypto_digest_update(tfm, &tmp, 1); >+ } >+ >+ if (keylen) { >+ memcpy(ipad, inkey, keylen); >+ tmp.length = keylen; >+ crypto_digest_update(tfm, &tmp, 1); >+ } >+ >+ crypto_digest_final(tfm, digest); > > inkey = digest; > keylen = ds;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 461537
:
316194
|
316262
|
316379
| 316380