Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Licensed to' names are cut in length by 1 byte #1

Open
dchest opened this issue Aug 6, 2011 · 1 comment
Open

'Licensed to' names are cut in length by 1 byte #1

dchest opened this issue Aug 6, 2011 · 1 comment
Assignees

Comments

@dchest
Copy link
Owner

dchest commented Aug 6, 2011

Currently EllipticLicense generates signatures for message - 1 byte, that is, if given 'John Doe' it will generate key for 'John Do'.
If fixed, it will render the generated keys incompatible with previous versions.

Possibly, will introduce a flag for this.

The bug is in:

SHA1((unsigned char *)name, strlen(name)-1, hash);

Must be:

SHA1((unsigned char *)name, strlen(name), hash);

This would also fix inability to generate keys for names of only 1 byte.

@ghost ghost assigned dchest Aug 6, 2011
@dchest
Copy link
Owner Author

dchest commented Aug 17, 2011

Note to self: also fix + (NSData *)el_dataWithStringNoNull:(NSString *)string;, etc.

vslavik added a commit to vslavik/ellipticlicense that referenced this issue Nov 24, 2013
Original code omitted the last character thanks to misuse of strlen().
Notice that fixing this breaks compatibility with keys generated by the
original code.

See issue dchest#1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant