keenlabs / keen-sdk-net

A .NET SDK for the Keen IO API
MIT License
37 stars 24 forks source link

Fix Scoped Keys Padding #54

Closed masojus closed 7 years ago

masojus commented 7 years ago

Fix Issue #53 Fix Issue #34

Switch to built-in padding instead of manual padding for the plaintext.

See commit comments for more details.

masojus commented 7 years ago

I wrote tests that exercised this code against the real back end, but those can't execute as unit tests, of course. The problem is the existing unit tests check symmetry but don't prove that the back end will accept those keys. The existing tests also already test secOptions with length that isn't a multiple of the key size or block size. I could add an assert that the input string exactly equals the decrypted string in one or a few of those tests just to make sure the decrypted string doesn't have padding, such as in Roundtrip_RndIV_Success, which should suffice to prove this case is being checked for, right @hex337?

hex337 commented 7 years ago

That would be great :)