All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] sctp failed to load transform for hmac(md5)
@ 2010-03-01  9:07 Wei Yongjun
  2010-03-01  9:47 ` Herbert Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Wei Yongjun @ 2010-03-01  9:07 UTC (permalink / raw)
  To: linux-sctp

Hi:

After I update the kernel to the 2.6.33, I got the following error,
Is there something change to the crypto API or some modules
is missing?

[root@RHEL ~]# sctp_test -H 127.0.0.1 -P 8000 -l
local:addr\x127.0.0.1, port=irdmi, family=2
seed = 1267480579

Starting tests...
	socket(SOCK_SEQPACKET, IPPROTO_SCTP)  ->  sk=3
	bind(sk=3, [a:127.0.0.1,p:irdmi])  --  attempt 1/10
	listen(sk=3,backlog\x100)


		*** listen:  Function not implemented ***

[root@RHEL ~]# dmesg | tail
SCTP: Hash tables configured (established 2048 bind 2048)
sctp_init_sock(sk: ce63db68)
sctp_init_sock(sk: ceafb8a0)
sctp_setsockopt(sk: ceafb8a0... optname: 11)
sctp_bind(sk: ceafb8a0, addr: ceaa0ed4, addr_len: 16)
sctp_do_bind(sk: ceafb8a0, new addr: 127.0.0.1, port: 0, new port: 8000, len: 16)
sctp_get_port() begins, snum€00
SCTP: failed to load transform for hmac(md5): -2
sctp_close(sk: 0xceafb8a0, timeout:0)
sctp_destroy_sock(sk: ceafb8a0)


[root@RHEL ~]# cat /proc/crypto 
name         : stdrng
driver       : krng
module       : kernel
priority     : 200
refcnt       : 1
selftest     : passed
type         : rng
seedsize     : 0

name         : crc32c
driver       : crc32c-generic
module       : kernel
priority     : 100
refcnt       : 2
selftest     : passed
type         : shash
blocksize    : 1
digestsize   : 4

name         : sha1
driver       : sha1-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
type         : shash
blocksize    : 64
digestsize   : 20

name         : md5
driver       : md5-generic
module       : kernel
priority     : 0
refcnt       : 1
selftest     : passed
type         : shash
blocksize    : 64
digestsize   : 16


The source code is this:

5576 SCTP_STATIC int sctp_listen_start(struct sock *sk, int backlog)
5577 {
5578         struct sctp_sock *sp = sctp_sk(sk);
5579         struct sctp_endpoint *ep = sp->ep;
5580         struct crypto_hash *tfm = NULL;
5581 
5582         /* Allocate HMAC for generating cookie. */
5583         if (!sctp_sk(sk)->hmac && sctp_hmac_alg) {
5584                 tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC);
5585                 if (IS_ERR(tfm)) {
5586                         if (net_ratelimit()) {
5587                                 printk(KERN_INFO
5588                                        "SCTP: failed to load transform for %s: %ld\n",
5589                                         sctp_hmac_alg, PTR_ERR(tfm));
5590                         }
5591                         return -ENOSYS;
5592                 }
5593                 sctp_sk(sk)->hmac = tfm;
5594         }



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] sctp failed to load transform for hmac(md5)
  2010-03-01  9:07 [BUG] sctp failed to load transform for hmac(md5) Wei Yongjun
@ 2010-03-01  9:47 ` Herbert Xu
  2010-03-02  1:50 ` Wei Yongjun
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2010-03-01  9:47 UTC (permalink / raw)
  To: linux-sctp

On Mon, Mar 01, 2010 at 05:07:43PM +0800, Wei Yongjun wrote:
> Hi:
> 
> After I update the kernel to the 2.6.33, I got the following error,
> Is there something change to the crypto API or some modules
> is missing?

Is this 2.6.33-release, or the latest git tree?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] sctp failed to load transform for hmac(md5)
  2010-03-01  9:07 [BUG] sctp failed to load transform for hmac(md5) Wei Yongjun
  2010-03-01  9:47 ` Herbert Xu
@ 2010-03-02  1:50 ` Wei Yongjun
  2010-03-02 12:55 ` Herbert Xu
  2010-03-03  4:58 ` Wei Yongjun
  3 siblings, 0 replies; 5+ messages in thread
From: Wei Yongjun @ 2010-03-02  1:50 UTC (permalink / raw)
  To: linux-sctp



Herbert Xu wrote:
> On Mon, Mar 01, 2010 at 05:07:43PM +0800, Wei Yongjun wrote:
>   
>> Hi:
>>
>> After I update the kernel to the 2.6.33, I got the following error,
>> Is there something change to the crypto API or some modules
>> is missing?
>>     
>
> Is this 2.6.33-release, or the latest git tree?
>   

It is the latest git tree.

> Cheers,
>   

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] sctp failed to load transform for hmac(md5)
  2010-03-01  9:07 [BUG] sctp failed to load transform for hmac(md5) Wei Yongjun
  2010-03-01  9:47 ` Herbert Xu
  2010-03-02  1:50 ` Wei Yongjun
@ 2010-03-02 12:55 ` Herbert Xu
  2010-03-03  4:58 ` Wei Yongjun
  3 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2010-03-02 12:55 UTC (permalink / raw)
  To: linux-sctp

On Tue, Mar 02, 2010 at 09:50:31AM +0800, Wei Yongjun wrote:
>
> It is the latest git tree.

OK, it was caused by the new import/export functions.

This patch should fix it:

commit 73691eebefb1961b4819d995e530d6254cb51769
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Tue Mar 2 20:54:38 2010 +0800

    md5: Set statesize
    
    As md5 now has export/import functions, it must set the attribute
    statesize.  Otherwise anything that relies on import/export may
    fail as they will see a zero statesize.
    
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/crypto/md5.c b/crypto/md5.c
index 9fda213..30efc7d 100644
--- a/crypto/md5.c
+++ b/crypto/md5.c
@@ -234,6 +234,7 @@ static struct shash_alg alg = {
 	.export		=	md5_export,
 	.import		=	md5_import,
 	.descsize	=	sizeof(struct md5_state),
+	.statesize	=	sizeof(struct md5_state),
 	.base		=	{
 		.cra_name	=	"md5",
 		.cra_flags	=	CRYPTO_ALG_TYPE_SHASH,

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [BUG] sctp failed to load transform for hmac(md5)
  2010-03-01  9:07 [BUG] sctp failed to load transform for hmac(md5) Wei Yongjun
                   ` (2 preceding siblings ...)
  2010-03-02 12:55 ` Herbert Xu
@ 2010-03-03  4:58 ` Wei Yongjun
  3 siblings, 0 replies; 5+ messages in thread
From: Wei Yongjun @ 2010-03-03  4:58 UTC (permalink / raw)
  To: linux-sctp



Herbert Xu wrote:
> On Tue, Mar 02, 2010 at 09:50:31AM +0800, Wei Yongjun wrote:
>   
>> It is the latest git tree.
>>     
>
> OK, it was caused by the new import/export functions.
>
> This patch should fix it:
>
> commit 73691eebefb1961b4819d995e530d6254cb51769
> Author: Herbert Xu <herbert@gondor.apana.org.au>
> Date:   Tue Mar 2 20:54:38 2010 +0800
>
>     md5: Set statesize
>     
>     As md5 now has export/import functions, it must set the attribute
>     statesize.  Otherwise anything that relies on import/export may
>     fail as they will see a zero statesize.
>     
>     Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>   

This patch fixed the sctp's problem. Thanks.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-03  4:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01  9:07 [BUG] sctp failed to load transform for hmac(md5) Wei Yongjun
2010-03-01  9:47 ` Herbert Xu
2010-03-02  1:50 ` Wei Yongjun
2010-03-02 12:55 ` Herbert Xu
2010-03-03  4:58 ` Wei Yongjun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.