mirror of
https://github.com/logos-storage/nim-chronos.git
synced 2026-01-06 15:33:08 +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.
|
||||
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:
|
||||
if item.name == "CERTIFICATE" and len(item.data) > 0:
|
||||
let offset = len(res.storage)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user