Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle safe-string #47

Merged
merged 1 commit into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sha1_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ CAMLprim value stub_sha1_to_bin(value digest)
CAMLlocal1(result);

result = caml_alloc_string(20);
sha1_to_bin((sha1_digest *) digest, String_val(result));
sha1_to_bin((sha1_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
Expand All @@ -165,7 +165,7 @@ CAMLprim value stub_sha1_to_hex(value digest)
CAMLlocal1(result);

result = caml_alloc_string(40);
sha1_to_hex((sha1_digest *) digest, String_val(result));
sha1_to_hex((sha1_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
4 changes: 2 additions & 2 deletions sha256_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ CAMLprim value stub_sha256_to_bin(value digest)
CAMLlocal1(result);

result = caml_alloc_string(32);
sha256_to_bin((sha256_digest *) digest, String_val(result));
sha256_to_bin((sha256_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
Expand All @@ -163,7 +163,7 @@ CAMLprim value stub_sha256_to_hex(value digest)
CAMLlocal1(result);

result = caml_alloc_string(64);
sha256_to_hex((sha256_digest *) digest, String_val(result));
sha256_to_hex((sha256_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
4 changes: 2 additions & 2 deletions sha512_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ CAMLprim value stub_sha512_to_bin(value digest)
CAMLlocal1(result);

result = caml_alloc_string(64);
sha512_to_bin((sha512_digest *) digest, String_val(result));
sha512_to_bin((sha512_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
Expand All @@ -163,7 +163,7 @@ CAMLprim value stub_sha512_to_hex(value digest)
CAMLlocal1(result);

result = caml_alloc_string(128);
sha512_to_hex((sha512_digest *) digest, String_val(result));
sha512_to_hex((sha512_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}