Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Created Unassigned: RsaDigitalSignature.Sign isn't consistently 256 bytes [2696]

$
0
0
Given just the right pair of private key and input bytes, RsaDigitalSignature.Sign doesn't consistently return a 256-byte array. This makes it impossible to rely upon when signature validation is being performed by another environment (e.g. a Node-based service).

This is a simple repro case using the attached RSA key. The returned length will always be 255 bytes.

```
RsaKey key = ...;

using (RsaDigitalSignature rsa = new RsaDigitalSignature(m_key))
{
byte[] buf = new byte[] { 125, 18, 109, 226, 203, 174, 37, 236 };
byte[] signedBytes = rsa.Sign(buf);

if (signedBytes.Length != 256) {
Console.WriteLine("Bad signature.");
}
}
```

Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>