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

Side by Side Diff: third_party/tlslite/tlslite/utils/asn1parser.py

Issue 211173006: Perform tlslite 0.3.8 -> 0.4.6 renames ahead of time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop the -B Created 6 years, 8 months 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 | Annotate | Revision Log
OLDNEW
1 """Class for parsing ASN.1""" 1 """Class for parsing ASN.1"""
2 from compat import * 2 from compat import *
3 from codec import * 3 from codec import *
4 4
5 #Takes a byte array which has a DER TLV field at its head 5 #Takes a byte array which has a DER TLV field at its head
6 class ASN1Parser: 6 class ASN1Parser:
7 def __init__(self, bytes): 7 def __init__(self, bytes):
8 p = Parser(bytes) 8 p = Parser(bytes)
9 p.get(1) #skip Type 9 p.get(1) #skip Type
10 10
(...skipping 17 matching lines...) Expand all
28 return p.bytes[markIndex : p.index] 28 return p.bytes[markIndex : p.index]
29 29
30 #Decode the ASN.1 DER length field 30 #Decode the ASN.1 DER length field
31 def _getASN1Length(self, p): 31 def _getASN1Length(self, p):
32 firstLength = p.get(1) 32 firstLength = p.get(1)
33 if firstLength<=127: 33 if firstLength<=127:
34 return firstLength 34 return firstLength
35 else: 35 else:
36 lengthLength = firstLength & 0x7F 36 lengthLength = firstLength & 0x7F
37 return p.get(lengthLength) 37 return p.get(lengthLength)
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/utils/aes.py ('k') | third_party/tlslite/tlslite/utils/cipherfactory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698