New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 767491 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug



Sign in to add a comment

ct_policy_enforcer.cc: RoundedDownMonthDifference() missing early return

Project Member Reported by robpercival@chromium.org, Sep 21 2017

Issue description

The RoundedDownMonthDifference() function in ct_policy_enforcer.cc attempts to return early if end < start, but lacks a "return" statement, so ends up running to completion. The calculation it performs underflows the uint32_t it stores the result in (rounded_months_difference).

Effects of fixing:
- RoundedDownMonthDifference() will produce the apparently intended result when end < start, which is *rounded_months_difference == 0.
- CheckCertPolicyCompliance() will only require 2 SCTs for certificates with negative validity periods. Currently, it requires 2-5 SCTs, depending on how large the negative validity period is. This is fairly moot though, since such certificates will not validate.

See https://cs.chromium.org/chromium/src/net/cert/ct_policy_enforcer.cc?l=61&rcl=5204c87e3a6178b2898f254c2404930a9638b7c5 for the if block that is missing a "return" statement.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5f57f908023ea5f4cc7277059a6dc1e6e0a3fdd4

commit 5f57f908023ea5f4cc7277059a6dc1e6e0a3fdd4
Author: Rob Percival <robpercival@chromium.org>
Date: Mon Sep 25 12:29:03 2017

Fix bug in RoundedDownMonthDifference() when end < start

Credit to Rijad Muminović (rijadm@google.com) for noticing this.

Change-Id: Ie72448832882be858cc9f1a636812ca4acc92b28
Bug:  767491 
Reviewed-on: https://chromium-review.googlesource.com/671356
Reviewed-by: Eric Roman <eroman@chromium.org>
Commit-Queue: Rob Percival <robpercival@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504032}
[modify] https://crrev.com/5f57f908023ea5f4cc7277059a6dc1e6e0a3fdd4/net/cert/ct_policy_enforcer.cc
[modify] https://crrev.com/5f57f908023ea5f4cc7277059a6dc1e6e0a3fdd4/net/cert/ct_policy_enforcer_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment