Limitation of SecureString

I’ve noticed issues with SecureString when the string or password exceeds 16 characters. It works fine as long as the application remains open, but upon restarting, I only retrieve the first 16 characters instead of the full string.

Example:
Set Passwort: “12345678901234567890”
Passwort after restart: “1234567890123456”

This limitation affects Instruments and ComponentsSettings. I assume it impacts TestSteps in the same way.

It likely happens during XML serialization?!

Could this limitation please be removed?

1 Like

Hi @fauser,

Thanks for raising the issue.

This is a bug and not the intended behavior.

I have opened an issue here: SecureString capped to 16 bytes max size · Issue #2425 · opentap/opentap · GitHub, expecting the fix included in 9.35.

Thanks for the information .

I also tried submitting a pull request for this issue.

Hi @fauser,

Yes, we realized that after we had already fixed the issue after reproducing it. Sorry about that.

Idealy we’d accept your fix, but you’d have to sign a CLA first. Please check opentap/CONTRIBUTING.md at main · opentap/opentap · GitHub for details.