-/* $OpenBSD: bs_ber.c,v 1.3 2015/04/29 01:31:39 doug Exp $ */
+/* $OpenBSD: bs_ber.c,v 1.4 2015/04/29 02:11:09 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
return 0;
if (CBS_len(&contents) == header_len && header_len > 0 &&
- CBS_data(&contents)[header_len-1] == 0x80) {
+ CBS_data(&contents)[header_len - 1] == 0x80) {
*ber_found = 1;
return 1;
}
-/* $OpenBSD: bs_cbs.c,v 1.6 2015/04/29 01:27:34 doug Exp $ */
+/* $OpenBSD: bs_cbs.c,v 1.7 2015/04/29 02:11:09 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
CBS_strdup(const CBS *cbs, char **out_ptr)
{
free(*out_ptr);
- *out_ptr = strndup((const char*)cbs->data, cbs->len);
+ *out_ptr = strndup((const char *)cbs->data, cbs->len);
return (*out_ptr != NULL);
}
/* Length should have used short-form encoding. */
return 0;
- if ((len32 >> ((num_bytes-1)*8)) == 0)
+ if ((len32 >> ((num_bytes - 1) * 8)) == 0)
/* Length should have been at least one byte shorter. */
return 0;
-/* $OpenBSD: bytestring.h,v 1.4 2015/02/07 06:10:32 doug Exp $ */
+/* $OpenBSD: bytestring.h,v 1.5 2015/04/29 02:11:09 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
/*
* CBS_stow copies the current contents of |cbs| into |*out_ptr| and
* |*out_len|. If |*out_ptr| is not NULL, the contents are freed with
- * OPENSSL_free. It returns one on success and zero on allocation failure. On
- * success, |*out_ptr| should be freed with OPENSSL_free. If |cbs| is empty,
+ * free. It returns one on success and zero on allocation failure. On
+ * success, |*out_ptr| should be freed with free. If |cbs| is empty,
* |*out_ptr| will be NULL.
*/
int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len);
/*
* CBS_strdup copies the current contents of |cbs| into |*out_ptr| as a
* NUL-terminated C string. If |*out_ptr| is not NULL, the contents are freed
- * with OPENSSL_free. It returns one on success and zero on allocation
- * failure. On success, |*out_ptr| should be freed with OPENSSL_free.
+ * with free. It returns one on success and zero on allocation
+ * failure. On success, |*out_ptr| should be freed with free.
*
* NOTE: If |cbs| contains NUL bytes, the string will be truncated. Call
* |CBS_contains_zero_byte(cbs)| to check for NUL bytes.
* CBB_finish completes any pending length prefix and sets |*out_data| to a
* malloced buffer and |*out_len| to the length of that buffer. The caller
* takes ownership of the buffer and, unless the buffer was fixed with
- * |CBB_init_fixed|, must call |OPENSSL_free| when done.
+ * |CBB_init_fixed|, must call |free| when done.
*
* It can only be called on a "top level" |CBB|, i.e. one initialised with
* |CBB_init| or |CBB_init_fixed|. It returns one on success and zero on
-/* $OpenBSD: bs_ber.c,v 1.3 2015/04/29 01:31:39 doug Exp $ */
+/* $OpenBSD: bs_ber.c,v 1.4 2015/04/29 02:11:09 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
return 0;
if (CBS_len(&contents) == header_len && header_len > 0 &&
- CBS_data(&contents)[header_len-1] == 0x80) {
+ CBS_data(&contents)[header_len - 1] == 0x80) {
*ber_found = 1;
return 1;
}
-/* $OpenBSD: bs_cbs.c,v 1.6 2015/04/29 01:27:34 doug Exp $ */
+/* $OpenBSD: bs_cbs.c,v 1.7 2015/04/29 02:11:09 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
CBS_strdup(const CBS *cbs, char **out_ptr)
{
free(*out_ptr);
- *out_ptr = strndup((const char*)cbs->data, cbs->len);
+ *out_ptr = strndup((const char *)cbs->data, cbs->len);
return (*out_ptr != NULL);
}
/* Length should have used short-form encoding. */
return 0;
- if ((len32 >> ((num_bytes-1)*8)) == 0)
+ if ((len32 >> ((num_bytes - 1) * 8)) == 0)
/* Length should have been at least one byte shorter. */
return 0;
-/* $OpenBSD: bytestring.h,v 1.4 2015/02/07 06:10:32 doug Exp $ */
+/* $OpenBSD: bytestring.h,v 1.5 2015/04/29 02:11:09 doug Exp $ */
/*
* Copyright (c) 2014, Google Inc.
*
/*
* CBS_stow copies the current contents of |cbs| into |*out_ptr| and
* |*out_len|. If |*out_ptr| is not NULL, the contents are freed with
- * OPENSSL_free. It returns one on success and zero on allocation failure. On
- * success, |*out_ptr| should be freed with OPENSSL_free. If |cbs| is empty,
+ * free. It returns one on success and zero on allocation failure. On
+ * success, |*out_ptr| should be freed with free. If |cbs| is empty,
* |*out_ptr| will be NULL.
*/
int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len);
/*
* CBS_strdup copies the current contents of |cbs| into |*out_ptr| as a
* NUL-terminated C string. If |*out_ptr| is not NULL, the contents are freed
- * with OPENSSL_free. It returns one on success and zero on allocation
- * failure. On success, |*out_ptr| should be freed with OPENSSL_free.
+ * with free. It returns one on success and zero on allocation
+ * failure. On success, |*out_ptr| should be freed with free.
*
* NOTE: If |cbs| contains NUL bytes, the string will be truncated. Call
* |CBS_contains_zero_byte(cbs)| to check for NUL bytes.
* CBB_finish completes any pending length prefix and sets |*out_data| to a
* malloced buffer and |*out_len| to the length of that buffer. The caller
* takes ownership of the buffer and, unless the buffer was fixed with
- * |CBB_init_fixed|, must call |OPENSSL_free| when done.
+ * |CBB_init_fixed|, must call |free| when done.
*
* It can only be called on a "top level" |CBB|, i.e. one initialised with
* |CBB_init| or |CBB_init_fixed|. It returns one on success and zero on