Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
render system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Jul 2015 at 13:41 UTC
Updated:
27 Aug 2015 at 10:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerThere are also quite a lot of Crypt:: placeholders floating around.
Comment #3
RavindraSingh commentedUpdated with Crypt::hashBase64(serialize($placeholder_render_array));
Needs tests also.
Comment #4
dawehnerIMHO we better want to switch to a different way than crypt in order to make it clear, that we don't deal about something security related here.
Comment #6
borisson_Fixes the failures introduced in the initial patch.
Comment #7
RavindraSingh commented#6 Looks good. manually reviewed the patch.
Verified - Crc32 is being used correctly. making it RTBC.
Comment #8
dawehnerAlright, we we don't want to convert Crypt::hashBase64 over here, does someone mind opening up a follow up for that?
Comment #9
wim leersComment #12
borisson_Back to rtbc, the failure is unrelated to this patch.
Comment #13
wim leersWe should use
hash('crc32b')instead, see #2546680: Use hash('crc32b') not crc32().Comment #14
pieterjanput commentedComment #15
wim leersOops — these re-introduce SHA1. :)
Comment #16
pieterjanput commentedComment #17
wim leersComment #18
catchThis is a case where we might want to be concerned about hash collisions. I'm not sure if that's a real issue, but compared to any other usage it's more likely to be a problem.
Comment #19
catchComment #20
olli commentedIssue title says to switch from sha1 to crc32b, not crc32.
#18: Would md5 or another algorithm be better here?
Comment #21
borisson_Comment #22
wim leersAwesome point!
I think that if the placeholders were using solely the CRC32 check, that we could indeed have a problem. There are 2^32 (>4 billion) possible hashes. But, more importantly, the hash here is only a subset of the placeholder. We always also list the callback and arguments. This was originally done not to avoid collisions, but to improve debuggability. But now, it effectively helps to avoid collisions.
#20: indeed. I missed that.
Comment #23
borisson_Resolved #20 by using crc32b.
@Wim Leers explained why crc32b is enough in #22 so #18 shouldn't be a problem anymore.
Comment #24
wim leersThis is going to conflict with #2543334: Auto-placeholdering for #lazy_builder with bubbling of contexts and tags, but that's easy enough to resolve.
Comment #25
alexpottSo do we need to force a cache clear or something because placeholders are changing - is there an upgrade path implication here?
Comment #26
wim leersNo, because:
foobarcan be used as a placeholder.#markuphave the associated#attached[placeholders]already, so there is always guaranteed to be a 1:1 mappingComment #27
wim leersIn other words: any cached render array is fully internally consistent. It doesn't matter if the outside world changes.
Comment #28
catchI don't think so since update.php does a drupal_flush_all_caches() whether or not there are updates to run:
https://api.drupal.org/api/drupal/core%21modules%21system%21src%21Contro...
https://api.drupal.org/api/drupal/core%21modules%21system%21src%21Contro...
Comment #29
wim leersRewrote IS and added beta evaluation.
Comment #30
dawehnerCatch is certainly right here, I ran into that, while working on #2540416: Move update.php back to a front controller
Comment #31
alexpottCommitted 9f12768 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.