示例#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");
 }
        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");
        }
示例#4
0
 public void GuessKeyBitLength_throws_on_invalid_values(int bits)
 {
     Exceptions.AssertThrowsUnsupportedFeature(
         () => RsaKey.GuessKeyBitLength(new RSAParameters()
     {
         Modulus = new byte[bits / 8]
     }),
         "not supported");
 }
        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");
        }
        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");
        }
 public void PasswordToBytes_throws_on_non_ascii_password()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Parse.PasswordToBytes("\x80\x90\xA0"),
                                               "Non ASCII passwords");
 }
 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");
 }
 public void Parse_throws_unencrypted_content()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => ParsePad("onefile1" + "\x05"), "Unencrypted");
 }
 public void DataCenterToTld_throws_on_unknown_data_center()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Client.DataCenterToTld("zx"),
                                               "Unsupported data center");
 }
示例#12
0
 public void Pbes2_throws_on_unsupported_method()
 {
     Exceptions.AssertThrowsUnsupportedFeature(() => Util.Pbes2("Unknown", "password", "salt".ToBytes(), 100),
                                               "Method 'Unknown' is not supported");
 }