Skip to content

Commit

Permalink
escaping exception catch
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Dec 20, 2016
1 parent a2a8347 commit f1343d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.bouncycastle.crypto.engines.ElGamalEngine;
import org.bouncycastle.crypto.params.ParametersWithRandom;
import org.bouncycastle.jcajce.provider.asymmetric.util.BaseCipherSpi;
import org.bouncycastle.jcajce.provider.util.BadBlockException;
import org.bouncycastle.jcajce.provider.util.DigestFactory;
import org.bouncycastle.jce.interfaces.ElGamalKey;
import org.bouncycastle.jce.interfaces.ElGamalPrivateKey;
Expand Down Expand Up @@ -318,6 +319,10 @@ public synchronized Throwable getCause()
}
};
}
catch (ArrayIndexOutOfBoundsException e)
{
throw new BadBlockException("unable to decrypt block", e);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ private byte[] getOutput()
{
throw new BadBlockException("unable to decrypt block", e);
}
catch (ArrayIndexOutOfBoundsException e)
{
throw new BadBlockException("unable to decrypt block", e);
}
finally
{
bOut.reset();
Expand Down

0 comments on commit f1343d6

Please sign in to comment.