mirror of
https://github.com/status-im/nim-chronos.git
synced 2025-01-22 01:10:12 +00:00
Fix TLS certificate allocation (#259)
* Fix TLS certificate allocation * change style + comment
This commit is contained in:
parent
b47b2a96ce
commit
8719723077
@ -708,7 +708,8 @@ proc init*(tt: typedesc[TLSCertificate],
|
|||||||
##
|
##
|
||||||
## This procedure initializes array of certificates from PEM encoded string.
|
## This procedure initializes array of certificates from PEM encoded string.
|
||||||
var items = pemDecode(data)
|
var items = pemDecode(data)
|
||||||
var res = TLSCertificate()
|
# storage needs to be big enough for input data
|
||||||
|
var res = TLSCertificate(storage: newSeqOfCap[byte](data.len))
|
||||||
for item in items:
|
for item in items:
|
||||||
if item.name == "CERTIFICATE" and len(item.data) > 0:
|
if item.name == "CERTIFICATE" and len(item.data) > 0:
|
||||||
let offset = len(res.storage)
|
let offset = len(res.storage)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user