Timofei Zhakov <[email protected]> writes:

+static svn_error_t *
+bcrypt_ctx_update(bcrypt_ctx_t *ctx,
+                  const void *data,
+                  apr_size_t len)
+{
+  SVN_ERR_ASSERT(len <= ULONG_MAX);
+
+  SVN_ERR(handle_error(BCryptHashData(ctx->handle,
+                                      (PUCHAR) data,
+                                      (ULONG) len,
+                                      /* dwFlags */ 0)));
+
+  return SVN_NO_ERROR;
+}

Perhaps, we could add a loop here to have correct behavior in a potentially
possible case when `len` exceeds ULONG_MAX?


Thanks,
Evgeny Kotkov

Reply via email to