c27d48be73
the authors changed the interfaces to the bcrypt() and bcrypt_gensalt() routines, so rename them to avoid conflicting with our own routines in libc
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
$OpenBSD: patch-ext_mri_bcrypt_ext_c,v 1.1 2010/01/01 20:35:34 jcs Exp $
|
|
--- ext/mri/bcrypt_ext.c.orig Wed Dec 31 17:00:00 1969
|
|
+++ ext/mri/bcrypt_ext.c Thu Dec 31 16:30:45 2009
|
|
@@ -30,7 +30,7 @@ static VALUE cBCryptEngine;
|
|
|
|
static VALUE bcrypt_wrapper(void *_args) {
|
|
BCryptArguments *args = (BCryptArguments *)_args;
|
|
- return (VALUE)bcrypt(args->output, args->key, args->salt);
|
|
+ return (VALUE)_bcrypt(args->output, args->key, args->salt);
|
|
}
|
|
|
|
#endif /* RUBY_1_9 */
|
|
@@ -41,7 +41,8 @@ static VALUE bc_salt(VALUE self, VALUE cost, VALUE see
|
|
int icost = NUM2INT(cost);
|
|
char salt[BCRYPT_SALT_OUTPUT_SIZE];
|
|
|
|
- bcrypt_gensalt(salt, icost, (uint8_t *)RSTRING_PTR(seed));
|
|
+ _bcrypt_gensalt(salt, icost, (uint8_t *)RSTRING_PTR(seed));
|
|
+
|
|
return rb_str_new2(salt);
|
|
}
|
|
|
|
@@ -70,7 +71,7 @@ static VALUE bc_crypt(VALUE self, VALUE key, VALUE sal
|
|
/* otherwise, fallback to the non-GIL-unlocking code, just like on Ruby 1.8 */
|
|
#endif
|
|
|
|
- if (bcrypt(output, safeguarded, (char *)RSTRING_PTR(salt)) != NULL) {
|
|
+ if (_bcrypt(output, safeguarded, (char *)RSTRING_PTR(salt)) != NULL) {
|
|
return rb_str_new2(output);
|
|
} else {
|
|
return Qnil;
|