diff options
author | Julien Chaffraix <julien.chaffraix@gmail.com> | 2010-11-13 12:01:33 -0800 |
---|---|---|
committer | Julien Chaffraix <julien.chaffraix@gmail.com> | 2010-11-13 14:12:43 -0800 |
commit | 8d59d69449c2a86c478699a50d920541aa106201 (patch) | |
tree | 15ef9751b2d92dbd511c95d22d70ca61bdeec674 /lib/krb4.c | |
parent | 465865c3cb316907ca1c1ea813cf426a2366dce4 (diff) | |
download | curl-8d59d69449c2a86c478699a50d920541aa106201.tar.gz |
security: tighten enum protection_level usage.
While changing Curl_sec_read_msg to accept an enum protection_level
instead of an int, I went ahead and fixed the usage of the associated
fields.
Some code was assuming that prot_clear == 0. Fixed those to use the
proper value. Added assertions prior to any code that would set the
protection level.
Diffstat (limited to 'lib/krb4.c')
-rw-r--r-- | lib/krb4.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/krb4.c b/lib/krb4.c index f5199312d..8c7793102 100644 --- a/lib/krb4.c +++ b/lib/krb4.c @@ -319,6 +319,7 @@ static enum protection_level krb4_set_command_prot(struct connectdata *conn, enum protection_level level) { enum protection_level old = conn->command_prot; + DEBUGASSERT(level > prot_none && level < prot_last); conn->command_prot = level; return old; } @@ -333,7 +334,7 @@ CURLcode Curl_krb_kauth(struct connectdata *conn) char passwd[100]; size_t tmp; ssize_t nread; - int save; + enum protection_level save; CURLcode result; unsigned char *ptr; |