Skip to content

Commit a752ea9

Browse files
committed
v0.2 - Bug fixes, refactoring, and /e2e command improvements
Major Changes: - Fixed string concatenation bug in logging (line 126) - Fixed malformed JSON in channel key generation (line 697) - Simplified channel detection logic with e2e_resolve_chan helper - Implemented missing auto-save functionality - Added comprehensive error logging for all DLL calls New Features: - /e2e <msg> - Context-aware encrypted send command - /e2e help - Display all available commands in-client - Helpful error messages with instructions for missing keys Code Quality: - Added e2e_resolve_chan and e2e_maybe_autosave helpers - Reduced code duplication by ~60 lines - 100% DLL error handling coverage - Auto-save now enabled by default Documentation: - Updated README.md with /e2e command usage - Added complete command reference to header - All 20+ commands now documented Security: - /e2e never sends plaintext (fail-secure) - All encryption failures are logged - Auto-save triggers on key modifications Build System: - Added GitHub Actions CI/CD workflow - Win32 platform support for mIRC compatibility - Automated build artifacts - Community standards (CONTRIBUTING.md, CODE_OF_CONDUCT.md, PR template) libsodium Integration: - Included all static libraries (v142, v143 toolsets) - Win32 and x64 Debug/Release configurations - Fixed PostBuildEvent for CI compatibility
0 parents  commit a752ea9

111 files changed

Lines changed: 9133 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.github/CODE_OF_CONDUCT.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We are committed to providing a friendly, safe, and welcoming environment for all contributors, regardless of experience level, gender identity, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
## Our Standards
8+
9+
**Positive behavior includes:**
10+
- Being respectful and considerate
11+
- Welcoming newcomers and helping them learn
12+
- Accepting constructive criticism gracefully
13+
- Focusing on what's best for the project
14+
- Showing empathy towards others
15+
16+
**Unacceptable behavior includes:**
17+
- Harassment, trolling, or insulting comments
18+
- Personal or political attacks
19+
- Publishing others' private information without permission
20+
- Any conduct that could reasonably be considered inappropriate
21+
22+
## Responsibilities
23+
24+
Project maintainers are responsible for clarifying standards of acceptable behavior and will take appropriate action in response to unacceptable behavior.
25+
26+
## Scope
27+
28+
This Code of Conduct applies to all project spaces, including:
29+
- GitHub repository (issues, PRs, discussions)
30+
- Project communication channels
31+
- Events or meetups related to the project
32+
33+
## Enforcement
34+
35+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting project maintainers. All complaints will be reviewed and investigated.
36+
37+
Project maintainers have the right to remove, edit, or reject comments, commits, code, issues, and other contributions that violate this Code of Conduct.
38+
39+
## Attribution
40+
41+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.

.github/CONTRIBUTING.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Contributing to e2e.dll
2+
3+
Thank you for your interest in contributing to e2e.dll! This document provides guidelines for contributing to the project.
4+
5+
## How to Contribute
6+
7+
### Reporting Bugs
8+
9+
If you find a bug, please create an issue with:
10+
- A clear, descriptive title
11+
- Steps to reproduce the problem
12+
- Expected vs actual behavior
13+
- Your mIRC version and Windows version
14+
- Any relevant log files from `e2e.logs`
15+
16+
### Suggesting Features
17+
18+
Feature suggestions are welcome! Please:
19+
- Check if the feature has already been suggested
20+
- Provide a clear use case
21+
- Explain how it would benefit users
22+
- Consider security implications
23+
24+
### Pull Requests
25+
26+
1. **Fork the repository**
27+
2. **Create a feature branch**: `git checkout -b feature/your-feature-name`
28+
3. **Make your changes**:
29+
- Follow existing code style
30+
- Add comments for complex logic
31+
- Test thoroughly in mIRC
32+
4. **Commit your changes**: Use clear, descriptive commit messages
33+
5. **Push to your fork**: `git push origin feature/your-feature-name`
34+
6. **Open a Pull Request**
35+
36+
### Code Guidelines
37+
38+
#### C Code (`e2e.c`, `e2e_keyex.c`)
39+
- Use consistent indentation (tabs or 4 spaces)
40+
- Check all DLL function return values for errors
41+
- Use `ERROR:` prefix for error returns
42+
- Add error logging for debugging
43+
- Keep functions focused and modular
44+
45+
#### mIRC Script (`e2e.mrc`)
46+
- Use meaningful variable names (`%net`, `%chan`, `%nick`)
47+
- Add logging for important operations (`e2e_log`)
48+
- Check for null/empty parameters
49+
- Use helper functions to avoid code duplication
50+
- Test in both channel and query contexts
51+
52+
### Security
53+
54+
- **Never commit keys or credentials**
55+
- Report security vulnerabilities privately
56+
- Use libsodium functions correctly
57+
- Validate all user input
58+
- Handle errors securely (fail-secure, not fail-open)
59+
60+
### Testing
61+
62+
Before submitting a PR, test:
63+
- ✅ DM key exchange (offer, accept, reject)
64+
- ✅ Channel key generation and sharing
65+
- ✅ Encrypted message sending/receiving
66+
- ✅ Auto-encrypt functionality
67+
- ✅ Key persistence (DPAPI and password modes)
68+
- ✅ Error handling (missing keys, invalid data)
69+
- ✅ Menu actions work correctly
70+
71+
### Build Requirements
72+
73+
- Visual Studio 2022 or later (v143 toolset)
74+
- libsodium 1.0.20 (included in repo)
75+
- Win32 (32-bit) target platform
76+
77+
Build command:
78+
```cmd
79+
MSBuild e2e.vcxproj /p:Configuration=Release /p:Platform=Win32
80+
```
81+
82+
### Documentation
83+
84+
When adding features:
85+
- Update `README.md` with usage examples
86+
- Update command list in `e2e.mrc` header
87+
- Update `/e2e help` output if needed
88+
89+
## Code of Conduct
90+
91+
Be respectful and constructive. We're all here to improve mIRC security together.
92+
93+
## Questions?
94+
95+
If you have questions about contributing, feel free to open an issue with the `question` label.
96+
97+
## License
98+
99+
By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE.txt).

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Description
2+
3+
<!-- Provide a clear description of what this PR does -->
4+
5+
## Type of Change
6+
7+
<!-- Mark the relevant option with an [x] -->
8+
9+
- [ ] Bug fix (non-breaking change that fixes an issue)
10+
- [ ] New feature (non-breaking change that adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
12+
- [ ] Documentation update
13+
- [ ] Code refactoring
14+
15+
## Related Issue
16+
17+
<!-- If this PR addresses an issue, link it here -->
18+
Fixes #(issue number)
19+
20+
## Changes Made
21+
22+
<!-- List the specific changes made in this PR -->
23+
24+
-
25+
-
26+
-
27+
28+
## Testing
29+
30+
<!-- Describe how you tested these changes -->
31+
32+
**Tested on:**
33+
- mIRC version:
34+
- Windows version:
35+
- Build configuration:
36+
37+
**Test scenarios:**
38+
- [ ] DM key exchange
39+
- [ ] Channel encryption
40+
- [ ] Auto-encrypt functionality
41+
- [ ] Error handling
42+
- [ ] Menu actions
43+
- [ ] Other (specify):
44+
45+
## Screenshots
46+
47+
<!-- If applicable, add screenshots to demonstrate changes -->
48+
49+
## Checklist
50+
51+
- [ ] My code follows the project's code style
52+
- [ ] I have tested my changes thoroughly
53+
- [ ] I have updated documentation (if needed)
54+
- [ ] I have added error logging for new DLL functions
55+
- [ ] I have checked for security implications
56+
- [ ] My changes generate no new warnings
57+
- [ ] I have tested in both Debug and Release builds
58+
59+
## Additional Notes
60+
61+
<!-- Any additional information or context -->

.github/workflows/msbuild.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: MSBuild
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
env:
10+
PROJECT_FILE_PATH: e2e.vcxproj
11+
BUILD_CONFIGURATION: Release
12+
BUILD_PLATFORM: Win32
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build:
19+
runs-on: windows-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Add MSBuild to PATH
26+
uses: microsoft/setup-msbuild@v2
27+
28+
- name: Build
29+
working-directory: ${{env.GITHUB_WORKSPACE}}
30+
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} /p:PlatformToolset=v143 ${{env.PROJECT_FILE_PATH}}
31+
32+
- name: Upload build artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: e2e-dll-win32
36+
path: |
37+
Release/e2e.dll
38+
e2e.mrc
39+
README.md
40+
LICENSE.txt

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Visual Studio cache/build folders
2+
.vs/
3+
.claude/
4+
Debug/
5+
Release/
6+
x64/
7+
Win32/
8+
*.user
9+
*.suo
10+
*.sdf
11+
*.opensdf
12+
*.db
13+
*.opendb
14+
*.ipch
15+
16+
# Build outputs
17+
*.dll
18+
*.lib
19+
*.exp
20+
*.obj
21+
*.pdb
22+
*.ilk
23+
*.iobj
24+
*.ipdb
25+
*.idb
26+
*.log
27+
*.tlog
28+
29+
# Exception: Keep libsodium static libraries
30+
!libsodium/**/*.lib
31+
32+
# Temporary files
33+
*.tmp
34+
*.bak
35+
*.swp
36+
*~
37+
38+
# Development documentation (local only)
39+
AGENTS.md
40+
AGENTS.md.local
41+
42+
# Keep libsodium
43+
!libsodium/
44+
45+
# Keep launch.vs.json for debugging
46+
!.vs/launch.vs.json

0 commit comments

Comments
 (0)