Comments (5)
@BigBoneDaddy I have to admit, that I wouldn't generate such a big key again. But one of my servers has such a key (was just starting with SSL and I thought a larger-than-default key couldn't harm anyone) and I don't want to pay for a new certificate. So yes, in my case it was an accident cause by not knowing better.
I always dislike static buffers like these, since I ran into hard-to-debug problems on Apple-platforms (which won't even give you a meaningful error message, so I debugged this some days ...). I think a #define would be good, and a default of 4096bit is fine. Just give the users a way to simply change it.
I didn't mean to dynamically configure it, but to determine the size of the key from the actual key data:
Something else: I may had a brainfart. The source-line I linked to in the first comment isn't used to store the key, right? m(
from s2n-tls.
unsigned char intermediate[4096];
Correct me if I'm wrong but a char is 1 Byte. There are 8 Bits in 1 Byte so this buffer is 4096*8. Which is 32768 Bit. Meaning this supports 32768 Bit keys which is much larger than 4096 and 8192 Bit keys.
if (s2n_rsa_private_encrypted_size(key) > sizeof(intermediate)) {
s2n_rsa_private_encrypted_size() just calls RSA_size() which is documented to return the modulus size in Bytes not Bits ... so the check is right.
Could the author have been trying to limit to 4096 Bit key maximum? I hope not.
Also, this buffer really should be malloc'd (and configurable) because using large stack buffers like that could lead to other problems on embedded systems.
from s2n-tls.
I had a lot of brainfarts when I wrote this ticket ... I would suggest to just close it and forget about it ... anyone against it?
from s2n-tls.
It would be nice to not have such a large stack buffer. It would also be
nice to determine if the intention was to limit to 4096 bit keys.
On Wednesday, July 1, 2015, Moritz Grosch (LittleFox) <
[email protected]> wrote:
I had a lot of brainfarts when I wrote this ticket ... I would suggest to
just close it and forget about it ... anyone against it?—
Reply to this email directly or view it on GitHub
#105 (comment).
from s2n-tls.
Closing. 4096 bytes allows up to 32768 bit RSA Keys. We may be wasting some memory, but we still allow very large size keys.
from s2n-tls.
Related Issues (20)
- odd cleanup behavior under valgrind HOT 3
- Run unit tests with urandom in CI HOT 2
- Test disabling feature flags in CI
- Clarify `S2N_ERR_T_BLOCKED` for blocking sockets
- Integ test bloat
- Make S2N_CERT_AUTH_OPTIONAL the default for clients
- Support loading DER-encoded certificates and private keys
- consider adding a default negotiate timeout
- enforce result checking for s2n_stuffer methods
- Unpin dependencies after bumping MSRV beyond 1.70
- add visible debugging information for CI runs
- old libfuzzer used in CI
- old cppcheck used in CI
- Add schannel to integration tests HOT 1
- docs: Rust bindings need an explanation for Send/Sync impls HOT 1
- Add rustls to integration tests HOT 3
- test: SSLv2 integ test
- s2n_tls13_cert_verify_test doesn't run all cases HOT 1
- certificate_signature_preferences field contains unnecessary information HOT 2
- UBSAN triggers on `is_available` getting passed an incorrect function type HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s2n-tls.