summary refs log tree commit diff
path: root/crypto/src/tls/MaxFragmentLength.cs
blob: d335de5c55ad3888bb91ff6a6e26ccba5b435a16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;

namespace Org.BouncyCastle.Tls
{
    public abstract class MaxFragmentLength
    {
        /*
         * RFC 3546 3.2.
         */
        public const short pow2_9 = 1;
        public const short pow2_10 = 2;
        public const short pow2_11 = 3;
        public const short pow2_12 = 4;

        public static bool IsValid(short maxFragmentLength)
        {
            return maxFragmentLength >= pow2_9 && maxFragmentLength <= pow2_12;
        }
    }
}