Make it compile again.
Make self mut in set_subject_name. Add assert to prevent a null pointer in subject_name.
This commit is contained in:
parent
30a634c877
commit
8ae424235e
|
|
@ -93,7 +93,13 @@ impl Asn1StringRef {
|
|||
}
|
||||
}
|
||||
|
||||
type_!(Asn1Integer, Asn1IntegerRef, ffi::ASN1_INTEGER, ffi::ASN1_INTEGER_free);
|
||||
foreign_type! {
|
||||
type CType = ffi::ASN1_INTEGER;
|
||||
fn drop = ffi::ASN1_INTEGER_free;
|
||||
|
||||
pub struct Asn1Integer;
|
||||
pub struct Asn1IntegerRef;
|
||||
}
|
||||
|
||||
impl Asn1IntegerRef {
|
||||
pub fn get(&self) -> i64 {
|
||||
|
|
|
|||
|
|
@ -647,11 +647,12 @@ impl X509ReqRef {
|
|||
pub fn subject_name(&self) -> &X509NameRef {
|
||||
unsafe {
|
||||
let name = compat::X509_REQ_get_subject_name(self.as_ptr());
|
||||
assert!(!name.is_null());
|
||||
X509NameRef::from_ptr(name)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_subject_name(&self, value: &X509NameRef) -> Result<(), ErrorStack> {
|
||||
pub fn set_subject_name(&mut self, value: &X509NameRef) -> Result<(), ErrorStack> {
|
||||
unsafe {
|
||||
cvt(ffi::X509_REQ_set_subject_name(self.as_ptr(), value.as_ptr())).map(|_| ())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue