Skip to content

Integration of BN (BigNum) functions. #29

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

Merged
merged 2 commits into from
Jul 25, 2014
Merged

Conversation

xorpse
Copy link
Contributor

@xorpse xorpse commented Jul 23, 2014

I've included tests for those functions/methods that are not simple wrappers around their C counterparts.

All functions/methods are checked for errors in their return values and will produce either a BigNum or SslError. However, for those methods which are implemented for traits (e.g. .add(), sub(), etc.), the underlying operation is assumed to have succeeded. Thus, if one of these methods fails, the result will be as if you attempted to unwrap a Result type value.

fn BN_CTX_new() -> *mut BN_CTX;
fn BN_CTX_free(ctx: *mut BN_CTX);

fn BN_set_word(bn: *mut BIGNUM, n: c_uint) -> c_int;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The man pages say that this takes an unsigned long which would correspond to c_ulong, not c_uint.

@xorpse
Copy link
Contributor Author

xorpse commented Jul 24, 2014

I've removed the resource leak and corrected the interface inaccuracies. Thanks for pointing them out.

sfackler added a commit that referenced this pull request Jul 25, 2014
Integration of BN (BigNum) functions.
@sfackler sfackler merged commit 19f12a1 into sfackler:master Jul 25, 2014
DiamondLovesYou pushed a commit to DiamondLovesYou/rust-openssl that referenced this pull request Sep 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants