Skip to content

Commit

Permalink
Bump version to 0.1.0-rc1.
Browse files Browse the repository at this point in the history
This commit is a test of using [git-meta](https://github.com/twosigma/git-meta)
for easier project management.

All build flows have been modified to expect a folder hierarchy as
used here.
  • Loading branch information
samscott89 committed Apr 8, 2018
1 parent 3af9b5c commit e8738cb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ VERSION = 0.1.0-rc1
all: libpasta.so libpasta.a

clean:
cargo clean --manifest-path libpasta-capi/Cargo.toml
rm -rf build/

force:
Expand All @@ -11,7 +12,7 @@ force:
make all

libpasta: Cargo.toml libpasta-capi/Cargo.toml
cargo build --release --manifest-path libpasta-capi/Cargo.toml
RUSTFLAGS="--print native-static-libs" cargo build --release --manifest-path libpasta-capi/Cargo.toml

libpasta.%: libpasta
mkdir -p build
Expand Down
6 changes: 4 additions & 2 deletions libpasta-capi/include/pasta-bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ struct HashUpdateFfi {

extern "C" {

void config_free(Config *config);

char *config_hash_password(const Config *config, const char *password);

HashUpdateFfi *config_migrate_hash(const Config *config, const char *hash);

Config *config_new();

bool config_verify_password(const Config *config, const char *hash, const char *password);

HashUpdateFfi *config_verify_password_update_hash(const Config *config,
Expand All @@ -56,8 +60,6 @@ Primitive *default_pbkdf2i();

Primitive *default_scrypt();

void free_Config(Config *config);

void free_Primitive(Primitive *prim);

void free_string(char *s);
Expand Down
14 changes: 9 additions & 5 deletions libpasta-capi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ pub extern fn hash_password(password: *const c_char) -> *mut c_char {
CString::new(output).unwrap().into_raw()
}

#[no_mangle]
pub extern "C" fn config_new() -> *mut Config {
box_ptr!(Config::default())
}

#[no_mangle]
pub extern "C" fn config_free(config: *mut Config) {
let _config = unsafe { ffi_ref!(config) };
}

#[no_mangle]
pub extern "C" fn config_hash_password(config: *const Config, password: *const c_char) -> *mut c_char {
Expand Down Expand Up @@ -183,11 +192,6 @@ pub extern "C" fn free_Primitive(prim: *mut Primitive) {
let _prim = unsafe { ffi_ref!(prim) };
}

#[no_mangle]
pub extern "C" fn free_Config(config: *mut Config) {
let _config = unsafe { ffi_ref!(config) };

}

#[cfg(test)]
mod test {
Expand Down

0 comments on commit e8738cb

Please sign in to comment.