Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 11:20:53 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 11:20:53 +0400
commit4c9a11fbeb5a95c407c00bfe33f1b836078378ce (patch)
treeef905fca69c10e91b8eb1d855bd75068db799fda /core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java
parentd80f2c89d6953c0d2587e2985451b6ff44b35365 (diff)
Add checks on various lengths to make sure they aren't overflowing their
type
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java b/core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java
index 867cf97d..25febeca 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/Certificate.java
@@ -85,6 +85,7 @@ public class Certificate
throws IOException
{
Vector derEncodings = new Vector(this.certificateList.length);
+
int totalLength = 0;
for (int i = 0; i < this.certificateList.length; ++i)
{
@@ -93,6 +94,7 @@ public class Certificate
totalLength += derEncoding.length + 3;
}
+ TlsUtils.checkUint24(totalLength);
TlsUtils.writeUint24(totalLength, output);
for (int i = 0; i < derEncodings.size(); ++i)