Bump chronicles + adjust some raises in libnimbus

This commit is contained in:
kdeme 2020-04-21 14:17:08 +02:00
parent 905102c736
commit 55fb4987d7
No known key found for this signature in database
GPG Key ID: 4E8DD21420AF43F5
2 changed files with 5 additions and 5 deletions

@ -1 +1 @@
Subproject commit 51c88a4cdbdbeb460863b0929502ae5e0f8ca99d Subproject commit 114cdccaa087c54abcc4dad9ed3366af247de79e

View File

@ -174,7 +174,7 @@ proc nimbus_new_keypair(id: var Identifier): bool
discard discard
proc nimbus_add_keypair(privateKey: ptr byte, id: var Identifier): proc nimbus_add_keypair(privateKey: ptr byte, id: var Identifier):
bool {.exportc, dynlib, raises: [Defect, OSError, IOError, ValueError].} = bool {.exportc, dynlib, raises: [Defect].} =
## Caller needs to provide as id a pointer to 32 bytes allocation. ## Caller needs to provide as id a pointer to 32 bytes allocation.
doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.") doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.")
doAssert(not privateKey.isNil, "Private key cannot be nil.") doAssert(not privateKey.isNil, "Private key cannot be nil.")
@ -221,7 +221,7 @@ proc nimbus_get_private_key(id: Identifier, privateKey: var PrivateKey):
# Symmetric Keys # Symmetric Keys
proc nimbus_add_symkey(symKey: ptr SymKey, id: var Identifier): bool proc nimbus_add_symkey(symKey: ptr SymKey, id: var Identifier): bool
{.exportc, dynlib, raises: [].} = {.exportc, dynlib, raises: [Defect].} =
## Caller needs to provide as id a pointer to 32 bytes allocation. ## Caller needs to provide as id a pointer to 32 bytes allocation.
doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.") doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.")
doAssert(not symKey.isNil, "Symmetric key cannot be nil.") doAssert(not symKey.isNil, "Symmetric key cannot be nil.")
@ -249,14 +249,14 @@ proc nimbus_add_symkey_from_password(password: cstring, id: var Identifier):
whisperKeys.symKeys.add(id.toHex(), symKey) whisperKeys.symKeys.add(id.toHex(), symKey)
proc nimbus_delete_symkey(id: Identifier): bool proc nimbus_delete_symkey(id: Identifier): bool
{.exportc, dynlib, raises: [].} = {.exportc, dynlib, raises: [Defect].} =
doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.") doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.")
var unneeded: SymKey var unneeded: SymKey
result = whisperKeys.symKeys.take(id.toHex(), unneeded) result = whisperKeys.symKeys.take(id.toHex(), unneeded)
proc nimbus_get_symkey(id: Identifier, symKey: var SymKey): proc nimbus_get_symkey(id: Identifier, symKey: var SymKey):
bool {.exportc, dynlib, raises: [OSError, IOError, ValueError].} = bool {.exportc, dynlib, raises: [Defect].} =
doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.") doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.")
doAssert(not (unsafeAddr symKey).isNil, "Symmetric key cannot be nil.") doAssert(not (unsafeAddr symKey).isNil, "Symmetric key cannot be nil.")