Skip to content

Commit 4fae7b4

Browse files
Fixing documentations
1 parent b800be2 commit 4fae7b4

File tree

7 files changed

+102
-532
lines changed

7 files changed

+102
-532
lines changed

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Contributing
2+
3+
Unless you explicitly state otherwise, any contribution intentionally submitted
4+
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
5+
dual licensed as above, without any additional terms or conditions.
6+
7+
## Tips
8+
When contributing to this test crate:
9+
10+
1. Maintain compatibility with ESP32 variants
11+
2. Keep memory usage optimized
12+
3. Add comprehensive logging
13+
4. Update documentation for any changes
14+
5. Test on physical hardware when possible
15+
16+
## Related Documentation
17+
18+
- [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/)
19+
- [Rust on ESP32](https://esp-rs.github.io/book/)
20+
- [rustls Documentation](https://docs.rs/rustls/)
21+
- [RustCrypto Documentation](https://docs.rs/rustcrypto/)
22+
- [RustCrypto GitHub organization](https://github.com/RustCrypto)
23+
24+
## Testing Strategy
25+
26+
### Unit Tests
27+
```bash
28+
cargo test -p rustls-real-socket-test
29+
```
30+
31+
### Integration Tests
32+
```bash
33+
cargo test --test integration
34+
```

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,6 @@ at your option.
162162

163163
Some code authored by [@ctz](https://github.com/ctz) was adapted from upstream rustls. Licensed as above with permission.
164164

165-
### Contribution
166-
167-
Unless you explicitly state otherwise, any contribution intentionally submitted
168-
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
169-
dual licensed as above, without any additional terms or conditions.
170-
171165
[//]: # "badges"
172166
[crate-image]: https://img.shields.io/crates/v/rustls-rustcrypto
173167
[crate-link]: https://crates.io/crates/rustls-rustcrypto
@@ -181,4 +175,4 @@ dual licensed as above, without any additional terms or conditions.
181175
[chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/434751-TLS
182176
[//]: # "links"
183177
[RustCrypto]: https://github.com/RustCrypto/
184-
[rustls]: https://github.com/rustls/rustls/
178+
[rustls]: https://github.com/rustls/rustls/

SECURITY.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### Certificates
2+
3+
The two tests (real socket test and ESP32 test) uses embedded certificates (for now):
4+
- **Server Certificate**: `cert.der` - ECDSA P-256 certificate
5+
- **Private Key**: `key.der` - PKCS#8 encoded private key
6+
- **Certificate Verification**: Custom verifier (accepts all for testing)
7+
8+
### Security Notes
9+
10+
⚠️ **WARNING**: The tests uses a dummy certificate verifier that accepts all certificates. This is for testing purposes only and should NEVER be used in production code.
11+
12+
## Performance Considerations for embedded
13+
14+
### Memory Usage
15+
- Optimized for ESP32's limited RAM
16+
- Uses static allocations where possible
17+
- Minimal heap allocation during runtime
18+
19+
### CPU Usage
20+
- ECC operations are computationally intensive
21+
- Consider using hardware acceleration if available
22+
- Profile with ESP-IDF tools for optimization

TROUBLESHOOTING.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## Troubleshooting (for ESP32 integration test)
2+
3+
### Common Issues
4+
5+
#### Build Failures
6+
- Ensure ESP-IDF is properly installed and sourced
7+
- Check Rust toolchain version compatibility
8+
- Verify target architecture matches your ESP32 variant
9+
10+
#### Flashing Issues
11+
- Check USB port permissions
12+
- Ensure no other processes are using the serial port
13+
- Try different USB cables or ports
14+
15+
#### Runtime Errors
16+
- Verify network connectivity if using WiFi
17+
- Check ESP32 power supply stability
18+
- Monitor serial output for detailed error messages
19+
20+
#### TLS Handshake Failures
21+
- Ensure certificates are properly embedded
22+
- Check cipher suite compatibility
23+
- Verify TLS version support
24+
25+
### Debugging
26+
27+
Enable detailed logging:
28+
```bash
29+
# Set log level
30+
espmonitor /dev/ttyUSB0 -e "RUST_LOG=trace"
31+
```
32+
33+
Common debug commands:
34+
```bash
35+
# Check ESP32 connection
36+
ls /dev/ttyUSB*
37+
38+
# Monitor with specific baud rate
39+
espmonitor /dev/ttyUSB0 --baud 115200
40+
41+
# Flash with verbose output
42+
cargo espflash flash --release --verbose
43+
```

validation/README.md

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -135,32 +135,6 @@ cargo run -p esp32-test
135135
- OpenSSL development libraries
136136
- Custom certificate generation tools
137137

138-
## Configuration
139-
140-
### Feature Flags
141-
142-
Most crates support various feature flags to customize the build:
143-
144-
```toml
145-
[dependencies.rustls-rustcrypto]
146-
version = "0.0.2-alpha"
147-
path = "../.."
148-
default-features = false
149-
features = [
150-
"aead-chacha20poly1305",
151-
"alloc",
152-
"der",
153-
"ecdsa-p256",
154-
"fast",
155-
"kx-p256",
156-
"pkcs8",
157-
"sign-ecdsa-p256",
158-
"tls12",
159-
"verify-ecdsa-p256",
160-
"verify-ecdsa-p256-sha256"
161-
]
162-
```
163-
164138
### Environment Variables
165139

166140
- `RUST_LOG`: Set logging level (e.g., `RUST_LOG=trace`)
@@ -176,54 +150,6 @@ These validation crates are designed with the following principles:
176150
4. **Cross-Platform**: Support multiple target architectures
177151
5. **Extensibility**: Easy to add new test scenarios
178152

179-
## Troubleshooting
180-
181-
### Common Issues
182-
183-
#### ESP32 Build Failures
184-
- Ensure ESP-IDF is properly installed and configured
185-
- Check that the correct Rust toolchain is selected
186-
- Verify ESP32 hardware connections if running on device
187-
188-
#### OpenSSL Compatibility Issues
189-
- Ensure OpenSSL development libraries are installed
190-
- Check certificate generation scripts in `certs/` directory
191-
- Verify OpenSSL version compatibility
192-
193-
#### no_std Compilation Errors
194-
- Use `--no-default-features` flag
195-
- Ensure all dependencies support no_std
196-
- Check for std-specific code in dependencies
197-
198-
#### Network Socket Issues
199-
- Ensure no firewall blocking local connections
200-
- Check that ports are available (tests use random ports)
201-
- Verify network interface configuration
202-
203-
### Debugging
204-
205-
Enable detailed logging:
206-
207-
```bash
208-
RUST_LOG=trace cargo run -p <crate_name>
209-
```
210-
211-
For ESP32, use ESP-IDF logging facilities.
212-
213-
## Contributing
214-
215-
When adding new validation crates:
216-
217-
1. Create a new directory under `validation/`
218-
2. Add a dedicated `Cargo.toml` with minimal dependencies
219-
3. Include a `README.md` with crate-specific documentation
220-
4. Update this main README.md
221-
5. Add appropriate CI/CD configuration if needed
222-
223-
## License
224-
225-
These validation crates follow the same license as the main rustls-rustcrypto project: Apache-2.0 or MIT.
226-
227153
---
228154

229155
These live in the workspace due to different dependency requirements between tests where development-deps may pollute the integration under test.

0 commit comments

Comments
 (0)