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

vivek v (JIRA) jira-events at lists.jboss.org
Fri Jul 6 21:54:03 EDT 2007


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

I checked out the latest JGroups from CVS,

 cvs -z3 -d:pserver:anonymous at javagroups.cvs.sourceforge.net:/cvsroot/javagroups co -P JGroups

and re-ran the NotificationBusDemo (with Encrption enabled). Now whenever I start an instance of NotificationBusDemo class I get "ChannelNotConnectedException" error message. I don't get this error with the same test on CR1 code base.  Attached is the updated NotificationBusDemo class (note I've modified the memberJoined method to send out notification as that's required by my application).

 Here is the output on the console, 

 Starting NotificationBus with name BusDemo
0 [INFO] JChannel: - JGroups version: 2.5.0
187 [INFO] ENCRYPT: - key_store_name used is defaultStore.keystore
187 [INFO] ENCRYPT: - store_password used is not null
187 [INFO] ENCRYPT: - key_password used is same as store_password
187 [INFO] ENCRYPT: - alias used is myKey
203 [WARN] FRAG: - down_thread was deprecated and is ignored
203 [WARN] FRAG: - up_thread was deprecated and is ignored
515 [INFO] ENCRYPT: -  Initializing symmetric ciphers
562 [INFO] ENCRYPT: -  Initialized symmetric ciphers with secret key (16 bytes) 655336553355165533110655336365533655332765533716553310865533

-------------------------------------------------------
GMS: address is 172.16.2.4:4707
-------------------------------------------------------
** Member joined: 172.16.2.4:4707
2625 [ERROR] NotificationBus: - error sending notification
ChannelNotConnectedException
	at org.jgroups.JChannel.checkClosedOrNotConnected(JChannel.java:1316)
	at org.jgroups.JChannel.send(JChannel.java:572)
	at org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java:158)
	at org.jgroups.blocks.NotificationBus.sendNotification(NotificationBus.java:140)
	at org.jgroups.demos.NotificationBusDemo.memberJoined(NotificationBusDemo.java:92)
	at org.jgroups.blocks.NotificationBus.viewAccepted(NotificationBus.java:340)
	at org.jgroups.JChannel.up(JChannel.java:1080)
	at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:325)
	at org.jgroups.protocols.pbcast.GMS.installView(GMS.java:505)
	at org.jgroups.protocols.pbcast.GMS.installView(GMS.java:415)
	at org.jgroups.protocols.pbcast.ClientGmsImpl.becomeSingletonMember(ClientGmsImpl.java:384)
	at org.jgroups.protocols.pbcast.ClientGmsImpl.join(ClientGmsImpl.java:78)
	at org.jgroups.protocols.pbcast.GMS.down(GMS.java:759)
	at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:334)
	at org.jgroups.JChannel.downcall(JChannel.java:1240)
	at org.jgroups.JChannel.connect(JChannel.java:399)
	at org.jgroups.blocks.NotificationBus.start(NotificationBus.java:126)
	at org.jgroups.demos.NotificationBusDemo.start(NotificationBusDemo.java:40)
	at org.jgroups.demos.NotificationBusDemo.main(NotificationBusDemo.java:135)
2640 [INFO] ENCRYPT: - handling view: [172.16.2.4:4707|0] [172.16.2.4:4707]
> 

> 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