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

add option to load the private_key_password from a file #4938

Open
wants to merge 3 commits into
base: v3.0.x
Choose a base branch
from

Conversation

ottigeda
Copy link

No description provided.

src/main/tls.c Outdated Show resolved Hide resolved
src/main/tls.c Outdated
SSL_CTX_set_default_passwd_cb_userdata(ctx, password);
SSL_CTX_set_default_passwd_cb(ctx, cbtls_password);
}
else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random formatting is not recommended. There's a consistent set of formatting in the server, for good reason.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are perfectly right, I tried to follow the existing style but it seems I was not doing a good job, sorry :-)
I just tried to improve it a bit.
I also tried to read https://wiki.freeradius.org/contributing/coding-standards#function-naming-conventions.
If it is still not good, could you provide me where I could find the information about the formatting ?
Is there any formatting tool you might use ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See how all of the if and else are formatted in the rest of the code. i.e. } else { is much better than adding tons of whitespace.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, must have overlooked this one, I just improved on it.
Hope the formatting is now ok ?

else {
ERROR(LOG_PREFIX ": Error reading private_key_password_file %s", conf->private_key_password_file);
}
fclose(passwordfile);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will call fclose() when passwordfile is NULL. That is not recommended.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure ? There is a check if(passwordfile) and only if it is true (e.g. passwordfile is not NULL) fclose is executed.
Or what I have overlooked ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess. The random indentation and weird formatting is confusing.

@alandekok
Copy link
Member

It's not clear why this is useful? There isn't a lot of difference between the password being in a FreeRADIUS configuration file, or being in a different file on disk.

What's the use-case here? Is this security? Or simplicity, or...??

i.e. I can see that the patch does something, but it would be good to have an explanation as to why the patch is needed.

@ottigeda
Copy link
Author

I use freeradius together with stepca certificate authority. Since stepca supports password stored in files, and we already use stepca that way, this patch would remove the need to have the password stored in multiple files. For me this is more the practical point of view, not so much security.

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

Successfully merging this pull request may close these issues.

None yet

2 participants