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: Warn players that company passwords are not truly secure #7351

Merged
merged 4 commits into from Apr 24, 2019

Conversation

nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Mar 9, 2019

Add a warning text to password entry windows, to remind players that the protocol is not truly secure.

image

Currently has an issue with sizing/spacing in the more generic text entry window, without the "Default password" button:
image

@nielsmh nielsmh force-pushed the password-warning branch 2 times, most recently from e3d4271 to 072342c Compare March 11, 2019 17:22
@nielsmh
Copy link
Contributor Author

nielsmh commented Mar 11, 2019

Fixed the window sizing issue of the second case. It's not perfect (the string needs to have manual line breaks and it might not behave well with large text sizes) but the window sizing system is not good to work with.

image

Also, the warning shows when setting the password for a server, which is silly. ("You, the server owner, may be able to see what you enter here!") Is it worth bothering to not show it in this case?

@nielsmh nielsmh marked this pull request as ready for review March 11, 2019 17:26
src/misc_gui.cpp Outdated Show resolved Hide resolved
@michicc
Copy link
Member

michicc commented Mar 24, 2019

Is it worth bothering to not show it in this case?

Unless it is super complicated I'd say yes. Security warnings that are made too often just lead to people ignoring them every time.

@nielsmh
Copy link
Contributor Author

nielsmh commented Mar 31, 2019

No warning:
image

Warning, automatically line broken:
image
image
image

assert(this->nested_root->smallest_x > 0);
this->warning_size.width = this->nested_root->current_x - (WD_FRAMETEXT_LEFT + WD_FRAMETEXT_RIGHT + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT);
this->warning_size.height = GetStringHeight(STR_WARNING_PASSWORD_SECURITY, this->warning_size.width);
this->warning_size.height += WD_FRAMETEXT_TOP + WD_FRAMETEXT_BOTTOM + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
Copy link
Member

Choose a reason for hiding this comment

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

Is it useful if we put this "algorithm" in a function? You now use it at two places, but if I understand it correctly, it can also be useful for other places where we want this kind of behaviour? (honest question btw, no is a valid answer :D)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the best would be to add a flag to label controls or similar, that they have height dependent on width (and width is not measured for the widget), which then causes them to wrap and size after the main size calculations are done.

@nielsmh nielsmh merged commit dd35a43 into OpenTTD:master Apr 24, 2019
@nielsmh nielsmh deleted the password-warning branch April 24, 2019 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants