We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a903056 + d12e6b1 commit 9eb8714Copy full SHA for 9eb8714
adafruit_atecc/adafruit_atecc_asn1.py
@@ -252,7 +252,7 @@ def issuer_or_subject_length(
252
:param str org: Organization of certificate
253
:param str org_unit: Organization unit of certificate
254
:param str common: Common data of certificate
255
- :raises: TypeError if return value is 0
+ :raises: ValueError if return value is <= 0
256
:return: Total length of provided certificate information.
257
"""
258
tot_len = 0
@@ -268,6 +268,7 @@ def issuer_or_subject_length(
268
tot_len += 11 + len(org_unit)
269
if common:
270
tot_len += 11 + len(common)
271
- else:
272
- raise TypeError("Provided length must be > 0")
+
+ if tot_len <= 0:
273
+ raise ValueError("Provided length must be > 0")
274
return tot_len
0 commit comments