Style changes according to review
This commit is contained in:
parent
557b936e27
commit
6a8f6f425f
|
|
@ -1386,7 +1386,7 @@ extern {
|
|||
pub fn AES_set_decrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
|
||||
pub fn AES_ige_encrypt(in_: *const c_uchar, out: *mut c_uchar, length: size_t, key: *const AES_KEY, ivec: *mut c_uchar, enc: c_int);
|
||||
|
||||
pub fn ASN1_INTEGER_get(dest: *mut ASN1_INTEGER) -> c_long;
|
||||
pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long;
|
||||
pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
|
||||
pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME);
|
||||
pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int;
|
||||
|
|
|
|||
|
|
@ -303,15 +303,15 @@ pub struct X509_REQ_INFO {
|
|||
pub enc: ASN1_ENCODING,
|
||||
pub version: *mut ::ASN1_INTEGER,
|
||||
pub subject: *mut ::X509_NAME,
|
||||
pub pubkey: *mut c_void,
|
||||
pubkey: *mut c_void,
|
||||
pub attributes: *mut stack_st_X509_ATTRIBUTE
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct X509_REQ {
|
||||
pub req_info: *mut X509_REQ_INFO,
|
||||
pub sig_alg: *mut c_void,
|
||||
pub signature: *mut c_void,
|
||||
sig_alg: *mut c_void,
|
||||
signature: *mut c_void,
|
||||
references: c_int
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -310,15 +310,15 @@ pub struct X509_REQ_INFO {
|
|||
pub enc: ASN1_ENCODING,
|
||||
pub version: *mut ::ASN1_INTEGER,
|
||||
pub subject: *mut ::X509_NAME,
|
||||
pub pubkey: *mut c_void,
|
||||
pubkey: *mut c_void,
|
||||
pub attributes: *mut stack_st_X509_ATTRIBUTE
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct X509_REQ {
|
||||
pub req_info: *mut X509_REQ_INFO,
|
||||
pub sig_alg: *mut c_void,
|
||||
pub signature: *mut c_void,
|
||||
sig_alg: *mut c_void,
|
||||
signature: *mut c_void,
|
||||
references: c_int
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,19 +80,14 @@ type_!(Asn1Integer, Asn1IntegerRef, ffi::ASN1_INTEGER, ffi::ASN1_INTEGER_free);
|
|||
impl Asn1IntegerRef {
|
||||
pub fn get(&self) -> i64 {
|
||||
unsafe {
|
||||
return ::ffi::ASN1_INTEGER_get(self.as_ptr());
|
||||
::ffi::ASN1_INTEGER_get(self.as_ptr()) as i64
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set(&self, value: i64) -> Result<(), ErrorStack>
|
||||
pub fn set(&mut self, value: i32) -> Result<(), ErrorStack>
|
||||
{
|
||||
unsafe {
|
||||
let res = ::ffi::ASN1_INTEGER_set(self.as_ptr(), value);
|
||||
if res < 0 {
|
||||
return Err(ErrorStack::get());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
cvt(::ffi::ASN1_INTEGER_set(self.as_ptr(), value as c_long)).map(|_| ())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -600,11 +600,10 @@ impl X509ReqRef {
|
|||
to_pem!(ffi::PEM_write_bio_X509_REQ);
|
||||
to_der!(ffi::i2d_X509_REQ);
|
||||
|
||||
pub fn version(&self) -> i64
|
||||
pub fn version(&self) -> i32
|
||||
{
|
||||
unsafe {
|
||||
let version = compat::X509_REQ_get_version(self.as_ptr());
|
||||
version
|
||||
compat::X509_REQ_get_version(self.as_ptr()) as i32
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue