Exemplo n.º 1
0
        internal void RequestLoginType_throws_on_unknown_login_type()
        {
            var rest = new RestFlow().Post("{'exists': 'blah'}");

            Exceptions.AssertThrowsUnsupportedFeature(() => Remote.RequestLoginType(Username, rest),
                                                      "'blah' is not supported");
        }
 public void ApproveOob_throws_on_unknown_method()
 {
     Exceptions.AssertThrowsUnsupportedFeature(
         () => Client.ApproveOob(Username, new Dictionary <string, string> {
         ["outofbandtype"] = "blah"
     }, null, null),
         "Out of band method 'blah' is not supported");
 }
Exemplo n.º 3
0
        public void RequestKdfIterationCount_throws_on_unsupported_kdf_method()
        {
            var rest = new RestFlow()
                       .Post("{'Kdf': 13, 'KdfIterations': 1337}")
                       .ToRestClient();

            Exceptions.AssertThrowsUnsupportedFeature(() => Client.RequestKdfIterationCount(Username, rest), "KDF");
        }
Exemplo n.º 4
0
 public void GuessKeyBitLength_throws_on_invalid_values(int bits)
 {
     Exceptions.AssertThrowsUnsupportedFeature(
         () => RsaKey.GuessKeyBitLength(new RSAParameters()
     {
         Modulus = new byte[bits / 8]
     }),
         "not supported");
 }
Exemplo n.º 5
0
        public void Login_throws_when_no_supported_second_factor_methods_are_available()
        {
            var rest = new RestFlow()
                       .Post(GetFixture("login-mfa-unsupported-only"), System.Net.HttpStatusCode.BadRequest)
                       .ToRestClient();

            Exceptions.AssertThrowsUnsupportedFeature(
                () => Client.Login(Username, PasswordHash, DeviceId, null, SetupSecureStorage(null), rest),
                "not supported");
        }
Exemplo n.º 6
0
        public void ParseEncryptedBlob_throws_on_kwc5_blob()
        {
            var blob = Iv16
                       .Concat("16 bytes padding".ToBytes())
                       .Concat("KWC5".ToBytes())
                       .Concat(Hash32)
                       .Concat(Content)
                       .ToArray();

            Exceptions.AssertThrowsUnsupportedFeature(() => Parse.ParseEncryptedBlob(blob), "KWC5");
        }
Exemplo n.º 7
0
 public void PasswordToBytes_throws_on_non_ascii_password()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Parse.PasswordToBytes("\x80\x90\xA0"),
                                               "Non ASCII passwords");
 }
Exemplo n.º 8
0
 public void DecryptBlob_throws_on_non_ascii_password()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Parse.DecryptBlob(Blob, "\x80\x90\xA0"),
                                               "Non ASCII passwords");
 }
 public void Decrypt_throws_on_unsupported_sha1_kdf()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => DecryptPad("gsencst1\x00" + "\x01"), "SHA-1");
 }
Exemplo n.º 10
0
 public void Parse_throws_unencrypted_content()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => ParsePad("onefile1" + "\x05"), "Unencrypted");
 }
Exemplo n.º 11
0
 public void DataCenterToTld_throws_on_unknown_data_center()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Client.DataCenterToTld("zx"),
                                               "Unsupported data center");
 }
Exemplo n.º 12
0
 public void Pbes2_throws_on_unsupported_method()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Util.Pbes2("Unknown", "password", "salt".ToBytes(), 100),
                                               "Method 'Unknown' is not supported");
 }