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

MakeSalt function question #25

Open
bladewhistle opened this issue Oct 22, 2020 · 4 comments
Open

MakeSalt function question #25

bladewhistle opened this issue Oct 22, 2020 · 4 comments

Comments

@bladewhistle
Copy link

Nice license library.

But I have aquestion about the salt generation.

It seems explicitSalt and implicitSalt are all generated by MakeSalt when generation a license.

In code below:

bool MakeSalt(Salt& salt)
{
    unsigned char tmp[32] = {0};

    std::string encoded;
    EncodeBase64(tmp, 32, encoded);
    salt = encoded;
    return true;
}

the salt based64 with empty string alwayas be 'AAAAAAAAAAAAA...', which will cause all salt be same. It will not be safe for usage. Is it necessary to customize the salt value with any interface?

@dererror33
Copy link
Contributor

Of course. Use random generator.

@bladewhistle
Copy link
Author

Thanks for quick reply.

I mean the license library should provide an interface to set the salt from outside. what do you think?

@dererror33
Copy link
Contributor

"outside" where is it from?

@bladewhistle
Copy link
Author

From my debug, I mean, currently the salt can be set to License instance directly. But when try to save license, in update method of 'LicenseManager'(line 483, 484), the salt will be force set by 'MakeSalt' method(with fixed base64 value 'AAAAAAAAA...'). So developer can only change this source code to update salt.

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

2 participants