Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature validation fails when re-read data from disk #107

Open
Menooker opened this issue Jul 17, 2015 · 1 comment
Open

Signature validation fails when re-read data from disk #107

Menooker opened this issue Jul 17, 2015 · 1 comment

Comments

@Menooker
Copy link

I put some data in DHT (disk storage based) by
new Data(obj).protectEntryNow(key,factory).sign(key.getPrivate())

obj is a large object with the size of about 20k.
Then I got the data immediately after putting it and every thing went well.

But when I closed the peer and restarted the whole DHT and tried to read the value 'obj' I put before, an exception is raised when calling data.verify():
java.security.SignatureException: invalid signature: out of range values
at sun.security.provider.DSA.engineVerify(Unknown Source)
at sun.security.provider.DSA.engineVerify(Unknown Source)
at java.security.Signature$Delegate.engineVerify(Unknown Source)
at java.security.Signature.verify(Unknown Source)
at net.tomp2p.connection.DSASignatureFactory.verify(DSASignatureFactory.java:133)
at net.tomp2p.storage.Data.verify(Data.java:376)

And I find that small objects are okay but this problem emerges when the object stored is large. (>20k)

@Menooker
Copy link
Author

Since the problem only occurs when the signed data is read from the disk, there may be something wrong with the file related codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant