[jboss-jira] [JBoss JIRA] Commented: (JGRP-538) ENCRYPT protocol throwing IllegalBlockSizeException

vivek v (JIRA) jira-events at lists.jboss.org
Thu Jun 21 19:16:04 EDT 2007


    [ http://jira.jboss.com/jira/browse/JGRP-538?page=comments#action_12366407 ] 
            
vivek v commented on JGRP-538:
------------------------------

Here is the stack used by the NotificationBusDemo,

 String props="UDP(mcast_addr=224.0.0.35;mcast_port=45566;ip_ttl=32;loopback=false;" +
                "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
                "PING(timeout=2000;num_initial_members=3):" +
                "MERGE2(min_interval=5000;max_interval=10000):" +
                "FD_SOCK:" +
                "VERIFY_SUSPECT(timeout=1500):" +
                "pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):" +
                "UNICAST(timeout=5000):" +
                "ENCRYPT(key_store_name=defaultStore.keystore;store_password=changeit;alias=myKey):" +
                "pbcast.STABLE(desired_avg_gossip=20000):" +
                "FRAG(frag_size=8096;down_thread=false;up_thread=false):" +
                // "CAUSAL:" +
                "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" +
                "shun=false;print_local_addr=true)";

Note: I have modified the memberJoined method as,

 public void memberJoined(Address mbr) {
	System.out.println("** Member joined: " + mbr);
        bus.sendNotification("Member Joined");
 }

The error on the second member when he joins,

 2859 [INFO] ENCRYPT.down(): - handling view: [223.1.1.128:2073|1] [223.1.1.128:2073, 223.1.1.128:2075]
> 3313 [WARN] ENCRYPT.up(): - exception occurred decrypting message
javax.crypto.BadPaddingException: Given final block not properly padded
	at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
	at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
	at com.sun.crypto.provider.BlowfishCipher.engineDoFinal(DashoA12275)
	at javax.crypto.Cipher.doFinal(DashoA12275)
	at org.jgroups.protocols.ENCRYPT._decrypt(ENCRYPT.java:838)
	at org.jgroups.protocols.ENCRYPT.decryptMessage(ENCRYPT.java:831)
	at org.jgroups.protocols.ENCRYPT.handleUpMessage(ENCRYPT.java:672)
	at org.jgroups.protocols.ENCRYPT.up(ENCRYPT.java:533)
	at org.jgroups.protocols.UNICAST.up(UNICAST.java:263)
	at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:720)


> ENCRYPT protocol throwing IllegalBlockSizeException
> ---------------------------------------------------
>
>                 Key: JGRP-538
>                 URL: http://jira.jboss.com/jira/browse/JGRP-538
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 2.5
>         Environment: Windows, Linux
>            Reporter: vivek v
>         Assigned To: Bela Ban
>             Fix For: 2.5
>
>
> I use NotificationBus channel and in the member joined method I call, bus.sendNotification(Node) - passing a custom Node object. Upon this I get the following error on the newly joined member,
> javax.crypto.IllegalBlockSizeException: Input length must be multiple of 8 when decrypting with padded cipher 
> at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) 
> at com.sun.crypto.provider.SunJCE_f.b(DashoA13*..) 
> at com.sun.crypto.provider.DESCipher.engineDoFinal(DashoA13*..) 
> at javax.crypto.Cipher.doFinal(DashoA13*..) 
> at org.jgroups.protocols.ENCRYPT._decrypt(ENCRYPT.java:838) 
> at org.jgroups.protocols.ENCRYPT.decryptMessage(ENCRYPT.java:831) 
> at org.jgroups.protocols.ENCRYPT.handleUpMessage(ENCRYPT.java:672) 
> at org.jgroups.protocols.ENCRYPT.up(ENCRYPT.java:533) 
> I could reproduce the same problem using NotificationBusDemo.java in JGroups 2.5 CR1. Here is what I did, 
>  
> 1) Generate a keystore using JGroups' KeyStoreGenerator  (I also tried with JDK 1.6's keytool to generate secret key)
> 2) Add the following line in the protocol stack of NotificationBusDemo.java in the main(),  
> "ENCRYPT(key_store_name=jgroups.keystore;store_password=storePassed;alias=mykey):" + 
>  
> 3) Add the following line in the memberJoined(..) method of NotificationBusDemo.java  
> bus.sendNotification("Member Joined");  
>  
> 4) Run 2 instances of NotificationBusDemo.java 
> 5) You'll get the following error message, 
>  
> > 3828 [WARN] ENCRYPT.up(): - exception occurred decrypting message 
> javax.crypto.BadPaddingException: Given final block not properly padded 
> at com.sun.crypto.provider.SunJCE_h.b(DashoA12275) 
> at com.sun.crypto.provider.SunJCE_h.b(DashoA12275) 
> I am running this on Windows using JGroups 2.5 CR1.  The original thread for this issue is at,
>     http://sourceforge.net/forum/forum.php?thread_id=1751571&forum_id=18795

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list