Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Frontend EV Certificate Changes #11776

Merged
merged 4 commits into from
Jan 22, 2018
Merged

Conversation

sashaperigo
Copy link
Contributor

@sashaperigo sashaperigo commented Nov 3, 2017

Require: brave/muon#377
Fixes #791

Work in progress PR for the frontend EV certificate changes. Still needs lots of work on the CSS end!

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.

Test Plan:
Updated relevant unit tests.

  1. Go to github.com
  2. There should be GitHub, Inc. [US] displayed in URL bar
    (organization name + country code)
    kapture 2017-11-01 at 11 54 28 1

Reviewer Checklist:

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@luixxiul
Copy link
Contributor

luixxiul commented Nov 20, 2017

@sashaperigo do you need any assistance? 😄 Maybe I could help working on CSS/LESS.

@darkdh
Copy link
Member

darkdh commented Nov 21, 2017

@luixxiul , @cezaraugusto
feel free to push CSS changes to this PR. This is the current look
screen shot 2017-11-21 at 2 49 38 pm
screen shot 2017-11-21 at 2 49 22 pm

@darkdh
Copy link
Member

darkdh commented Nov 21, 2017

Changes made according to muon change brave/muon@6c7c9ae
ready for review

if (e.securityInfo.securityLevel === 'ev-secure') {
if (e.securityInfo.certificate &&
e.securityInfo.certificate.organizationNames.length &&
e.securityInfo.certificate.countryName) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we shouldn't require countryName, since it's not a required field in EV certs according to https://cabforum.org/ev-certificate-contents/.

Copy link
Member

Choose a reason for hiding this comment

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

addressed in 130d7ef

@@ -682,15 +683,27 @@ class Frame extends React.Component {
isSecure = false
const parsedUrl = urlParse(this.props.location)
ipc.send(messages.CHECK_CERT_ERROR_ACCEPTED, parsedUrl.host, this.props.tabId)
} else if (['warning', 'passive-mixed-content'].includes(e.securityState)) {
} else if (e.securityState === 'warning' ||
Copy link
Member

Copy link
Member

Choose a reason for hiding this comment

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

addressed in 130d7ef

@@ -624,6 +625,10 @@ const doAction = (action) => {
windowState = windowState.setIn(path.concat(['security', 'runInsecureContent']),
action.securityState.runInsecureContent)
}
if (action.securityState.evCert !== undefined) {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

nvm, i guess this has to check for undefined so null can be used to clear previous values

@diracdeltas
Copy link
Member

my muon build process isn't working but the changes lgtm

diracdeltas
diracdeltas previously approved these changes Dec 5, 2017
cezaraugusto
cezaraugusto previously approved these changes Dec 19, 2017
Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

I'm ok with front-end changes in here and if there's a need for improvement that can be done in a follow-up. lgtm

@darkdh
Copy link
Member

darkdh commented Dec 19, 2017

muon PR has been merged and will be available in 4.6.1

@@ -863,9 +864,9 @@
align-items: center;
justify-content: center;
height: @urlbarFormHeight;
width: @urlbarFormHeight;
// width: @urlbarFormHeight;
Copy link
Contributor

Choose a reason for hiding this comment

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

if the width is not required, can we remove it instead of commenting it out?

Copy link
Contributor

Choose a reason for hiding this comment

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

// Passive mixed content should not upgrade an insecure connection to a
// partially-secure connection. It can only downgrade a secure
// connection.
isSecure = this.props.isSecure !== false ? 1 : false
isSecure = 1
Copy link
Member

Choose a reason for hiding this comment

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

this code will actually never be reached because securityState is insecure when e.securityInfo.mixedContentStatus === 'content-status-displayed'. this is also an issue in 0.20.x - see #12742. i am fixing it

Copy link
Member

Choose a reason for hiding this comment

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

jumde
jumde previously approved these changes Jan 22, 2018
@cezaraugusto
Copy link
Contributor

pushed 37b0969 which removed commented property (#11776 (review)) and removed ev cert from titlemode (#11776 (review))

@@ -481,7 +482,23 @@ class UrlBar extends React.Component {
return props
}

get showEvCert () {
return !this.props.titleMode && <span className='evCert'> {this.props.evCert} </span>
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 return false if we are in titleMode. according to react docs (https://reactjs.org/docs/conditional-rendering.html#preventing-component-from-rendering), it should return null when an element isn't rendered.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks changed in 97f689b via push -f

@cezaraugusto
Copy link
Contributor

each new commit auto dismisses previous reviews please confirm if we're good to go now, thanks

diracdeltas
diracdeltas previously approved these changes Jan 22, 2018
Copy link
Member

@diracdeltas diracdeltas left a comment

Choose a reason for hiding this comment

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

i'd prefer #12743 be merged first since it's for an earlier milestone and these two PRs will conflict. otherwise lgtm.

darkdh
darkdh previously approved these changes Jan 22, 2018
Copy link
Member

@darkdh darkdh left a comment

Choose a reason for hiding this comment

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

++, I will get #12743 merged first and then rebased this PR on it

@darkdh darkdh dismissed stale reviews from diracdeltas and themself via 0cf5bfe January 22, 2018 20:39
@darkdh
Copy link
Member

darkdh commented Jan 22, 2018

rebased

Copy link
Contributor

@cezaraugusto cezaraugusto left a comment

Choose a reason for hiding this comment

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

since #12743 is merged and this is rebased I'm merging, thanks all

@cezaraugusto cezaraugusto merged commit a3e3911 into brave:master Jan 22, 2018
cezaraugusto added a commit that referenced this pull request Jan 22, 2018
Frontend EV Certificate Changes
@cezaraugusto
Copy link
Contributor

master a3e3911
0.21.x 1e91183

cezaraugusto added a commit that referenced this pull request Jan 22, 2018
cezaraugusto added a commit that referenced this pull request Jan 22, 2018
cezaraugusto added a commit that referenced this pull request Jan 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants