Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Security/SecCertificate2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public SecCertificate2 (SecCertificate certificate)
}

[DllImport (Constants.SecurityLibrary)]
extern static IntPtr sec_identity_copy_ref (IntPtr handle);
extern static /* SecCertificateRef */ IntPtr sec_certificate_copy_ref (/* OS_sec_certificate */ IntPtr handle);

public SecCertificate Certificate => new SecCertificate (sec_identity_copy_ref (GetCheckedHandle ()), owns: true);
public SecCertificate Certificate => new SecCertificate (sec_certificate_copy_ref (GetCheckedHandle ()), owns: true);
}
}
2 changes: 1 addition & 1 deletion src/Security/SecIdentity2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public SecIdentity2 (SecIdentity identity, SecCertificate [] certificates)
}

[DllImport (Constants.SecurityLibrary)]
extern static IntPtr sec_identity_copy_ref (IntPtr handle);
extern static /* SecIdentityRef */ IntPtr sec_identity_copy_ref (/* OS_sec_identity */ IntPtr handle);

public SecIdentity Identity => new SecIdentity (sec_identity_copy_ref (GetCheckedHandle ()), owns: true);

Expand Down
10 changes: 10 additions & 0 deletions tests/monotouch-test/Security/CertificateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -630,5 +630,15 @@ public void GenerateKeyPairTest ()
}
}
}

[Test]
public void X2 ()
{
TestRuntime.AssertXcodeVersion (10,0);
using (var x1 = new SecCertificate (mail_google_com))
using (var x2 = new SecCertificate2 (x1)) {
Assert.That (x2.Certificate.GetCommonName (), Is.EqualTo (x1.GetCommonName ()), "CommonName");
}
}
}
}
10 changes: 10 additions & 0 deletions tests/monotouch-test/Security/IdentityTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,15 @@ public void Identity ()
Assert.NotNull (id.Certificate, "Certificate");
}
}

[Test]
public void I2 ()
{
TestRuntime.AssertXcodeVersion (10,0);
using (var i1 = GetIdentity ())
using (var i2 = new SecIdentity2 (i1)) {
Assert.That (i1.Certificate.GetCommonName (), Is.EqualTo (i2.Identity.Certificate.GetCommonName ()), "GetCommonName");
}
}
}
}
8 changes: 8 additions & 0 deletions tests/xtro-sharpie/common-Security.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@
## identical to NSObject version (headers macros) which can be called by CFObject
!missing-pinvoke! sec_release is not bound
!missing-pinvoke! sec_retain is not bound

## the following are manualy bound as NativeObject
!missing-protocol! OS_sec_certificate not bound
!missing-protocol! OS_sec_identity not bound
!missing-protocol! OS_sec_object not bound
!missing-protocol! OS_sec_protocol_metadata not bound
!missing-protocol! OS_sec_protocol_options not bound
!missing-protocol! OS_sec_trust not bound
7 changes: 0 additions & 7 deletions tests/xtro-sharpie/iOS-Security.todo
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
!missing-pinvoke! sec_certificate_copy_ref is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret_with_context is not bound
!missing-pinvoke! sec_protocol_options_set_challenge_block is not bound
!missing-pinvoke! sec_protocol_options_set_verify_block is not bound
!missing-pinvoke! SecCertificateCopyKey is not bound
!missing-pinvoke! SecTrustEvaluateWithError is not bound
!missing-protocol! OS_sec_certificate not bound
!missing-protocol! OS_sec_identity not bound
!missing-protocol! OS_sec_object not bound
!missing-protocol! OS_sec_protocol_metadata not bound
!missing-protocol! OS_sec_protocol_options not bound
!missing-protocol! OS_sec_trust not bound
7 changes: 0 additions & 7 deletions tests/xtro-sharpie/macOS-Security.todo
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
!missing-field! kSecCodeInfoRuntimeVersion not bound
!missing-pinvoke! sec_certificate_copy_ref is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret_with_context is not bound
!missing-pinvoke! sec_protocol_options_set_challenge_block is not bound
!missing-pinvoke! sec_protocol_options_set_verify_block is not bound
!missing-pinvoke! SecCertificateCopyKey is not bound
!missing-pinvoke! SecTrustEvaluateWithError is not bound
!missing-protocol! OS_sec_certificate not bound
!missing-protocol! OS_sec_identity not bound
!missing-protocol! OS_sec_object not bound
!missing-protocol! OS_sec_protocol_metadata not bound
!missing-protocol! OS_sec_protocol_options not bound
!missing-protocol! OS_sec_trust not bound
7 changes: 0 additions & 7 deletions tests/xtro-sharpie/tvOS-Security.todo
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
!missing-pinvoke! sec_certificate_copy_ref is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret_with_context is not bound
!missing-pinvoke! sec_protocol_options_set_challenge_block is not bound
!missing-pinvoke! sec_protocol_options_set_verify_block is not bound
!missing-pinvoke! SecCertificateCopyKey is not bound
!missing-pinvoke! SecTrustEvaluateWithError is not bound
!missing-protocol! OS_sec_certificate not bound
!missing-protocol! OS_sec_identity not bound
!missing-protocol! OS_sec_object not bound
!missing-protocol! OS_sec_protocol_metadata not bound
!missing-protocol! OS_sec_protocol_options not bound
!missing-protocol! OS_sec_trust not bound
7 changes: 0 additions & 7 deletions tests/xtro-sharpie/watchOS-Security.todo
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
!missing-pinvoke! sec_certificate_copy_ref is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret is not bound
!missing-pinvoke! sec_protocol_metadata_create_secret_with_context is not bound
!missing-pinvoke! sec_protocol_options_set_challenge_block is not bound
!missing-pinvoke! sec_protocol_options_set_verify_block is not bound
!missing-pinvoke! SecCertificateCopyKey is not bound
!missing-pinvoke! SecTrustEvaluateWithError is not bound
!missing-protocol! OS_sec_certificate not bound
!missing-protocol! OS_sec_identity not bound
!missing-protocol! OS_sec_object not bound
!missing-protocol! OS_sec_protocol_metadata not bound
!missing-protocol! OS_sec_protocol_options not bound
!missing-protocol! OS_sec_trust not bound