|
The general expectation for functions in libmongocrypt is to return a boolean indicating success or failure. Since _mongocrypt_key_broker_next_kms returns a pointer (which may validly be NULL) if it fails due to the wrong key broker state, then the caller is not informed. I'm not sure if there's a reasonable way to inform the caller of mongocrypt_ctx_next_kms_ctx in a better way.
Note, this is not particularly worrisome. If this error is tripped, it's a bug in the binding implementation. And future operations would fail, so it would be clear that something went wrong.
|