Remove some code paths in crypto-length which are dead now that the
authorGreg Hudson <ghudson@mit.edu>
Fri, 4 Dec 2009 14:58:10 +0000 (14:58 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 4 Dec 2009 14:58:10 +0000 (14:58 +0000)
internal interface can't return an error.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23446 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/krb/crypto_length.c

index 91593ce742ecc1c771bf767d7a75922a4b58cc5e..3b0a9ac7fcace51aebe0219c823a80018d97b772 100644 (file)
@@ -34,7 +34,6 @@ krb5_c_crypto_length(krb5_context context, krb5_enctype enctype,
                      krb5_cryptotype type, unsigned int *size)
 {
     const struct krb5_keytypes *ktp;
-    krb5_error_code ret = 0;
 
     ktp = find_enctype(enctype);
     if (ktp == NULL)
@@ -55,11 +54,10 @@ krb5_c_crypto_length(krb5_context context, krb5_enctype enctype,
         *size = ktp->crypto_length(ktp, type);
         break;
     default:
-        ret = EINVAL;
-        break;
+        return EINVAL;
     }
 
-    return ret;
+    return 0;
 }
 
 krb5_error_code KRB5_CALLCONV
@@ -80,7 +78,6 @@ krb5_error_code KRB5_CALLCONV
 krb5_c_crypto_length_iov(krb5_context context, krb5_enctype enctype,
                          krb5_crypto_iov *data, size_t num_data)
 {
-    krb5_error_code ret = 0;
     size_t i;
     const struct krb5_keytypes *ktp;
     unsigned int data_length = 0, pad_length;
@@ -118,14 +115,8 @@ krb5_c_crypto_length_iov(krb5_context context, krb5_enctype enctype,
         default:
             break;
         }
-
-        if (ret != 0)
-            break;
     }
 
-    if (ret != 0)
-        return ret;
-
     pad_length = krb5int_c_padding_length(ktp, data_length);
     if (pad_length != 0 && padding == NULL)
         return EINVAL;