Skip to content

Commit

Permalink
Merge branch '1-missing-bio_-read-write-functions' into 'master'
Browse files Browse the repository at this point in the history
Uncomment some of the code.

Closes #1

See merge request dokutoku/libressl-d!2
  • Loading branch information
dokutoku committed Apr 11, 2021
2 parents 7ed0ae9 + 949ac08 commit 6cd7d37
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 75 deletions.
44 changes: 11 additions & 33 deletions source/libressl_d/openssl/bio.d
Expand Up @@ -868,20 +868,14 @@ int BIO_get_shutdown(.BIO* a);
void BIO_set_shutdown(.BIO* a, int shut);
void BIO_vfree(.BIO* a);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int BIO_read(.BIO* b, void* data, int len)
+/
int BIO_read(.BIO* b, void* data, int len);

/+
//__attribute__((__bounded__(__string__, 2, 3)));
int BIO_gets(.BIO* bp, char* buf, int size)
+/
int BIO_gets(.BIO* bp, char* buf, int size);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int BIO_write(.BIO* b, const (void)* data, int len)
+/
int BIO_write(.BIO* b, const (void)* data, int len);

int BIO_puts(.BIO* bp, const (char)* buf);
int BIO_indent(.BIO* b, int indent, int max);
Expand Down Expand Up @@ -974,45 +968,29 @@ void BIO_copy_next_retry(.BIO* b);
/*core.stdc.config.c_long BIO_ghbn_ctrl(int cmd, int iarg, char* arg); */

//#if defined(__MINGW_PRINTF_FORMAT)
/+
//__attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 3), __nonnull__(2)));
int BIO_printf(.BIO* bio, const (char)* format, ...)
+/
int BIO_printf(.BIO* bio, const (char)* format, ...);

/+
//__attribute__((__format__(__MINGW_PRINTF_FORMAT, 2, 0), __nonnull__(2)));
int BIO_vprintf(.BIO* bio, const (char)* format, core.stdc.stdarg.va_list args)
+/
int BIO_vprintf(.BIO* bio, const (char)* format, core.stdc.stdarg.va_list args);

/+
//__attribute__((__deprecated__, __format__(__MINGW_PRINTF_FORMAT, 3, 4), __nonnull__(3)));
int BIO_snprintf(char* buf, size_t n, const (char)* format, ...)
+/
int BIO_snprintf(char* buf, size_t n, const (char)* format, ...);

/+
//__attribute__((__deprecated__, __format__(__MINGW_PRINTF_FORMAT, 3, 0), __nonnull__(3)));
int BIO_vsnprintf(char* buf, size_t n, const (char)* format, core.stdc.stdarg.va_list args)
+/
int BIO_vsnprintf(char* buf, size_t n, const (char)* format, core.stdc.stdarg.va_list args);
//#else
/+
//__attribute__((__format__(__printf__, 2, 3), __nonnull__(2)));
int BIO_printf(.BIO* bio, const (char)* format, ...)
+/
int BIO_printf(.BIO* bio, const (char)* format, ...);

/+
//__attribute__((__format__(__printf__, 2, 0), __nonnull__(2)));
int BIO_vprintf(.BIO* bio, const (char)* format, core.stdc.stdarg.va_list args)
+/
int BIO_vprintf(.BIO* bio, const (char)* format, core.stdc.stdarg.va_list args);

/+
//__attribute__((__deprecated__, __format__(__printf__, 3, 4), __nonnull__(3)));
int BIO_snprintf(char* buf, size_t n, const (char)* format, ...)
+/
int BIO_snprintf(char* buf, size_t n, const (char)* format, ...);

/+
//__attribute__((__deprecated__, __format__(__printf__, 3, 0), __nonnull__(3)));
int BIO_vsnprintf(char* buf, size_t n, const (char)* format, core.stdc.stdarg.va_list args)
+/
int BIO_vsnprintf(char* buf, size_t n, const (char)* format, core.stdc.stdarg.va_list args);
//#endif

/* BEGIN ERROR CODES */
Expand Down
8 changes: 2 additions & 6 deletions source/libressl_d/openssl/buffer.d
Expand Up @@ -103,15 +103,11 @@ void BUF_reverse(ubyte* out_, const (ubyte)* in_, size_t siz);

/* safe string functions */

/+
//__attribute__((__bounded__(__string__, 1, 3)));
size_t BUF_strlcpy(char* dst, const (char)* src, size_t siz)
+/
size_t BUF_strlcpy(char* dst, const (char)* src, size_t siz);

/+
//__attribute__((__bounded__(__string__, 1, 3)));
size_t BUF_strlcat(char* dst, const (char)* src, size_t siz)
+/
size_t BUF_strlcat(char* dst, const (char)* src, size_t siz);
//#endif

/* BEGIN ERROR CODES */
Expand Down
8 changes: 2 additions & 6 deletions source/libressl_d/openssl/md5.d
Expand Up @@ -101,16 +101,12 @@ alias MD5_CTX = .MD5state_st;

int MD5_Init(.MD5_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int MD5_Update(.MD5_CTX* c, const (void)* data, size_t len)
+/
int MD5_Update(.MD5_CTX* c, const (void)* data, size_t len);

int MD5_Final(ubyte* md, .MD5_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 1, 2)));
ubyte* MD5(const (ubyte)* d, size_t n, ubyte* md)
+/
ubyte* MD5(const (ubyte)* d, size_t n, ubyte* md);

void MD5_Transform(.MD5_CTX* c, const (ubyte)* b);
40 changes: 10 additions & 30 deletions source/libressl_d/openssl/sha.d
Expand Up @@ -111,17 +111,13 @@ alias SHA_CTX = SHAstate_st;
//#if !defined(OPENSSL_NO_SHA1)
int SHA1_Init(.SHA_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int SHA1_Update(.SHA_CTX* c, const (void)* data, size_t len)
+/
int SHA1_Update(.SHA_CTX* c, const (void)* data, size_t len);

int SHA1_Final(ubyte* md, .SHA_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 1, 2)));
ubyte* SHA1(const (ubyte)* d, size_t n, ubyte* md)
+/
ubyte* SHA1(const (ubyte)* d, size_t n, ubyte* md);

void SHA1_Transform(.SHA_CTX* c, const (ubyte)* data);
//#endif
Expand Down Expand Up @@ -151,31 +147,23 @@ alias SHA256_CTX = .SHA256state_st;
//#if !defined(OPENSSL_NO_SHA256)
int SHA224_Init(.SHA256_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int SHA224_Update(.SHA256_CTX* c, const (void)* data, size_t len)
+/
int SHA224_Update(.SHA256_CTX* c, const (void)* data, size_t len);

int SHA224_Final(ubyte* md, .SHA256_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 1, 2)));
ubyte* SHA224(const (ubyte)* d, size_t n, ubyte* md)
+/
ubyte* SHA224(const (ubyte)* d, size_t n, ubyte* md);

int SHA256_Init(.SHA256_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int SHA256_Update(.SHA256_CTX* c, const (void)* data, size_t len)
+/
int SHA256_Update(.SHA256_CTX* c, const (void)* data, size_t len);

int SHA256_Final(ubyte* md, .SHA256_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 1, 2)));
ubyte* SHA256(const (ubyte)* d, size_t n, ubyte* md)
+/
ubyte* SHA256(const (ubyte)* d, size_t n, ubyte* md);

void SHA256_Transform(.SHA256_CTX* c, const (ubyte)* data);
//#endif
Expand Down Expand Up @@ -222,31 +210,23 @@ alias SHA512_CTX = .SHA512state_st;
//#if !defined(OPENSSL_NO_SHA512)
int SHA384_Init(.SHA512_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int SHA384_Update(.SHA512_CTX* c, const (void)* data, size_t len)
+/
int SHA384_Update(.SHA512_CTX* c, const (void)* data, size_t len);

int SHA384_Final(ubyte* md, .SHA512_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 1, 2)));
ubyte* SHA384(const (ubyte)* d, size_t n, ubyte* md)
+/
ubyte* SHA384(const (ubyte)* d, size_t n, ubyte* md);

int SHA512_Init(.SHA512_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 2, 3)));
int SHA512_Update(.SHA512_CTX* c, const (void)* data, size_t len)
+/
int SHA512_Update(.SHA512_CTX* c, const (void)* data, size_t len);

int SHA512_Final(ubyte* md, .SHA512_CTX* c);

/+
//__attribute__((__bounded__(__buffer__, 1, 2)));
ubyte* SHA512(const (ubyte)* d, size_t n, ubyte* md)
+/
ubyte* SHA512(const (ubyte)* d, size_t n, ubyte* md);

void SHA512_Transform(.SHA512_CTX* c, const (ubyte)* data);
//#endif

0 comments on commit 6cd7d37

Please sign in to comment.