Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: net/der/tag.cc

Issue 1214933009: Class for parsing and evaluating RFC 5280 NameConstraints. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compare_DN2
Patch Set: changes for comment #16 Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/der/tag.h ('k') | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "net/der/tag.h" 6 #include "net/der/tag.h"
7 7
8 namespace net { 8 namespace net {
9 9
10 namespace der { 10 namespace der {
11 11
12 Tag ContextSpecificConstructed(uint8_t class_number) { 12 Tag ContextSpecificConstructed(uint8_t class_number) {
13 DCHECK_EQ(class_number, class_number & kTagNumberMask); 13 DCHECK_EQ(class_number, class_number & kTagNumberMask);
14 return (class_number & kTagNumberMask) | kTagConstructed | 14 return (class_number & kTagNumberMask) | kTagConstructed |
15 kTagContextSpecific; 15 kTagContextSpecific;
16 } 16 }
17 17
18 Tag ContextSpecificPrimitive(uint8_t base) { 18 Tag ContextSpecificPrimitive(uint8_t base) {
19 DCHECK_EQ(base, base & kTagNumberMask); 19 DCHECK_EQ(base, base & kTagNumberMask);
20 return (base & kTagNumberMask) | kTagPrimitive | kTagContextSpecific; 20 return (base & kTagNumberMask) | kTagPrimitive | kTagContextSpecific;
21 } 21 }
22 22
23 bool IsContextSpecific(Tag tag) {
24 return (tag & kTagClassMask) == kTagContextSpecific;
25 }
26
23 bool IsConstructed(Tag tag) { 27 bool IsConstructed(Tag tag) {
24 return (tag & kTagConstructionMask) == kTagConstructed; 28 return (tag & kTagConstructionMask) == kTagConstructed;
25 } 29 }
26 30
31 uint8_t GetTagNumber(Tag tag) {
32 return tag & kTagNumberMask;
33 }
34
27 } // namespace der 35 } // namespace der
28 36
29 } // namespace net 37 } // namespace net
OLDNEW
« no previous file with comments | « net/der/tag.h ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698