After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 681319 - gtlscertificate: Add certificate-bytes and private-key-bytes props
gtlscertificate: Add certificate-bytes and private-key-bytes props
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks: 681121
 
 
Reported: 2012-08-06 17:00 UTC by Stef Walter
Modified: 2012-08-06 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtlscertificate: Add certificate-bytes and private-key-bytes props (6.83 KB, patch)
2012-08-06 17:01 UTC, Stef Walter
committed Details | Review
gnutls: Add tests for certificate-bytes and private-key-bytes props (25.59 KB, patch)
2012-08-06 17:01 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2012-08-06 17:00:59 UTC
As suggested by Dan in bug #681121.
Comment 1 Stef Walter 2012-08-06 17:01:01 UTC
Created attachment 220473 [details] [review]
gtlscertificate: Add certificate-bytes and private-key-bytes props

 * These properties contain the same data as certificate and
   private-key, but as GBytes
Comment 2 Stef Walter 2012-08-06 17:01:54 UTC
Created attachment 220474 [details] [review]
gnutls: Add tests for certificate-bytes and private-key-bytes props

 * And rearrange the test setup/teardown slightly at the same time.
 * Can't actually read out the private-key from the certificate so
   just run through the motions of creating it with a private key.
Comment 3 Dan Winship 2012-08-06 18:01:45 UTC
Comment on attachment 220473 [details] [review]
gtlscertificate: Add certificate-bytes and private-key-bytes props

>+   * GTlsCertificate:certificate-bytes:
>+   *
>+   * The DER (binary) encoded representation of the certificate as
>+   * a #GBytes. This property and the #GTlsCertificate:certificate
>+   * contain the same data.

It would be good if :certificate and :certificate-pem also referenced :certificate-bytes. Otherwise good to go.
Comment 4 Dan Winship 2012-08-06 18:07:41 UTC
Comment on attachment 220474 [details] [review]
gnutls: Add tests for certificate-bytes and private-key-bytes props

The gtlscertificate-gnutls.c part of this should be split out as a separate patch.

>+      if (byte_array)
>+          set_certificate_from_der (gnutls, byte_array->data, byte_array->len);

that's indented too far

>+      if (bytes)
>+          set_certificate_from_der (gnutls, g_bytes_get_data (bytes, NULL),
>+                                    g_bytes_get_size (bytes));

{}s around the body since it's multi-line please (likewise for private-key-bytes).

ok to commit (as two patches) with those changes
Comment 5 Stef Walter 2012-08-06 20:37:59 UTC
Attachment 220474 [details] pushed as e0115fd - gnutls: Add tests for certificate-bytes and private-key-bytes props