summaryrefslogtreecommitdiff
path: root/include/openssl/buffer.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-11-10 18:36:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-11-10 18:36:08 +0300
commitd34a80f41a4bdae108d5f77e3397bc893fbacf6e (patch)
treea7e3500c16d2867c6ac657952fb11286606f8913 /include/openssl/buffer.h
parent75b344c4c8b4148602279b51bc2cc5d45b03c324 (diff)
update to openssl headers from version 1.0.2m
Diffstat (limited to 'include/openssl/buffer.h')
-rw-r--r--include/openssl/buffer.h64
1 files changed, 35 insertions, 29 deletions
diff --git a/include/openssl/buffer.h b/include/openssl/buffer.h
index ea1c3ec669..eab0d1ebc0 100644
--- a/include/openssl/buffer.h
+++ b/include/openssl/buffer.h
@@ -57,46 +57,52 @@
*/
#ifndef HEADER_BUFFER_H
-#define HEADER_BUFFER_H
+# define HEADER_BUFFER_H
-#include <openssl/ossl_typ.h>
+# include <openssl/ossl_typ.h>
#ifdef __cplusplus
extern "C" {
#endif
-#include <stddef.h>
+# include <stddef.h>
-#if !defined(NO_SYS_TYPES_H)
-#include <sys/types.h>
-#endif
+# if !defined(NO_SYS_TYPES_H)
+# include <sys/types.h>
+# endif
/* Already declared in ossl_typ.h */
/* typedef struct buf_mem_st BUF_MEM; */
-struct buf_mem_st
- {
- size_t length; /* current number of bytes */
- char *data;
- size_t max; /* size of buffer */
- };
+struct buf_mem_st {
+ size_t length; /* current number of bytes */
+ char *data;
+ size_t max; /* size of buffer */
+};
BUF_MEM *BUF_MEM_new(void);
-void BUF_MEM_free(BUF_MEM *a);
-int BUF_MEM_grow(BUF_MEM *str, size_t len);
-int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
-char * BUF_strdup(const char *str);
-char * BUF_strndup(const char *str, size_t siz);
-void * BUF_memdup(const void *data, size_t siz);
-void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
+void BUF_MEM_free(BUF_MEM *a);
+int BUF_MEM_grow(BUF_MEM *str, size_t len);
+int BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
+size_t BUF_strnlen(const char *str, size_t maxlen);
+char *BUF_strdup(const char *str);
-/* safe string functions */
-size_t BUF_strlcpy(char *dst,const char *src,size_t siz);
-size_t BUF_strlcat(char *dst,const char *src,size_t siz);
+/*
+ * Like strndup, but in addition, explicitly guarantees to never read past the
+ * first |siz| bytes of |str|.
+ */
+char *BUF_strndup(const char *str, size_t siz);
+void *BUF_memdup(const void *data, size_t siz);
+void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
+
+/* safe string functions */
+size_t BUF_strlcpy(char *dst, const char *src, size_t siz);
+size_t BUF_strlcat(char *dst, const char *src, size_t siz);
/* BEGIN ERROR CODES */
-/* The following lines are auto generated by the script mkerr.pl. Any changes
+/*
+ * The following lines are auto generated by the script mkerr.pl. Any changes
* made after this point may be overwritten when the script is next run.
*/
void ERR_load_BUF_strings(void);
@@ -104,12 +110,12 @@ void ERR_load_BUF_strings(void);
/* Error codes for the BUF functions. */
/* Function codes. */
-#define BUF_F_BUF_MEMDUP 103
-#define BUF_F_BUF_MEM_GROW 100
-#define BUF_F_BUF_MEM_GROW_CLEAN 105
-#define BUF_F_BUF_MEM_NEW 101
-#define BUF_F_BUF_STRDUP 102
-#define BUF_F_BUF_STRNDUP 104
+# define BUF_F_BUF_MEMDUP 103
+# define BUF_F_BUF_MEM_GROW 100
+# define BUF_F_BUF_MEM_GROW_CLEAN 105
+# define BUF_F_BUF_MEM_NEW 101
+# define BUF_F_BUF_STRDUP 102
+# define BUF_F_BUF_STRNDUP 104
/* Reason codes. */