diff options
| author | doug <> | 2014-12-17 17:51:33 +0000 |
|---|---|---|
| committer | doug <> | 2014-12-17 17:51:33 +0000 |
| commit | 0ce257e2480d10d11cd4d46eac3ea6ca49311cf6 (patch) | |
| tree | 6b23fc9e20f81f6dc09a6fb3d8bac2a4246a7ab9 /src/lib/libtls/tls_internal.h | |
| parent | c2e399263206ba62e8c110ac855698bccb450490 (diff) | |
| download | openbsd-0ce257e2480d10d11cd4d46eac3ea6ca49311cf6.tar.gz openbsd-0ce257e2480d10d11cd4d46eac3ea6ca49311cf6.tar.bz2 openbsd-0ce257e2480d10d11cd4d46eac3ea6ca49311cf6.zip | |
Add size_t to int checks for SSL functions.
libtls accepts size_t for lengths but libssl accepts int. This verifies
that the input does not exceed INT_MAX. It also avoids truncating size_t
when comparing with int and adds printf-style attributes for
tls_set_error().
with input from deraadt@ and tedu@
ok tedu@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_internal.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h index bfd7146d7d..4b250574ef 100644 --- a/src/lib/libtls/tls_internal.h +++ b/src/lib/libtls/tls_internal.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls_internal.h,v 1.4 2014/12/07 16:56:17 bcook Exp $ */ | 1 | /* $OpenBSD: tls_internal.h,v 1.5 2014/12/17 17:51:33 doug Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
| 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| @@ -67,6 +67,8 @@ int tls_configure_keypair(struct tls *ctx); | |||
| 67 | int tls_configure_server(struct tls *ctx); | 67 | int tls_configure_server(struct tls *ctx); |
| 68 | int tls_configure_ssl(struct tls *ctx); | 68 | int tls_configure_ssl(struct tls *ctx); |
| 69 | int tls_host_port(const char *hostport, char **host, char **port); | 69 | int tls_host_port(const char *hostport, char **host, char **port); |
| 70 | int tls_set_error(struct tls *ctx, char *fmt, ...); | 70 | int tls_set_error(struct tls *ctx, char *fmt, ...) |
| 71 | __attribute__((__format__ (printf, 2, 3))) | ||
| 72 | __attribute__((__nonnull__ (2))); | ||
| 71 | 73 | ||
| 72 | #endif /* HEADER_TLS_INTERNAL_H */ | 74 | #endif /* HEADER_TLS_INTERNAL_H */ |
