neosmart / SecureStore

A .NET implementation of the cross-platform SecureStore (symmetrically-encrypted secrets) protocol
MIT License
96 stars 15 forks source link

special char results in Index and count must refer to a location within the string #11

Closed OneCyrus closed 1 year ago

OneCyrus commented 1 year ago

using special chars in the string result in the following error. e.g. @lt€r when setting through the client

Test method Tests.FunctionalityTests.StoreAndLoad threw exception: 
System.ArgumentOutOfRangeException: Index and count must refer to a location within the string. (Parameter 's')
OneCyrus commented 1 year ago

I added a PR with the reproduction here: https://github.com/neosmart/SecureStore/pull/12

not sure what is the best way to resolve this.

mqudsi commented 1 year ago

Do you have the full stack trace? I wonder if it’s not so much a special character so much as an invalid one..

mqudsi commented 1 year ago

Fixed in 249a532b41e97dc506a73665b3f2c5e50a6e6960.

Thanks for finding this. I was passing the byte length to a parameter that expected the character count. I'll push a release to nuget soon, but you can build from master in the meantime.

OneCyrus commented 1 year ago

perfect. thank you!