]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
krb4: make a few functions static
authorDaniel Stenberg <daniel@haxx.se>
Mon, 18 Oct 2010 08:00:37 +0000 (10:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 Oct 2010 08:00:37 +0000 (10:00 +0200)
lib/krb4.c
lib/krb4.h
lib/security.c

index 2b59fec8eb8388927b05a74ae3ad28c30c6da9ae..f5199312d7e3efa665a6865e44d8e2d18da3a47c 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden).
- * Copyright (c) 2004 - 2009 Daniel Stenberg
+ * Copyright (c) 2004 - 2010 Daniel Stenberg
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -315,6 +315,14 @@ struct Curl_sec_client_mech Curl_krb4_client_mech = {
     krb4_decode
 };
 
+static enum protection_level
+krb4_set_command_prot(struct connectdata *conn, enum protection_level level)
+{
+  enum protection_level old = conn->command_prot;
+  conn->command_prot = level;
+  return old;
+}
+
 CURLcode Curl_krb_kauth(struct connectdata *conn)
 {
   des_cblock key;
@@ -329,7 +337,7 @@ CURLcode Curl_krb_kauth(struct connectdata *conn)
   CURLcode result;
   unsigned char *ptr;
 
-  save = Curl_set_command_prot(conn, prot_private);
+  save = krb4_set_command_prot(conn, prot_private);
 
   result = Curl_ftpsendf(conn, "SITE KAUTH %s", conn->user);
 
@@ -341,14 +349,14 @@ CURLcode Curl_krb_kauth(struct connectdata *conn)
     return result;
 
   if(conn->data->state.buffer[0] != '3'){
-    Curl_set_command_prot(conn, save);
+    krb4_set_command_prot(conn, save);
     return CURLE_FTP_WEIRD_SERVER_REPLY;
   }
 
   p = strstr(conn->data->state.buffer, "T=");
   if(!p) {
     Curl_failf(conn->data, "Bad reply from server");
-    Curl_set_command_prot(conn, save);
+    krb4_set_command_prot(conn, save);
     return CURLE_FTP_WEIRD_SERVER_REPLY;
   }
 
@@ -360,7 +368,7 @@ CURLcode Curl_krb_kauth(struct connectdata *conn)
   }
   if(!tmp || !ptr) {
     Curl_failf(conn->data, "Failed to decode base64 in reply");
-    Curl_set_command_prot(conn, save);
+    krb4_set_command_prot(conn, save);
     return CURLE_FTP_WEIRD_SERVER_REPLY;
   }
   memcpy((char *)tkt.dat, ptr, tmp);
@@ -371,7 +379,7 @@ CURLcode Curl_krb_kauth(struct connectdata *conn)
   p = strstr(conn->data->state.buffer, "P=");
   if(!p) {
     Curl_failf(conn->data, "Bad reply from server");
-    Curl_set_command_prot(conn, save);
+    krb4_set_command_prot(conn, save);
     return CURLE_FTP_WEIRD_SERVER_REPLY;
   }
   name = p + 2;
@@ -400,7 +408,7 @@ CURLcode Curl_krb_kauth(struct connectdata *conn)
   if(Curl_base64_encode(conn->data, (char *)tktcopy.dat, tktcopy.length, &p)
      < 1) {
     failf(conn->data, "Out of memory base64-encoding.");
-    Curl_set_command_prot(conn, save);
+    krb4_set_command_prot(conn, save);
     return CURLE_OUT_OF_MEMORY;
   }
   memset (tktcopy.dat, 0, tktcopy.length);
@@ -413,7 +421,7 @@ CURLcode Curl_krb_kauth(struct connectdata *conn)
   result = Curl_GetFTPResponse(&nread, conn, NULL);
   if(result)
     return result;
-  Curl_set_command_prot(conn, save);
+  krb4_set_command_prot(conn, save);
 
   return CURLE_OK;
 }
index 5da1dc6ef255c6d7c9120b7bd2d71c114e53f822..09e7b27a506392ba37e4cbeb859c7d8d53388953 100644 (file)
@@ -60,11 +60,6 @@ void Curl_sec_end (struct connectdata *);
 CURLcode Curl_sec_login (struct connectdata *);
 void Curl_sec_prot (int, char **);
 int Curl_sec_request_prot (struct connectdata *conn, const char *level);
-int Curl_sec_set_protection_level(struct connectdata *conn);
 void Curl_sec_status (void);
 
-enum protection_level Curl_set_command_prot(struct connectdata *,
-                                            enum protection_level);
-
-
 #endif
index 73a5540166823f344ede6e34151b45080035d883..244ab6fee58c089dddab08fe46b729127cf376fb 100644 (file)
@@ -399,16 +399,8 @@ int Curl_sec_read_msg(struct connectdata *conn, char *buffer, int level)
   return ret_code;
 }
 
-enum protection_level
-Curl_set_command_prot(struct connectdata *conn, enum protection_level level)
-{
-  enum protection_level old = conn->command_prot;
-  conn->command_prot = level;
-  return old;
-}
-
 /* FIXME: The error code returned here is never checked. */
-int Curl_sec_set_protection_level(struct connectdata *conn)
+static int sec_set_protection_level(struct connectdata *conn)
 {
   int code;
   char* pbsz;
@@ -551,7 +543,7 @@ static CURLcode choose_mech(struct connectdata *conn)
     conn->command_prot = prot_safe;
     /* Set the requested protection level */
     /* BLOCKING */
-    Curl_sec_set_protection_level(conn);
+    (void)sec_set_protection_level(conn);
     break;
   }