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 08:55:11 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-06-22 08:55:11 +0400
commitb1eaafbe96dd53b791d2b10204bd772f408f1835 (patch)
tree0e7879b72e634dd58419102005cf74234fe944bb /core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java
parent91dbc4003bc6504d407b9a225872e4ac0ba5bf98 (diff)
Add check that server status_request extension_data is empty (RFC 3546)
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java
index e27580c1..350c6c2b 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSProtocol.java
@@ -49,6 +49,21 @@ public abstract class DTLSProtocol
return maxFragmentLength;
}
+ protected static boolean evaluateStatusRequestExtension(Hashtable serverExtensions, short alertDescription)
+ throws IOException
+ {
+ byte[] statusRequest = TlsUtils.getExtensionData(serverExtensions, TlsExtensionsUtils.EXT_status_request);
+ if (statusRequest == null)
+ {
+ return false;
+ }
+ if (statusRequest.length != 0)
+ {
+ throw new TlsFatalAlert(alertDescription);
+ }
+ return true;
+ }
+
protected static byte[] generateCertificate(Certificate certificate)
throws IOException
{