diff options
author | Zhanna Tsitkov <tsitkova@mit.edu> | 2009-10-28 18:12:38 +0000 |
---|---|---|
committer | Zhanna Tsitkov <tsitkova@mit.edu> | 2009-10-28 18:12:38 +0000 |
commit | c60792b08a48ec497e541917d7fea953d59f5612 (patch) | |
tree | b27bbd6a72c985474c74b7a4b2b8ed80015d468f | |
parent | ca0304526a518b2419eee3c0aad569b50d9009ef (diff) | |
download | krb5-c60792b08a48ec497e541917d7fea953d59f5612.zip krb5-c60792b08a48ec497e541917d7fea953d59f5612.tar.gz krb5-c60792b08a48ec497e541917d7fea953d59f5612.tar.bz2 |
Replace krb5_ with krb5Int_ prefix for non-API functions
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23079 dc483132-0cff-0310-8789-dd5450dbe970
73 files changed, 321 insertions, 309 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 858b9bd..9217174 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -756,11 +756,11 @@ struct krb5_aead_provider { * in here to deal with stuff from lib/crypto */ -void krb5_nfold +void krb5int_nfold (unsigned int inbits, const unsigned char *in, unsigned int outbits, unsigned char *out); -krb5_error_code krb5_hmac +krb5_error_code krb5int_hmac (const struct krb5_hash_provider *hash, krb5_key key, unsigned int icount, const krb5_data *input, krb5_data *output); @@ -2227,7 +2227,7 @@ typedef struct _krb5int_access { /* crypto stuff */ const struct krb5_hash_provider *md5_hash_provider; const struct krb5_enc_provider *arcfour_enc_provider; - krb5_error_code (* krb5_hmac) (const struct krb5_hash_provider *hash, + krb5_error_code (* krb5int_hmac) (const struct krb5_hash_provider *hash, const krb5_keyblock *key, unsigned int icount, const krb5_data *input, krb5_data *output); @@ -2644,7 +2644,7 @@ typedef struct krb5_boolean krb5_is_permitted_enctype_ext ( krb5_context, krb5_etypes_permitted *); -krb5_boolean KRB5_CALLCONV krb5_c_weak_enctype(krb5_enctype); +krb5_boolean KRB5_CALLCONV krb5int_c_weak_enctype(krb5_enctype); krb5_error_code krb5_kdc_rep_decrypt_proc (krb5_context, diff --git a/src/lib/crypto/builtin/aes/aes_s2k.c b/src/lib/crypto/builtin/aes/aes_s2k.c index 76d73c6..14c7726 100644 --- a/src/lib/crypto/builtin/aes/aes_s2k.c +++ b/src/lib/crypto/builtin/aes/aes_s2k.c @@ -81,7 +81,7 @@ krb5int_aes_string_to_key(const struct krb5_enc_provider *enc, if (err) goto cleanup; - err = krb5_derive_keyblock (enc, tempkey, key, &usage); + err = krb5int_derive_keyblock (enc, tempkey, key, &usage); cleanup: if (err) diff --git a/src/lib/crypto/builtin/arcfour/arcfour.c b/src/lib/crypto/builtin/arcfour/arcfour.c index ad7ccec..ff2f437 100644 --- a/src/lib/crypto/builtin/arcfour/arcfour.c +++ b/src/lib/crypto/builtin/arcfour/arcfour.c @@ -13,7 +13,7 @@ of RSA Data Security) const char *const krb5int_arcfour_l40 = "fortybits"; void -krb5_arcfour_encrypt_length(const struct krb5_enc_provider *enc, +krb5int_arcfour_encrypt_length(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t inputlen, size_t *length) { @@ -62,7 +62,7 @@ case 7: /* tgs-req authenticator */ } krb5_error_code -krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, +krb5int_arcfour_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, @@ -148,7 +148,7 @@ krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, salt.length=4; store_32_le(ms_usage, salt.data); } - krb5_hmac(hash, key, 1, &salt, &d1); + krb5int_hmac(hash, key, 1, &salt, &d1); memcpy(k2.contents, k1.contents, k2.length); @@ -192,7 +192,7 @@ krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, /* This is the arcfour-hmac decryption routine */ krb5_error_code -krb5_arcfour_decrypt(const struct krb5_enc_provider *enc, +krb5int_arcfour_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, @@ -275,7 +275,7 @@ krb5_arcfour_decrypt(const struct krb5_enc_provider *enc, salt.length = 4; store_32_le(ms_usage, salt.data); } - ret = krb5_hmac(hash, key, 1, &salt, &d1); + ret = krb5int_hmac(hash, key, 1, &salt, &d1); if (ret) goto cleanup; diff --git a/src/lib/crypto/builtin/arcfour/arcfour.h b/src/lib/crypto/builtin/arcfour/arcfour.h index 1a28764..e00708a 100644 --- a/src/lib/crypto/builtin/arcfour/arcfour.h +++ b/src/lib/crypto/builtin/arcfour/arcfour.h @@ -2,13 +2,13 @@ #define ARCFOUR_H extern void -krb5_arcfour_encrypt_length(const struct krb5_enc_provider *, +krb5int_arcfour_encrypt_length(const struct krb5_enc_provider *, const struct krb5_hash_provider *, size_t, size_t *); -extern -krb5_error_code krb5_arcfour_encrypt(const struct krb5_enc_provider *, +extern krb5_error_code +krb5int_arcfour_encrypt(const struct krb5_enc_provider *, const struct krb5_hash_provider *, krb5_key, krb5_keyusage, @@ -16,8 +16,8 @@ krb5_error_code krb5_arcfour_encrypt(const struct krb5_enc_provider *, const krb5_data *, krb5_data *); -extern -krb5_error_code krb5_arcfour_decrypt(const struct krb5_enc_provider *, +extern krb5_error_code +krb5int_arcfour_decrypt(const struct krb5_enc_provider *, const struct krb5_hash_provider *, krb5_key, krb5_keyusage, @@ -25,7 +25,8 @@ krb5_error_code krb5_arcfour_decrypt(const struct krb5_enc_provider *, const krb5_data *, krb5_data *); -extern krb5_error_code krb5int_arcfour_string_to_key( +extern krb5_error_code +krb5int_arcfour_string_to_key( const struct krb5_enc_provider *, const krb5_data *, const krb5_data *, diff --git a/src/lib/crypto/builtin/arcfour/arcfour_aead.c b/src/lib/crypto/builtin/arcfour/arcfour_aead.c index 4896afa..c01fc00 100644 --- a/src/lib/crypto/builtin/arcfour/arcfour_aead.c +++ b/src/lib/crypto/builtin/arcfour/arcfour_aead.c @@ -152,7 +152,7 @@ krb5int_arcfour_encrypt_iov(const struct krb5_aead_provider *aead, salt.length = 4; store_32_le(ms_usage, salt.data); } - ret = krb5_hmac(hash, key, 1, &salt, &d1); + ret = krb5int_hmac(hash, key, 1, &salt, &d1); if (ret != 0) goto cleanup; @@ -272,7 +272,7 @@ krb5int_arcfour_decrypt_iov(const struct krb5_aead_provider *aead, salt.length = 4; store_32_le(ms_usage, (unsigned char *)salt.data); } - ret = krb5_hmac(hash, key, 1, &salt, &d1); + ret = krb5int_hmac(hash, key, 1, &salt, &d1); if (ret != 0) goto cleanup; diff --git a/src/lib/crypto/builtin/arcfour/arcfour_s2k.c b/src/lib/crypto/builtin/arcfour/arcfour_s2k.c index 41053ed..09c9b76 100644 --- a/src/lib/crypto/builtin/arcfour/arcfour_s2k.c +++ b/src/lib/crypto/builtin/arcfour/arcfour_s2k.c @@ -35,9 +35,9 @@ krb5int_arcfour_string_to_key(const struct krb5_enc_provider *enc, return err; /* the actual MD4 hash of the data */ - krb5_MD4Init(&md4_context); - krb5_MD4Update(&md4_context, copystr, copystrlen); - krb5_MD4Final(&md4_context); + krb5int_MD4Init(&md4_context); + krb5int_MD4Update(&md4_context, copystr, copystrlen); + krb5int_MD4Final(&md4_context); memcpy(key->contents, md4_context.digest, 16); #if 0 diff --git a/src/lib/crypto/builtin/hash_provider/hash_md4.c b/src/lib/crypto/builtin/hash_provider/hash_md4.c index f507aaa..3a4a4d5 100644 --- a/src/lib/crypto/builtin/hash_provider/hash_md4.c +++ b/src/lib/crypto/builtin/hash_provider/hash_md4.c @@ -38,10 +38,10 @@ k5_md4_hash(unsigned int icount, const krb5_data *input, if (output->length != RSA_MD4_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); - krb5_MD4Init(&ctx); + krb5int_MD4Init(&ctx); for (i=0; i<icount; i++) - krb5_MD4Update(&ctx, (unsigned char *) input[i].data, input[i].length); - krb5_MD4Final(&ctx); + krb5int_MD4Update(&ctx, (unsigned char *) input[i].data, input[i].length); + krb5int_MD4Final(&ctx); memcpy(output->data, ctx.digest, RSA_MD4_CKSUM_LENGTH); diff --git a/src/lib/crypto/builtin/hash_provider/hash_md5.c b/src/lib/crypto/builtin/hash_provider/hash_md5.c index a6e380a..10840d0 100644 --- a/src/lib/crypto/builtin/hash_provider/hash_md5.c +++ b/src/lib/crypto/builtin/hash_provider/hash_md5.c @@ -38,10 +38,10 @@ k5_md5_hash(unsigned int icount, const krb5_data *input, if (output->length != RSA_MD5_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); - krb5_MD5Init(&ctx); + krb5int_MD5Init(&ctx); for (i=0; i<icount; i++) - krb5_MD5Update(&ctx, (unsigned char *) input[i].data, input[i].length); - krb5_MD5Final(&ctx); + krb5int_MD5Update(&ctx, (unsigned char *) input[i].data, input[i].length); + krb5int_MD5Final(&ctx); memcpy(output->data, ctx.digest, RSA_MD5_CKSUM_LENGTH); diff --git a/src/lib/crypto/builtin/hmac.c b/src/lib/crypto/builtin/hmac.c index 6726a08..d1be17e 100644 --- a/src/lib/crypto/builtin/hmac.c +++ b/src/lib/crypto/builtin/hmac.c @@ -178,7 +178,7 @@ krb5int_hmac_iov_keyblock(const struct krb5_hash_provider *hash, } krb5_error_code -krb5_hmac(const struct krb5_hash_provider *hash, krb5_key key, +krb5int_hmac(const struct krb5_hash_provider *hash, krb5_key key, unsigned int icount, const krb5_data *input, krb5_data *output) { return krb5int_hmac_keyblock(hash, &key->keyblock, icount, input, output); diff --git a/src/lib/crypto/builtin/md4/md4.c b/src/lib/crypto/builtin/md4/md4.c index 7922c71..b36a476 100644 --- a/src/lib/crypto/builtin/md4/md4.c +++ b/src/lib/crypto/builtin/md4/md4.c @@ -76,7 +76,7 @@ static const unsigned char PADDING[64] = { (a) = ROTATE_LEFT ((a), (s));} void -krb5_MD4Init (krb5_MD4_CTX *mdContext) +krb5int_MD4Init (krb5_MD4_CTX *mdContext) { mdContext->i[0] = mdContext->i[1] = (krb5_ui_4)0; @@ -89,7 +89,7 @@ krb5_MD4Init (krb5_MD4_CTX *mdContext) } void -krb5_MD4Update (krb5_MD4_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) +krb5int_MD4Update (krb5_MD4_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) { krb5_ui_4 in[16]; int mdi; @@ -120,7 +120,7 @@ krb5_MD4Update (krb5_MD4_CTX *mdContext, const unsigned char *inBuf, unsigned in } void -krb5_MD4Final (krb5_MD4_CTX *mdContext) +krb5int_MD4Final (krb5_MD4_CTX *mdContext) { krb5_ui_4 in[16]; int mdi; @@ -136,7 +136,7 @@ krb5_MD4Final (krb5_MD4_CTX *mdContext) /* pad out to 56 mod 64 */ padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); - krb5_MD4Update (mdContext, PADDING, padLen); + krb5int_MD4Update (mdContext, PADDING, padLen); /* append length in bits and transform */ for (i = 0, ii = 0; i < 14; i++, ii += 4) diff --git a/src/lib/crypto/builtin/md4/rsa-md4.h b/src/lib/crypto/builtin/md4/rsa-md4.h index d4e6f6b..f4272d5 100644 --- a/src/lib/crypto/builtin/md4/rsa-md4.h +++ b/src/lib/crypto/builtin/md4/rsa-md4.h @@ -82,9 +82,9 @@ typedef struct { unsigned char digest[16]; /* actual digest after MD4Final call */ } krb5_MD4_CTX; -extern void krb5_MD4Init(krb5_MD4_CTX *); -extern void krb5_MD4Update(krb5_MD4_CTX *, const unsigned char *, unsigned int); -extern void krb5_MD4Final(krb5_MD4_CTX *); +extern void krb5int_MD4Init(krb5_MD4_CTX *); +extern void krb5int_MD4Update(krb5_MD4_CTX *, const unsigned char *, unsigned int); +extern void krb5int_MD4Final(krb5_MD4_CTX *); /* ********************************************************************** diff --git a/src/lib/crypto/builtin/md5/md5.c b/src/lib/crypto/builtin/md5/md5.c index e548dbc..8f04be4 100644 --- a/src/lib/crypto/builtin/md5/md5.c +++ b/src/lib/crypto/builtin/md5/md5.c @@ -42,9 +42,9 @@ *********************************************************************** ** Message-digest routines: ** ** To form the message digest for a message M ** - ** (1) Initialize a context buffer mdContext using krb5_MD5Init ** - ** (2) Call krb5_MD5Update on mdContext and M ** - ** (3) Call krb5_MD5Final on mdContext ** + ** (1) Initialize a context buffer mdContext using krb5int_MD5Init ** + ** (2) Call krb5int_MD5Update on mdContext and M ** + ** (3) Call krb5int_MD5Final on mdContext ** ** The message digest is now in mdContext->digest[0...15] ** *********************************************************************** */ @@ -103,11 +103,11 @@ static const unsigned char PADDING[64] = { (a) &= 0xffffffff; \ } -/* The routine krb5_MD5Init initializes the message-digest context +/* The routine krb5int_MD5Init initializes the message-digest context mdContext. All fields are set to zero. */ void -krb5_MD5Init (krb5_MD5_CTX *mdContext) +krb5int_MD5Init (krb5_MD5_CTX *mdContext) { mdContext->i[0] = mdContext->i[1] = (krb5_ui_4)0; @@ -119,12 +119,12 @@ krb5_MD5Init (krb5_MD5_CTX *mdContext) mdContext->buf[3] = 0x10325476UL; } -/* The routine krb5_MD5Update updates the message-digest context to +/* The routine krb5int_MD5Update updates the message-digest context to account for the presence of each of the characters inBuf[0..inLen-1] in the message whose digest is being computed. */ void -krb5_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) +krb5int_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) { krb5_ui_4 in[16]; int mdi; @@ -153,11 +153,11 @@ krb5_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned in } } -/* The routine krb5_MD5Final terminates the message-digest computation and +/* The routine krb5int_MD5Final terminates the message-digest computation and ends with the desired message digest in mdContext->digest[0...15]. */ void -krb5_MD5Final (krb5_MD5_CTX *mdContext) +krb5int_MD5Final (krb5_MD5_CTX *mdContext) { krb5_ui_4 in[16]; int mdi; @@ -173,7 +173,7 @@ krb5_MD5Final (krb5_MD5_CTX *mdContext) /* pad out to 56 mod 64 */ padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); - krb5_MD5Update (mdContext, PADDING, padLen); + krb5int_MD5Update (mdContext, PADDING, padLen); /* append length in bits and transform */ for (i = 0, ii = 0; i < 14; i++, ii += 4) diff --git a/src/lib/crypto/builtin/md5/rsa-md5.h b/src/lib/crypto/builtin/md5/rsa-md5.h index 846b238..938b22d 100644 --- a/src/lib/crypto/builtin/md5/rsa-md5.h +++ b/src/lib/crypto/builtin/md5/rsa-md5.h @@ -48,9 +48,9 @@ typedef struct { unsigned char digest[16]; /* actual digest after MD5Final call */ } krb5_MD5_CTX; -extern void krb5_MD5Init(krb5_MD5_CTX *); -extern void krb5_MD5Update(krb5_MD5_CTX *,const unsigned char *,unsigned int); -extern void krb5_MD5Final(krb5_MD5_CTX *); +extern void krb5int_MD5Init(krb5_MD5_CTX *); +extern void krb5int_MD5Update(krb5_MD5_CTX *,const unsigned char *,unsigned int); +extern void krb5int_MD5Final(krb5_MD5_CTX *); #define RSA_MD5_CKSUM_LENGTH 16 #define OLD_RSA_MD5_DES_CKSUM_LENGTH 16 diff --git a/src/lib/crypto/builtin/pbkdf2.c b/src/lib/crypto/builtin/pbkdf2.c index 9201e23..96409ba 100644 --- a/src/lib/crypto/builtin/pbkdf2.c +++ b/src/lib/crypto/builtin/pbkdf2.c @@ -223,7 +223,7 @@ hmac_sha1(krb5_key pass, krb5_data *salt, krb5_data *out) if (debug_hmac) printd(" hmac input", salt); - err = krb5_hmac(h, pass, 1, salt, out); + err = krb5int_hmac(h, pass, 1, salt, out); if (err == 0 && debug_hmac) printd(" hmac output", out); return err; diff --git a/src/lib/crypto/crypto_tests/t_mddriver.c b/src/lib/crypto/crypto_tests/t_mddriver.c index d894aaa..2c0210c 100644 --- a/src/lib/crypto/crypto_tests/t_mddriver.c +++ b/src/lib/crypto/crypto_tests/t_mddriver.c @@ -58,9 +58,9 @@ struct md_test_entry { #if MD == 4 #define MD_CTX krb5_MD4_CTX -#define MDInit krb5_MD4Init -#define MDUpdate krb5_MD4Update -#define MDFinal krb5_MD4Final +#define MDInit krb5int_MD4Init +#define MDUpdate krb5int_MD4Update +#define MDFinal krb5int_MD4Final #define HAVE_TEST_SUITE /* Test suite from RFC 1320 */ @@ -94,9 +94,9 @@ struct md_test_entry md_test_suite[] = { #if MD == 5 #define MD_CTX krb5_MD5_CTX -#define MDInit krb5_MD5Init -#define MDUpdate krb5_MD5Update -#define MDFinal krb5_MD5Final +#define MDInit krb5int_MD5Init +#define MDUpdate krb5int_MD5Update +#define MDFinal krb5int_MD5Final #define HAVE_TEST_SUITE /* Test suite from RFC 1321 */ diff --git a/src/lib/crypto/crypto_tests/t_nfold.c b/src/lib/crypto/crypto_tests/t_nfold.c index 6be0a09..2b5b0e3 100644 --- a/src/lib/crypto/crypto_tests/t_nfold.c +++ b/src/lib/crypto/crypto_tests/t_nfold.c @@ -82,7 +82,7 @@ static void rfc_tests () for (i = 0; i < ASIZE (tests); i++) { unsigned char *p = (unsigned char *) tests[i].input; assert (tests[i].n / 8 <= sizeof (outbuf)); - krb5_nfold (8 * strlen ((char *) p), p, tests[i].n, outbuf); + krb5int_nfold (8 * strlen ((char *) p), p, tests[i].n, outbuf); printf ("%d-fold(\"%s\") =\n", tests[i].n, p); printf ("%d-fold(", tests[i].n); printstringhex (p); @@ -106,7 +106,7 @@ static void fold_kerberos(unsigned int nbytes) abort(); printf("%d-fold(\"kerberos\") =\n\t", nbytes*8); - krb5_nfold(64, (unsigned char *) "kerberos", 8*nbytes, cipher_text); + krb5int_nfold(64, (unsigned char *) "kerberos", 8*nbytes, cipher_text); for (j=0; j<nbytes; j++) printf("%s%02x", (j&3) ? "" : " ", cipher_text[j]); printf("\n"); @@ -142,7 +142,7 @@ main(argc, argv) printf("\tInput:\t\"%.*s\"\n", (int) strlen((char *) nfold_in[i]), nfold_in[i]); printf("\t192-Fold:\t"); - krb5_nfold(strlen((char *) nfold_in[i])*8, nfold_in[i], 24*8, + krb5int_nfold(strlen((char *) nfold_in[i])*8, nfold_in[i], 24*8, cipher_text); for (j=0; j<24; j++) printf("%s%02x", (j&3) ? "" : " ", cipher_text[j]); diff --git a/src/lib/crypto/crypto_tests/vectors.c b/src/lib/crypto/crypto_tests/vectors.c index 64a5071..e4a46be 100644 --- a/src/lib/crypto/crypto_tests/vectors.c +++ b/src/lib/crypto/crypto_tests/vectors.c @@ -78,7 +78,7 @@ static void test_nfold () printf ("%d-fold(", tests[i].n); printstringhex (p); printf (") =\n\t"); - krb5_nfold (8 * strlen (p), p, tests[i].n, outbuf); + krb5int_nfold (8 * strlen (p), p, tests[i].n, outbuf); printhex (tests[i].n / 8U, outbuf); printf ("\n\n"); } @@ -218,7 +218,7 @@ void DK (krb5_keyblock *out, krb5_keyblock *in, const krb5_data *usage) { void DR (krb5_data *out, krb5_keyblock *in, const krb5_data *usage) { krb5_error_code r; - r = krb5_derive_random (enc, in, out, usage); + r = krb5int_derive_random (enc, in, out, usage); CHECK; } diff --git a/src/lib/crypto/krb/aead.c b/src/lib/crypto/krb/aead.c index 3b11da5..fd9a50e 100644 --- a/src/lib/crypto/krb/aead.c +++ b/src/lib/crypto/krb/aead.c @@ -147,15 +147,15 @@ krb5int_c_find_checksum_type(krb5_cksumtype cksumtype) { size_t i; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == cksumtype) + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == cksumtype) break; } - if (i == krb5_cksumtypes_length) + if (i == krb5int_cksumtypes_length) return NULL; - return &krb5_cksumtypes_list[i]; + return &krb5int_cksumtypes_list[i]; } #ifdef DEBUG_IOV diff --git a/src/lib/crypto/krb/checksum_length.c b/src/lib/crypto/krb/checksum_length.c index 1af4d17..aeb057c 100644 --- a/src/lib/crypto/krb/checksum_length.c +++ b/src/lib/crypto/krb/checksum_length.c @@ -33,20 +33,20 @@ krb5_c_checksum_length(krb5_context context, krb5_cksumtype cksumtype, { unsigned int i; - for (i=0; i<krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == cksumtype) + for (i=0; i<krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == cksumtype) break; } - if (i == krb5_cksumtypes_length) + if (i == krb5int_cksumtypes_length) return KRB5_BAD_ENCTYPE; - if (krb5_cksumtypes_list[i].keyhash) - *length = krb5_cksumtypes_list[i].keyhash->hashsize; - else if (krb5_cksumtypes_list[i].trunc_size) - *length = krb5_cksumtypes_list[i].trunc_size; + if (krb5int_cksumtypes_list[i].keyhash) + *length = krb5int_cksumtypes_list[i].keyhash->hashsize; + else if (krb5int_cksumtypes_list[i].trunc_size) + *length = krb5int_cksumtypes_list[i].trunc_size; else - *length = krb5_cksumtypes_list[i].hash->hashsize; + *length = krb5int_cksumtypes_list[i].hash->hashsize; return 0; } diff --git a/src/lib/crypto/krb/cksumtype_to_string.c b/src/lib/crypto/krb/cksumtype_to_string.c index 82e0702..d974766 100644 --- a/src/lib/crypto/krb/cksumtype_to_string.c +++ b/src/lib/crypto/krb/cksumtype_to_string.c @@ -32,9 +32,9 @@ krb5_cksumtype_to_string(krb5_cksumtype cksumtype, char *buffer, size_t buflen) { unsigned int i; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == cksumtype) { - if (strlcpy(buffer, krb5_cksumtypes_list[i].out_string, + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == cksumtype) { + if (strlcpy(buffer, krb5int_cksumtypes_list[i].out_string, buflen) >= buflen) return ENOMEM; return 0; diff --git a/src/lib/crypto/krb/cksumtypes.c b/src/lib/crypto/krb/cksumtypes.c index 2b5f33d..e03c0ad 100644 --- a/src/lib/crypto/krb/cksumtypes.c +++ b/src/lib/crypto/krb/cksumtypes.c @@ -29,7 +29,7 @@ #include "keyhash_provider.h" #include "cksumtypes.h" -const struct krb5_cksumtypes krb5_cksumtypes_list[] = { +const struct krb5_cksumtypes krb5int_cksumtypes_list[] = { { CKSUMTYPE_CRC32, KRB5_CKSUMFLAG_NOT_COLL_PROOF, "crc32", { 0 }, "CRC-32", 0, NULL, @@ -87,5 +87,5 @@ const struct krb5_cksumtypes krb5_cksumtypes_list[] = { NULL } }; -const unsigned int krb5_cksumtypes_length = - sizeof(krb5_cksumtypes_list) / sizeof(struct krb5_cksumtypes); +const unsigned int krb5int_cksumtypes_length = + sizeof(krb5int_cksumtypes_list) / sizeof(struct krb5_cksumtypes); diff --git a/src/lib/crypto/krb/cksumtypes.h b/src/lib/crypto/krb/cksumtypes.h index 05e7be6..10d8ccd 100644 --- a/src/lib/crypto/krb/cksumtypes.h +++ b/src/lib/crypto/krb/cksumtypes.h @@ -63,6 +63,6 @@ struct krb5_cksumtypes { #define KRB5_CKSUMFLAG_DERIVE 0x0001 #define KRB5_CKSUMFLAG_NOT_COLL_PROOF 0x0002 -extern const struct krb5_cksumtypes krb5_cksumtypes_list[]; -extern const unsigned int krb5_cksumtypes_length; +extern const struct krb5_cksumtypes krb5int_cksumtypes_list[]; +extern const unsigned int krb5int_cksumtypes_length; #endif diff --git a/src/lib/crypto/krb/coll_proof_cksum.c b/src/lib/crypto/krb/coll_proof_cksum.c index d66863e..08b4ccb 100644 --- a/src/lib/crypto/krb/coll_proof_cksum.c +++ b/src/lib/crypto/krb/coll_proof_cksum.c @@ -32,9 +32,9 @@ krb5_c_is_coll_proof_cksum(krb5_cksumtype ctype) { unsigned int i; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == ctype) - return((krb5_cksumtypes_list[i].flags & + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == ctype) + return((krb5int_cksumtypes_list[i].flags & KRB5_CKSUMFLAG_NOT_COLL_PROOF) ? FALSE : TRUE); } diff --git a/src/lib/crypto/krb/combine_keys.c b/src/lib/crypto/krb/combine_keys.c index acfb99b..0cf3f6f 100644 --- a/src/lib/crypto/krb/combine_keys.c +++ b/src/lib/crypto/krb/combine_keys.c @@ -137,14 +137,14 @@ krb5int_c_combine_keys(krb5_context context, krb5_keyblock *key1, /* * Concatenate the two keys together, and then run them through * n-fold to reduce them to a length appropriate for the random-to-key - * operation. Note here that krb5_nfold() takes sizes in bits, hence + * operation. Note here that krb5int_nfold() takes sizes in bits, hence * the multiply by 8. */ memcpy(combined, r1, keybytes); memcpy(combined + keybytes, r2, keybytes); - krb5_nfold((keybytes * 2) * 8, combined, keybytes * 8, rnd); + krb5int_nfold((keybytes * 2) * 8, combined, keybytes * 8, rnd); /* * Run the "random" bits through random-to-key to produce a encryption @@ -190,7 +190,7 @@ krb5int_c_combine_keys(krb5_context context, krb5_keyblock *key1, myalloc = TRUE; } - ret = krb5_derive_keyblock(enc, tkey, outkey, &input); + ret = krb5int_derive_keyblock(enc, tkey, outkey, &input); if (ret) { if (myalloc) { free(outkey->contents); @@ -248,7 +248,7 @@ dr(const struct krb5_enc_provider *enc, const krb5_keyblock *inkey, if (in_constant->length == inblock.length) { memcpy(inblock.data, in_constant->data, inblock.length); } else { - krb5_nfold(in_constant->length*8, (unsigned char *) in_constant->data, + krb5int_nfold(in_constant->length*8, (unsigned char *) in_constant->data, inblock.length*8, (unsigned char *) inblock.data); } diff --git a/src/lib/crypto/krb/dk/checksum.c b/src/lib/crypto/krb/dk/checksum.c index 31e7de9..e5087e7 100644 --- a/src/lib/crypto/krb/dk/checksum.c +++ b/src/lib/crypto/krb/dk/checksum.c @@ -32,7 +32,7 @@ #define K5CLENGTH 5 /* 32 bit net byte order integer + one byte seed */ krb5_error_code -krb5_dk_make_checksum(const struct krb5_hash_provider *hash, +krb5int_dk_make_checksum(const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *input, krb5_data *output) { @@ -50,7 +50,7 @@ krb5_dk_make_checksum(const struct krb5_hash_provider *hash, /* * key->length will be tested in enc->encrypt. - * output->length will be tested in krb5_hmac. + * output->length will be tested in krb5int_hmac. */ /* Derive the key. */ @@ -62,7 +62,7 @@ krb5_dk_make_checksum(const struct krb5_hash_provider *hash, datain.data[4] = (char) 0x99; - ret = krb5_derive_key(enc, key, &kc, &datain); + ret = krb5int_derive_key(enc, key, &kc, &datain); if (ret) return ret; @@ -70,7 +70,7 @@ krb5_dk_make_checksum(const struct krb5_hash_provider *hash, datain = *input; - ret = krb5_hmac(hash, kc, 1, &datain, output); + ret = krb5int_hmac(hash, kc, 1, &datain, output); if (ret) memset(output->data, 0, output->length); @@ -98,7 +98,7 @@ krb5int_dk_make_checksum_iov(const struct krb5_hash_provider *hash, /* * key->length will be tested in enc->encrypt. - * output->length will be tested in krb5_hmac. + * output->length will be tested in krb5int_hmac. */ /* Derive the key. */ @@ -110,7 +110,7 @@ krb5int_dk_make_checksum_iov(const struct krb5_hash_provider *hash, datain.data[4] = (char) 0x99; - ret = krb5_derive_key(enc, key, &kc, &datain); + ret = krb5int_derive_key(enc, key, &kc, &datain); if (ret) return ret; diff --git a/src/lib/crypto/krb/dk/derive.c b/src/lib/crypto/krb/dk/derive.c index c2638e8..bcd1114 100644 --- a/src/lib/crypto/krb/dk/derive.c +++ b/src/lib/crypto/krb/dk/derive.c @@ -80,12 +80,12 @@ cleanup: /* * Compute a derived key into the keyblock outkey. This variation on - * krb5_derive_key does not cache the result, as it is only used + * krb5int_derive_key does not cache the result, as it is only used * directly in situations which are not expected to be repeated with * the same inkey and constant. */ krb5_error_code -krb5_derive_keyblock(const struct krb5_enc_provider *enc, +krb5int_derive_keyblock(const struct krb5_enc_provider *enc, krb5_key inkey, krb5_keyblock *outkey, const krb5_data *in_constant) { @@ -123,7 +123,7 @@ krb5_derive_keyblock(const struct krb5_enc_provider *enc, if (in_constant->length == inblock.length) { memcpy(inblock.data, in_constant->data, inblock.length); } else { - krb5_nfold(in_constant->length*8, (unsigned char *) in_constant->data, + krb5int_nfold(in_constant->length*8, (unsigned char *) in_constant->data, inblock.length*8, (unsigned char *) inblock.data); } @@ -162,7 +162,7 @@ cleanup: } krb5_error_code -krb5_derive_key(const struct krb5_enc_provider *enc, +krb5int_derive_key(const struct krb5_enc_provider *enc, krb5_key inkey, krb5_key *outkey, const krb5_data *in_constant) { @@ -184,7 +184,7 @@ krb5_derive_key(const struct krb5_enc_provider *enc, keyblock.contents = malloc(keyblock.length); if (keyblock.contents == NULL) return ENOMEM; - ret = krb5_derive_keyblock(enc, inkey, &keyblock, in_constant); + ret = krb5int_derive_keyblock(enc, inkey, &keyblock, in_constant); if (ret) goto cleanup; @@ -201,7 +201,7 @@ cleanup: } krb5_error_code -krb5_derive_random(const struct krb5_enc_provider *enc, +krb5int_derive_random(const struct krb5_enc_provider *enc, krb5_key inkey, krb5_data *outrnd, const krb5_data *in_constant) { @@ -238,7 +238,7 @@ krb5_derive_random(const struct krb5_enc_provider *enc, if (in_constant->length == inblock.length) { memcpy(inblock.data, in_constant->data, inblock.length); } else { - krb5_nfold(in_constant->length*8, (unsigned char *) in_constant->data, + krb5int_nfold(in_constant->length*8, (unsigned char *) in_constant->data, inblock.length*8, (unsigned char *) inblock.data); } diff --git a/src/lib/crypto/krb/dk/dk.h b/src/lib/crypto/krb/dk/dk.h index 6566ce8..67cbf13 100644 --- a/src/lib/crypto/krb/dk/dk.h +++ b/src/lib/crypto/krb/dk/dk.h @@ -26,21 +26,25 @@ #include "k5-int.h" -void krb5_dk_encrypt_length(const struct krb5_enc_provider *enc, +void +krb5int_dk_encrypt_length(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t input, size_t *length); -krb5_error_code krb5_dk_encrypt(const struct krb5_enc_provider *enc, +krb5_error_code +krb5int_dk_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, krb5_data *output); -void krb5int_aes_encrypt_length(const struct krb5_enc_provider *enc, +void +krb5int_aes_encrypt_length(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t input, size_t *length); -krb5_error_code krb5int_aes_dk_encrypt(const struct krb5_enc_provider *enc, +krb5_error_code +krb5int_aes_dk_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, @@ -48,13 +52,15 @@ krb5_error_code krb5int_aes_dk_encrypt(const struct krb5_enc_provider *enc, const krb5_data *input, krb5_data *output); -krb5_error_code krb5_dk_decrypt(const struct krb5_enc_provider *enc, +krb5_error_code +krb5int_dk_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, krb5_data *arg_output); -krb5_error_code krb5int_aes_dk_decrypt(const struct krb5_enc_provider *enc, +krb5_error_code +krb5int_aes_dk_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, @@ -62,23 +68,27 @@ krb5_error_code krb5int_aes_dk_decrypt(const struct krb5_enc_provider *enc, const krb5_data *input, krb5_data *arg_output); -krb5_error_code krb5int_dk_string_to_key(const struct krb5_enc_provider *enc, +krb5_error_code +krb5int_dk_string_to_key(const struct krb5_enc_provider *enc, const krb5_data *string, const krb5_data *salt, const krb5_data *params, krb5_keyblock *key); -krb5_error_code krb5_derive_keyblock(const struct krb5_enc_provider *enc, +krb5_error_code +krb5int_derive_keyblock(const struct krb5_enc_provider *enc, krb5_key inkey, krb5_keyblock *outkey, const krb5_data *in_constant); -krb5_error_code krb5_derive_key(const struct krb5_enc_provider *enc, +krb5_error_code +krb5_derive_key(const struct krb5_enc_provider *enc, krb5_key inkey, krb5_key *outkey, const krb5_data *in_constant); -krb5_error_code krb5_dk_make_checksum(const struct krb5_hash_provider *hash, +krb5_error_code +krb5int_dk_make_checksum(const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *input, @@ -91,7 +101,7 @@ krb5int_dk_make_checksum_iov(const struct krb5_hash_provider *hash, krb5_data *output); krb5_error_code -krb5_derive_random(const struct krb5_enc_provider *enc, +krb5int_derive_random(const struct krb5_enc_provider *enc, krb5_key inkey, krb5_data *outrnd, const krb5_data *in_constant); diff --git a/src/lib/crypto/krb/dk/dk_aead.c b/src/lib/crypto/krb/dk/dk_aead.c index 5c9c1ad..e35ca55 100644 --- a/src/lib/crypto/krb/dk/dk_aead.c +++ b/src/lib/crypto/krb/dk/dk_aead.c @@ -136,13 +136,13 @@ krb5int_dk_encrypt_iov(const struct krb5_aead_provider *aead, d1.data[4] = 0xAA; - ret = krb5_derive_key(enc, key, &ke, &d1); + ret = krb5int_derive_key(enc, key, &ke, &d1); if (ret != 0) goto cleanup; d1.data[4] = 0x55; - ret = krb5_derive_key(enc, key, &ki, &d1); + ret = krb5int_derive_key(enc, key, &ki, &d1); if (ret != 0) goto cleanup; @@ -261,13 +261,13 @@ krb5int_dk_decrypt_iov(const struct krb5_aead_provider *aead, d1.data[4] = 0xAA; - ret = krb5_derive_key(enc, key, &ke, &d1); + ret = krb5int_derive_key(enc, key, &ke, &d1); if (ret != 0) goto cleanup; d1.data[4] = 0x55; - ret = krb5_derive_key(enc, key, &ki, &d1); + ret = krb5int_derive_key(enc, key, &ki, &d1); if (ret != 0) goto cleanup; diff --git a/src/lib/crypto/krb/dk/dk_decrypt.c b/src/lib/crypto/krb/dk/dk_decrypt.c index abb7a39..9535a75 100644 --- a/src/lib/crypto/krb/dk/dk_decrypt.c +++ b/src/lib/crypto/krb/dk/dk_decrypt.c @@ -41,7 +41,7 @@ krb5_dk_decrypt_maybe_trunc_hmac(const struct krb5_enc_provider *enc, int ivec_mode); krb5_error_code -krb5_dk_decrypt(const struct krb5_enc_provider *enc, +krb5int_dk_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, @@ -104,13 +104,13 @@ krb5_dk_decrypt_maybe_trunc_hmac(const struct krb5_enc_provider *enc, d1.data[4] = (char) 0xAA; - ret = krb5_derive_key(enc, key, &ke, &d1); + ret = krb5int_derive_key(enc, key, &ke, &d1); if (ret != 0) goto cleanup; d1.data[4] = 0x55; - ret = krb5_derive_key(enc, key, &ki, &d1); + ret = krb5int_derive_key(enc, key, &ki, &d1); if (ret != 0) goto cleanup; @@ -142,7 +142,7 @@ krb5_dk_decrypt_maybe_trunc_hmac(const struct krb5_enc_provider *enc, d1.length = hashsize; d1.data = (char *) cksum; - ret = krb5_hmac(hash, ki, 1, &d2, &d1); + ret = krb5int_hmac(hash, ki, 1, &d2, &d1); if (ret != 0) goto cleanup; diff --git a/src/lib/crypto/krb/dk/dk_encrypt.c b/src/lib/crypto/krb/dk/dk_encrypt.c index bb045fa..b44671a 100644 --- a/src/lib/crypto/krb/dk/dk_encrypt.c +++ b/src/lib/crypto/krb/dk/dk_encrypt.c @@ -39,7 +39,7 @@ */ void -krb5_dk_encrypt_length(const struct krb5_enc_provider *enc, +krb5int_dk_encrypt_length(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t inputlen, size_t *length) { @@ -51,7 +51,7 @@ krb5_dk_encrypt_length(const struct krb5_enc_provider *enc, } krb5_error_code -krb5_dk_encrypt(const struct krb5_enc_provider *enc, +krb5int_dk_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, @@ -68,7 +68,7 @@ krb5_dk_encrypt(const struct krb5_enc_provider *enc, blocksize = enc->block_size; plainlen = krb5_roundup(blocksize + input->length, blocksize); - krb5_dk_encrypt_length(enc, hash, input->length, &enclen); + krb5int_dk_encrypt_length(enc, hash, input->length, &enclen); /* key->length, ivec will be tested in enc->encrypt. */ @@ -90,13 +90,13 @@ krb5_dk_encrypt(const struct krb5_enc_provider *enc, d1.data[4] = (char) 0xAA; - ret = krb5_derive_key(enc, key, &ke, &d1); + ret = krb5int_derive_key(enc, key, &ke, &d1); if (ret != 0) goto cleanup; d1.data[4] = 0x55; - ret = krb5_derive_key(enc, key, &ki, &d1); + ret = krb5int_derive_key(enc, key, &ki, &d1); if (ret != 0) goto cleanup; @@ -138,7 +138,7 @@ krb5_dk_encrypt(const struct krb5_enc_provider *enc, output->length = enclen; - ret = krb5_hmac(hash, ki, 1, &d1, &d2); + ret = krb5int_hmac(hash, ki, 1, &d1, &d2); if (ret != 0) { memset(d2.data, 0, d2.length); goto cleanup; @@ -188,7 +188,7 @@ trunc_hmac (const struct krb5_hash_provider *hash, tmp.data = malloc(hashsize); if (tmp.data == NULL) return ENOMEM; - ret = krb5_hmac(hash, ki, num, input, &tmp); + ret = krb5int_hmac(hash, ki, num, input, &tmp); if (ret == 0) memcpy(output->data, tmp.data, output->length); memset(tmp.data, 0, hashsize); @@ -237,13 +237,13 @@ krb5int_aes_dk_encrypt(const struct krb5_enc_provider *enc, d1.data[4] = (char) 0xAA; - ret = krb5_derive_key(enc, key, &ke, &d1); + ret = krb5int_derive_key(enc, key, &ke, &d1); if (ret != 0) goto cleanup; d1.data[4] = 0x55; - ret = krb5_derive_key(enc, key, &ki, &d1); + ret = krb5int_derive_key(enc, key, &ki, &d1); if (ret != 0) goto cleanup; diff --git a/src/lib/crypto/krb/dk/stringtokey.c b/src/lib/crypto/krb/dk/stringtokey.c index 48b053a..7589b4b 100644 --- a/src/lib/crypto/krb/dk/stringtokey.c +++ b/src/lib/crypto/krb/dk/stringtokey.c @@ -41,7 +41,7 @@ krb5int_dk_string_to_key(const struct krb5_enc_provider *enc, krb5_keyblock foldkeyblock; krb5_key foldkey = NULL; - /* keyblock->length is checked by krb5_derive_key. */ + /* keyblock->length is checked by krb5int_derive_key. */ keybytes = enc->keybytes; keylength = enc->keylength; @@ -64,7 +64,7 @@ krb5int_dk_string_to_key(const struct krb5_enc_provider *enc, if (salt) memcpy(concat + string->length, salt->data, salt->length); - krb5_nfold(concatlen*8, concat, keybytes*8, foldstring); + krb5int_nfold(concatlen*8, concat, keybytes*8, foldstring); indata.length = keybytes; indata.data = (char *) foldstring; @@ -84,7 +84,7 @@ krb5int_dk_string_to_key(const struct krb5_enc_provider *enc, indata.length = kerberos_len; indata.data = (char *) kerberos; - ret = krb5_derive_keyblock(enc, foldkey, keyblock, &indata); + ret = krb5int_derive_keyblock(enc, foldkey, keyblock, &indata); if (ret != 0) memset(keyblock->contents, 0, keyblock->length); diff --git a/src/lib/crypto/krb/etypes.c b/src/lib/crypto/krb/etypes.c index b3abd18..8552c0f 100644 --- a/src/lib/crypto/krb/etypes.c +++ b/src/lib/crypto/krb/etypes.c @@ -42,12 +42,12 @@ that the keytypes are all near each other. I'd rather not make that assumption. */ -const struct krb5_keytypes krb5_enctypes_list[] = { +const struct krb5_keytypes krb5int_enctypes_list[] = { { ENCTYPE_DES_CBC_CRC, "des-cbc-crc", { 0 }, "DES cbc mode with CRC-32", &krb5int_enc_des, &krb5int_hash_crc32, 16, - krb5_old_encrypt_length, krb5_old_encrypt, krb5_old_decrypt, + krb5int_old_encrypt_length, krb5int_old_encrypt, krb5int_old_decrypt, krb5int_des_string_to_key, krb5int_des_prf, CKSUMTYPE_RSA_MD5, @@ -57,7 +57,7 @@ const struct krb5_keytypes krb5_enctypes_list[] = { "des-cbc-md4", { 0 }, "DES cbc mode with RSA-MD4", &krb5int_enc_des, &krb5int_hash_md4, 16, - krb5_old_encrypt_length, krb5_old_encrypt, krb5_old_decrypt, + krb5int_old_encrypt_length, krb5int_old_encrypt, krb5int_old_decrypt, krb5int_des_string_to_key, krb5int_des_prf, CKSUMTYPE_RSA_MD4, @@ -67,7 +67,7 @@ const struct krb5_keytypes krb5_enctypes_list[] = { "des-cbc-md5", { "des" }, "DES cbc mode with RSA-MD5", &krb5int_enc_des, &krb5int_hash_md5, 16, - krb5_old_encrypt_length, krb5_old_encrypt, krb5_old_decrypt, + krb5int_old_encrypt_length, krb5int_old_encrypt, krb5int_old_decrypt, krb5int_des_string_to_key, krb5int_des_prf, CKSUMTYPE_RSA_MD5, @@ -77,7 +77,7 @@ const struct krb5_keytypes krb5_enctypes_list[] = { "des-cbc-raw", { 0 }, "DES cbc mode raw", &krb5int_enc_des, NULL, 16, - krb5_raw_encrypt_length, krb5_raw_encrypt, krb5_raw_decrypt, + krb5_raw_encrypt_length, krb5int_raw_encrypt, krb5int_raw_decrypt, krb5int_des_string_to_key, krb5int_des_prf, 0, @@ -87,7 +87,7 @@ const struct krb5_keytypes krb5_enctypes_list[] = { "des3-cbc-raw", { 0 }, "Triple DES cbc mode raw", &krb5int_enc_des3, NULL, 16, - krb5_raw_encrypt_length, krb5_raw_encrypt, krb5_raw_decrypt, + krb5_raw_encrypt_length, krb5int_raw_encrypt, krb5int_raw_decrypt, krb5int_dk_string_to_key, NULL, /*PRF*/ 0, @@ -99,7 +99,7 @@ const struct krb5_keytypes krb5_enctypes_list[] = { "Triple DES cbc mode with HMAC/sha1", &krb5int_enc_des3, &krb5int_hash_sha1, 16, - krb5_dk_encrypt_length, krb5_dk_encrypt, krb5_dk_decrypt, + krb5int_dk_encrypt_length, krb5int_dk_encrypt, krb5int_dk_decrypt, krb5int_dk_string_to_key, krb5int_dk_prf, CKSUMTYPE_HMAC_SHA1_DES3, @@ -110,7 +110,7 @@ const struct krb5_keytypes krb5_enctypes_list[] = { "des-hmac-sha1", { 0 }, "DES with HMAC/sha1", &krb5int_enc_des, &krb5int_hash_sha1, 8, - krb5_dk_encrypt_length, krb5_dk_encrypt, krb5_dk_decrypt, + krb5int_dk_encrypt_length, krb5int_dk_encrypt, krb5int_dk_decrypt, krb5int_dk_string_to_key, NULL, /*PRF*/ 0, @@ -122,8 +122,8 @@ const struct krb5_keytypes krb5_enctypes_list[] = { &krb5int_enc_arcfour, &krb5int_hash_md5, 20, - krb5_arcfour_encrypt_length, krb5_arcfour_encrypt, - krb5_arcfour_decrypt, krb5int_arcfour_string_to_key, + krb5int_arcfour_encrypt_length, krb5int_arcfour_encrypt, + krb5int_arcfour_decrypt, krb5int_arcfour_string_to_key, krb5int_arcfour_prf, /*PRF*/ CKSUMTYPE_HMAC_MD5_ARCFOUR, &krb5int_aead_arcfour, @@ -134,8 +134,8 @@ const struct krb5_keytypes krb5_enctypes_list[] = { &krb5int_enc_arcfour, &krb5int_hash_md5, 20, - krb5_arcfour_encrypt_length, krb5_arcfour_encrypt, - krb5_arcfour_decrypt, krb5int_arcfour_string_to_key, + krb5int_arcfour_encrypt_length, krb5int_arcfour_encrypt, + krb5int_arcfour_decrypt, krb5int_arcfour_string_to_key, krb5int_arcfour_prf, /*PRF*/ CKSUMTYPE_HMAC_MD5_ARCFOUR, &krb5int_aead_arcfour, @@ -166,5 +166,5 @@ const struct krb5_keytypes krb5_enctypes_list[] = { 0 /*flags*/ }, }; -const int krb5_enctypes_length = - sizeof(krb5_enctypes_list) / sizeof(struct krb5_keytypes); +const int krb5int_enctypes_length = + sizeof(krb5int_enctypes_list) / sizeof(struct krb5_keytypes); diff --git a/src/lib/crypto/krb/etypes.h b/src/lib/crypto/krb/etypes.h index edaa00c..16dbae9 100644 --- a/src/lib/crypto/krb/etypes.h +++ b/src/lib/crypto/krb/etypes.h @@ -71,20 +71,20 @@ struct krb5_keytypes { #define ETYPE_WEAK 1 -extern const struct krb5_keytypes krb5_enctypes_list[]; -extern const int krb5_enctypes_length; +extern const struct krb5_keytypes krb5int_enctypes_list[]; +extern const int krb5int_enctypes_length; static inline const struct krb5_keytypes * find_enctype(krb5_enctype enctype) { int i; - for (i = 0; i < krb5_enctypes_length; i++) { - if (krb5_enctypes_list[i].etype == enctype) + for (i = 0; i < krb5int_enctypes_length; i++) { + if (krb5int_enctypes_list[i].etype == enctype) break; } - if (i == krb5_enctypes_length) + if (i == krb5int_enctypes_length) return NULL; - return &krb5_enctypes_list[i]; + return &krb5int_enctypes_list[i]; } diff --git a/src/lib/crypto/krb/keyed_checksum_types.c b/src/lib/crypto/krb/keyed_checksum_types.c index 2fd239c..4874372 100644 --- a/src/lib/crypto/krb/keyed_checksum_types.c +++ b/src/lib/crypto/krb/keyed_checksum_types.c @@ -50,8 +50,8 @@ krb5_c_keyed_checksum_types(krb5_context context, krb5_enctype enctype, *cksumtypes = NULL; nctypes = 0; - for (i = 0; i < krb5_cksumtypes_length; i++) { - ct = &krb5_cksumtypes_list[i]; + for (i = 0; i < krb5int_cksumtypes_length; i++) { + ct = &krb5int_cksumtypes_list[i]; if ((ct->keyhash && etype_match(ct->keyed_etype, enctype)) || (ct->flags & KRB5_CKSUMFLAG_DERIVE)) nctypes++; @@ -62,11 +62,11 @@ krb5_c_keyed_checksum_types(krb5_context context, krb5_enctype enctype, return ENOMEM; c = 0; - for (i = 0; i < krb5_cksumtypes_length; i++) { - ct = &krb5_cksumtypes_list[i]; + for (i = 0; i < krb5int_cksumtypes_length; i++) { + ct = &krb5int_cksumtypes_list[i]; if ((ct->keyhash && etype_match(ct->keyed_etype, enctype)) || (ct->flags & KRB5_CKSUMFLAG_DERIVE)) - ctypes[c++] = krb5_cksumtypes_list[i].ctype; + ctypes[c++] = krb5int_cksumtypes_list[i].ctype; } *count = nctypes; diff --git a/src/lib/crypto/krb/keyed_cksum.c b/src/lib/crypto/krb/keyed_cksum.c index 8cf5f10..dcf72b5 100644 --- a/src/lib/crypto/krb/keyed_cksum.c +++ b/src/lib/crypto/krb/keyed_cksum.c @@ -33,8 +33,8 @@ krb5_c_is_keyed_cksum(krb5_cksumtype ctype) unsigned int i; const struct krb5_cksumtypes *ctp; - for (i = 0; i < krb5_cksumtypes_length; i++) { - ctp = &krb5_cksumtypes_list[i]; + for (i = 0; i < krb5int_cksumtypes_length; i++) { + ctp = &krb5int_cksumtypes_list[i]; if (ctp->ctype == ctype) { return (ctp->keyhash != NULL || (ctp->flags & KRB5_CKSUMFLAG_DERIVE)); diff --git a/src/lib/crypto/krb/keyhash_provider/hmac_md5.c b/src/lib/crypto/krb/keyhash_provider/hmac_md5.c index c1825be..8318dc0 100644 --- a/src/lib/crypto/krb/keyhash_provider/hmac_md5.c +++ b/src/lib/crypto/krb/keyhash_provider/hmac_md5.c @@ -57,7 +57,7 @@ k5_hmac_md5_hash (krb5_key key, krb5_keyusage usage, ks_constant.data = "signaturekey"; ks_constant.length = strlen(ks_constant.data)+1; /* Including null*/ - ret = krb5_hmac( &krb5int_hash_md5, key, 1, + ret = krb5int_hmac( &krb5int_hash_md5, key, 1, &ks_constant, &ds); if (ret) goto cleanup; @@ -68,17 +68,17 @@ k5_hmac_md5_hash (krb5_key key, krb5_keyusage usage, if (ret) goto cleanup; - krb5_MD5Init (&ctx); + krb5int_MD5Init (&ctx); ms_usage = krb5int_arcfour_translate_usage (usage); store_32_le(ms_usage, t); - krb5_MD5Update (&ctx, (unsigned char * ) &t, 4); - krb5_MD5Update (&ctx, (unsigned char *) input-> data, + krb5int_MD5Update (&ctx, (unsigned char * ) &t, 4); + krb5int_MD5Update (&ctx, (unsigned char *) input-> data, (unsigned int) input->length ); - krb5_MD5Final(&ctx); + krb5int_MD5Final(&ctx); md5tmp.data = (void *) ctx.digest; md5tmp.length = 16; - ret = krb5_hmac ( &krb5int_hash_md5, ks, 1, &md5tmp, + ret = krb5int_hmac ( &krb5int_hash_md5, ks, 1, &md5tmp, output); cleanup: @@ -114,7 +114,7 @@ k5_hmac_md5_hash_iov (krb5_key key, krb5_keyusage usage, ks_constant.data = "signaturekey"; ks_constant.length = strlen(ks_constant.data)+1; /* Including null*/ - ret = krb5_hmac( &krb5int_hash_md5, key, 1, + ret = krb5int_hmac( &krb5int_hash_md5, key, 1, &ks_constant, &ds); if (ret) goto cleanup; @@ -125,21 +125,21 @@ k5_hmac_md5_hash_iov (krb5_key key, krb5_keyusage usage, if (ret) goto cleanup; - krb5_MD5Init (&ctx); + krb5int_MD5Init (&ctx); ms_usage = krb5int_arcfour_translate_usage (usage); store_32_le(ms_usage, t); - krb5_MD5Update (&ctx, (unsigned char * ) &t, 4); + krb5int_MD5Update (&ctx, (unsigned char * ) &t, 4); for (i = 0; i < num_data; i++) { const krb5_crypto_iov *iov = &data[i]; if (SIGN_IOV(iov)) - krb5_MD5Update (&ctx, (unsigned char *)iov->data.data, + krb5int_MD5Update (&ctx, (unsigned char *)iov->data.data, (unsigned int)iov->data.length); } - krb5_MD5Final(&ctx); + krb5int_MD5Final(&ctx); md5tmp.data = (void *) ctx.digest; md5tmp.length = 16; - ret = krb5_hmac ( &krb5int_hash_md5, ks, 1, &md5tmp, + ret = krb5int_hmac ( &krb5int_hash_md5, ks, 1, &md5tmp, output); cleanup: diff --git a/src/lib/crypto/krb/keyhash_provider/k5_md4des.c b/src/lib/crypto/krb/keyhash_provider/k5_md4des.c index 1514dcc..f3c6d62 100644 --- a/src/lib/crypto/krb/keyhash_provider/k5_md4des.c +++ b/src/lib/crypto/krb/keyhash_provider/k5_md4des.c @@ -32,7 +32,7 @@ #define CONFLENGTH 8 /* Force acceptance of krb5-beta5 md4des checksum for now. */ -#define KRB5_MD4DES_BETA5_COMPAT +#define KRB5int_MD4DES_BETA5_COMPAT /* des-cbc(xorkey, conf | rsa-md4(conf | data)) */ @@ -60,11 +60,11 @@ k5_md4des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec, /* hash the confounder, then the input data */ - krb5_MD4Init(&ctx); - krb5_MD4Update(&ctx, conf, CONFLENGTH); - krb5_MD4Update(&ctx, (unsigned char *) input->data, + krb5int_MD4Init(&ctx); + krb5int_MD4Update(&ctx, conf, CONFLENGTH); + krb5int_MD4Update(&ctx, (unsigned char *) input->data, (unsigned int) input->length); - krb5_MD4Final(&ctx); + krb5int_MD4Final(&ctx); /* construct the buffer to be encrypted */ @@ -92,7 +92,7 @@ k5_md4des_verify(krb5_key key, krb5_keyusage usage, if (key->keyblock.length != 8) return(KRB5_BAD_KEYSIZE); if (hash->length != (CONFLENGTH+RSA_MD4_CKSUM_LENGTH)) { -#ifdef KRB5_MD4DES_BETA5_COMPAT +#ifdef KRB5int_MD4DES_BETA5_COMPAT if (hash->length != RSA_MD4_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); else @@ -132,13 +132,13 @@ k5_md4des_verify(krb5_key key, krb5_keyusage usage, /* hash the confounder, then the input data */ - krb5_MD4Init(&ctx); + krb5int_MD4Init(&ctx); if (!compathash) { - krb5_MD4Update(&ctx, plaintext, CONFLENGTH); + krb5int_MD4Update(&ctx, plaintext, CONFLENGTH); } - krb5_MD4Update(&ctx, (unsigned char *) input->data, + krb5int_MD4Update(&ctx, (unsigned char *) input->data, (unsigned int) input->length); - krb5_MD4Final(&ctx); + krb5int_MD4Final(&ctx); /* compare the decrypted hash to the computed one */ diff --git a/src/lib/crypto/krb/keyhash_provider/k5_md5des.c b/src/lib/crypto/krb/keyhash_provider/k5_md5des.c index e7a84e2..1a2089a 100644 --- a/src/lib/crypto/krb/keyhash_provider/k5_md5des.c +++ b/src/lib/crypto/krb/keyhash_provider/k5_md5des.c @@ -32,7 +32,7 @@ #define CONFLENGTH 8 /* Force acceptance of krb5-beta5 md5des checksum for now. */ -#define KRB5_MD5DES_BETA5_COMPAT +#define KRB5int_MD5DES_BETA5_COMPAT /* des-cbc(xorkey, conf | rsa-md5(conf | data)) */ @@ -60,11 +60,11 @@ k5_md5des_hash(krb5_key key, krb5_keyusage usage, const krb5_data *ivec, /* hash the confounder, then the input data */ - krb5_MD5Init(&ctx); - krb5_MD5Update(&ctx, conf, CONFLENGTH); - krb5_MD5Update(&ctx, (unsigned char *) input->data, + krb5int_MD5Init(&ctx); + krb5int_MD5Update(&ctx, conf, CONFLENGTH); + krb5int_MD5Update(&ctx, (unsigned char *) input->data, (unsigned int) input->length); - krb5_MD5Final(&ctx); + krb5int_MD5Final(&ctx); /* construct the buffer to be encrypted */ @@ -93,7 +93,7 @@ k5_md5des_verify(krb5_key key, krb5_keyusage usage, const krb5_data *ivec, return(KRB5_BAD_KEYSIZE); if (hash->length != (CONFLENGTH+RSA_MD5_CKSUM_LENGTH)) { -#ifdef KRB5_MD5DES_BETA5_COMPAT +#ifdef KRB5int_MD5DES_BETA5_COMPAT if (hash->length != RSA_MD5_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); else @@ -132,13 +132,13 @@ k5_md5des_verify(krb5_key key, krb5_keyusage usage, const krb5_data *ivec, /* hash the confounder, then the input data */ - krb5_MD5Init(&ctx); + krb5int_MD5Init(&ctx); if (!compathash) { - krb5_MD5Update(&ctx, plaintext, CONFLENGTH); + krb5int_MD5Update(&ctx, plaintext, CONFLENGTH); } - krb5_MD5Update(&ctx, (unsigned char *) input->data, + krb5int_MD5Update(&ctx, (unsigned char *) input->data, (unsigned) input->length); - krb5_MD5Final(&ctx); + krb5int_MD5Final(&ctx); /* compare the decrypted hash to the computed one */ diff --git a/src/lib/crypto/krb/keyhash_provider/md5_hmac.c b/src/lib/crypto/krb/keyhash_provider/md5_hmac.c index 589c347..50eb2ec 100644 --- a/src/lib/crypto/krb/keyhash_provider/md5_hmac.c +++ b/src/lib/crypto/krb/keyhash_provider/md5_hmac.c @@ -42,19 +42,19 @@ k5_md5_hmac_hash (krb5_key key, krb5_keyusage usage, unsigned char t[4]; krb5_data ds; - krb5_MD5Init(&ctx); + krb5int_MD5Init(&ctx); ms_usage = krb5int_arcfour_translate_usage (usage); store_32_le(ms_usage, t); - krb5_MD5Update(&ctx, t, sizeof(t)); - krb5_MD5Update(&ctx, (unsigned char *)input->data, input->length); - krb5_MD5Final(&ctx); + krb5int_MD5Update(&ctx, t, sizeof(t)); + krb5int_MD5Update(&ctx, (unsigned char *)input->data, input->length); + krb5int_MD5Final(&ctx); ds.magic = KV5M_DATA; ds.length = 16; ds.data = (char *)ctx.digest; - return krb5_hmac ( &krb5int_hash_md5, key, 1, &ds, output); + return krb5int_hmac ( &krb5int_hash_md5, key, 1, &ds, output); } const struct krb5_keyhash_provider krb5int_keyhash_md5_hmac = { diff --git a/src/lib/crypto/krb/make_checksum.c b/src/lib/crypto/krb/make_checksum.c index 01e374b..def88a1 100644 --- a/src/lib/crypto/krb/make_checksum.c +++ b/src/lib/crypto/krb/make_checksum.c @@ -43,13 +43,13 @@ krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype, krb5_error_code ret; size_t cksumlen; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == cksumtype) + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == cksumtype) break; } - if (i == krb5_cksumtypes_length) + if (i == krb5int_cksumtypes_length) return KRB5_BAD_ENCTYPE; - ctp = &krb5_cksumtypes_list[i]; + ctp = &krb5int_cksumtypes_list[i]; if (ctp->keyhash != NULL) cksumlen = ctp->keyhash->hashsize; @@ -90,7 +90,7 @@ krb5_k_make_checksum(krb5_context context, krb5_cksumtype cksumtype, ret = (*keyhash->hash)(key, usage, 0, input, &data); } } else if (ctp->flags & KRB5_CKSUMFLAG_DERIVE) { - ret = krb5_dk_make_checksum(ctp->hash, key, usage, input, &data); + ret = krb5int_dk_make_checksum(ctp->hash, key, usage, input, &data); } else { /* No key is used. */ ret = (*ctp->hash->hash)(1, input, &data); diff --git a/src/lib/crypto/krb/make_checksum_iov.c b/src/lib/crypto/krb/make_checksum_iov.c index 32c9a4c..e4e2c2d 100644 --- a/src/lib/crypto/krb/make_checksum_iov.c +++ b/src/lib/crypto/krb/make_checksum_iov.c @@ -43,13 +43,13 @@ krb5_k_make_checksum_iov(krb5_context context, krb5_crypto_iov *checksum; const struct krb5_cksumtypes *ctp; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == cksumtype) + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == cksumtype) break; } - if (i == krb5_cksumtypes_length) + if (i == krb5int_cksumtypes_length) return KRB5_BAD_ENCTYPE; - ctp = &krb5_cksumtypes_list[i]; + ctp = &krb5int_cksumtypes_list[i]; if (ctp->keyhash != NULL) cksum_data.length = ctp->keyhash->hashsize; @@ -69,7 +69,7 @@ krb5_k_make_checksum_iov(krb5_context context, if (cksum_data.data == NULL) return(ENOMEM); - ret = krb5int_c_make_checksum_iov(&krb5_cksumtypes_list[i], + ret = krb5int_c_make_checksum_iov(&krb5int_cksumtypes_list[i], key, usage, data, num_data, &cksum_data); if (ret == 0) { diff --git a/src/lib/crypto/krb/nfold.c b/src/lib/crypto/krb/nfold.c index 1f1902d..01e8972 100644 --- a/src/lib/crypto/krb/nfold.c +++ b/src/lib/crypto/krb/nfold.c @@ -46,7 +46,7 @@ n-fold(k-bits): /* input length is in bits */ void -krb5_nfold(unsigned int inbits, const unsigned char *in, unsigned int outbits, +krb5int_nfold(unsigned int inbits, const unsigned char *in, unsigned int outbits, unsigned char *out) { int a,b,c,lcm; diff --git a/src/lib/crypto/krb/old/old.h b/src/lib/crypto/krb/old/old.h index 6cfb0c9..a5f3f78 100644 --- a/src/lib/crypto/krb/old/old.h +++ b/src/lib/crypto/krb/old/old.h @@ -26,19 +26,19 @@ #include "k5-int.h" -void krb5_old_encrypt_length +void krb5int_old_encrypt_length (const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t input, size_t *length); -krb5_error_code krb5_old_encrypt +krb5_error_code krb5int_old_encrypt (const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, krb5_data *output); -krb5_error_code krb5_old_decrypt +krb5_error_code krb5int_old_decrypt (const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, diff --git a/src/lib/crypto/krb/old/old_decrypt.c b/src/lib/crypto/krb/old/old_decrypt.c index dd9ad19c..42a755a 100644 --- a/src/lib/crypto/krb/old/old_decrypt.c +++ b/src/lib/crypto/krb/old/old_decrypt.c @@ -28,7 +28,7 @@ #include "old.h" krb5_error_code -krb5_old_decrypt(const struct krb5_enc_provider *enc, +krb5int_old_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, diff --git a/src/lib/crypto/krb/old/old_encrypt.c b/src/lib/crypto/krb/old/old_encrypt.c index 1121dc9..b3a1c5b 100644 --- a/src/lib/crypto/krb/old/old_encrypt.c +++ b/src/lib/crypto/krb/old/old_encrypt.c @@ -28,7 +28,7 @@ #include "old.h" void -krb5_old_encrypt_length(const struct krb5_enc_provider *enc, +krb5int_old_encrypt_length(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t inputlen, size_t *length) @@ -42,7 +42,7 @@ krb5_old_encrypt_length(const struct krb5_enc_provider *enc, } krb5_error_code -krb5_old_encrypt(const struct krb5_enc_provider *enc, +krb5int_old_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, @@ -58,7 +58,7 @@ krb5_old_encrypt(const struct krb5_enc_provider *enc, blocksize = enc->block_size; hashsize = hash->hashsize; - krb5_old_encrypt_length(enc, hash, input->length, &enclen); + krb5int_old_encrypt_length(enc, hash, input->length, &enclen); if (output->length < enclen) return(KRB5_BAD_MSIZE); diff --git a/src/lib/crypto/krb/prf/dk_prf.c b/src/lib/crypto/krb/prf/dk_prf.c index cc20387..379cc1c 100644 --- a/src/lib/crypto/krb/prf/dk_prf.c +++ b/src/lib/crypto/krb/prf/dk_prf.c @@ -50,7 +50,7 @@ krb5int_dk_prf (const struct krb5_enc_provider *enc, return ENOMEM; hash->hash(1, in, &tmp); tmp.length = (tmp.length/enc->block_size)*enc->block_size; /*truncate to block size*/ - ret = krb5_derive_key(enc, key, &kp, &prfconst); + ret = krb5int_derive_key(enc, key, &kp, &prfconst); if (ret == 0) ret = enc->encrypt(kp, NULL, &tmp, out); krb5_k_free_key(NULL, kp); diff --git a/src/lib/crypto/krb/prf/rc4_prf.c b/src/lib/crypto/krb/prf/rc4_prf.c index 3affaa5..8a79b55 100644 --- a/src/lib/crypto/krb/prf/rc4_prf.c +++ b/src/lib/crypto/krb/prf/rc4_prf.c @@ -35,7 +35,7 @@ krb5int_arcfour_prf(const struct krb5_enc_provider *enc, krb5_key key, const krb5_data *in, krb5_data *out) { assert(out->length == 20); - return krb5_hmac(&krb5int_hash_sha1, key, 1, in, out); + return krb5int_hmac(&krb5int_hash_sha1, key, 1, in, out); } diff --git a/src/lib/crypto/krb/raw/raw.h b/src/lib/crypto/krb/raw/raw.h index 84ae730..3c26188 100644 --- a/src/lib/crypto/krb/raw/raw.h +++ b/src/lib/crypto/krb/raw/raw.h @@ -31,14 +31,14 @@ void krb5_raw_encrypt_length const struct krb5_hash_provider *hash, size_t input, size_t *length); -krb5_error_code krb5_raw_encrypt +krb5_error_code krb5int_raw_encrypt (const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, krb5_data *output); -krb5_error_code krb5_raw_decrypt +krb5_error_code krb5int_raw_decrypt (const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, diff --git a/src/lib/crypto/krb/raw/raw_decrypt.c b/src/lib/crypto/krb/raw/raw_decrypt.c index dd62806..58ee6f8 100644 --- a/src/lib/crypto/krb/raw/raw_decrypt.c +++ b/src/lib/crypto/krb/raw/raw_decrypt.c @@ -28,7 +28,7 @@ #include "raw.h" krb5_error_code -krb5_raw_decrypt(const struct krb5_enc_provider *enc, +krb5int_raw_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, diff --git a/src/lib/crypto/krb/raw/raw_encrypt.c b/src/lib/crypto/krb/raw/raw_encrypt.c index 462239e..b02258d 100644 --- a/src/lib/crypto/krb/raw/raw_encrypt.c +++ b/src/lib/crypto/krb/raw/raw_encrypt.c @@ -40,7 +40,7 @@ krb5_raw_encrypt_length(const struct krb5_enc_provider *enc, } krb5_error_code -krb5_raw_encrypt(const struct krb5_enc_provider *enc, +krb5int_raw_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, diff --git a/src/lib/crypto/krb/string_to_cksumtype.c b/src/lib/crypto/krb/string_to_cksumtype.c index 92ecbfa..796cc2a 100644 --- a/src/lib/crypto/krb/string_to_cksumtype.c +++ b/src/lib/crypto/krb/string_to_cksumtype.c @@ -34,8 +34,8 @@ krb5_string_to_cksumtype(char *string, krb5_cksumtype *cksumtypep) const char *alias; const struct krb5_cksumtypes *ctp; - for (i=0; i<krb5_cksumtypes_length; i++) { - ctp = &krb5_cksumtypes_list[i]; + for (i=0; i<krb5int_cksumtypes_length; i++) { + ctp = &krb5int_cksumtypes_list[i]; if (strcasecmp(ctp->name, string) == 0) { *cksumtypep = ctp->ctype; return 0; diff --git a/src/lib/crypto/krb/string_to_enctype.c b/src/lib/crypto/krb/string_to_enctype.c index 141c36c..4978ac7 100644 --- a/src/lib/crypto/krb/string_to_enctype.c +++ b/src/lib/crypto/krb/string_to_enctype.c @@ -35,8 +35,8 @@ krb5_string_to_enctype(char *string, krb5_enctype *enctypep) const char *alias; const struct krb5_keytypes *ktp; - for (i = 0; i < krb5_enctypes_length; i++) { - ktp = &krb5_enctypes_list[i]; + for (i = 0; i < krb5int_enctypes_length; i++) { + ktp = &krb5int_enctypes_list[i]; if (strcasecmp(ktp->name, string) == 0) { *enctypep = ktp->etype; return 0; diff --git a/src/lib/crypto/krb/valid_cksumtype.c b/src/lib/crypto/krb/valid_cksumtype.c index 56a92df..d32e8f5 100644 --- a/src/lib/crypto/krb/valid_cksumtype.c +++ b/src/lib/crypto/krb/valid_cksumtype.c @@ -32,8 +32,8 @@ krb5_c_valid_cksumtype(krb5_cksumtype ctype) { unsigned int i; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == ctype) + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == ctype) return TRUE; } diff --git a/src/lib/crypto/krb/valid_enctype.c b/src/lib/crypto/krb/valid_enctype.c index b5c61d3..2657fd0 100644 --- a/src/lib/crypto/krb/valid_enctype.c +++ b/src/lib/crypto/krb/valid_enctype.c @@ -40,7 +40,7 @@ valid_enctype(krb5_enctype etype) } krb5_boolean KRB5_CALLCONV -krb5_c_weak_enctype(krb5_enctype etype) +krb5int_c_weak_enctype(krb5_enctype etype) { const struct krb5_keytypes *ktp; diff --git a/src/lib/crypto/krb/verify_checksum.c b/src/lib/crypto/krb/verify_checksum.c index 82f4fb1..d8a9cc8 100644 --- a/src/lib/crypto/krb/verify_checksum.c +++ b/src/lib/crypto/krb/verify_checksum.c @@ -40,13 +40,13 @@ krb5_k_verify_checksum(krb5_context context, krb5_key key, krb5_data indata; krb5_checksum computed; - for (i=0; i<krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == cksum->checksum_type) + for (i=0; i<krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == cksum->checksum_type) break; } - if (i == krb5_cksumtypes_length) + if (i == krb5int_cksumtypes_length) return KRB5_BAD_ENCTYPE; - ctp = &krb5_cksumtypes_list[i]; + ctp = &krb5int_cksumtypes_list[i]; indata.length = cksum->length; indata.data = (char *) cksum->contents; diff --git a/src/lib/crypto/krb/verify_checksum_iov.c b/src/lib/crypto/krb/verify_checksum_iov.c index f322dc3..f72ca65 100644 --- a/src/lib/crypto/krb/verify_checksum_iov.c +++ b/src/lib/crypto/krb/verify_checksum_iov.c @@ -44,13 +44,13 @@ krb5_k_verify_checksum_iov(krb5_context context, krb5_data computed; krb5_crypto_iov *checksum; - for (i = 0; i < krb5_cksumtypes_length; i++) { - if (krb5_cksumtypes_list[i].ctype == checksum_type) + for (i = 0; i < krb5int_cksumtypes_length; i++) { + if (krb5int_cksumtypes_list[i].ctype == checksum_type) break; } - if (i == krb5_cksumtypes_length) + if (i == krb5int_cksumtypes_length) return KRB5_BAD_ENCTYPE; - ctp = &krb5_cksumtypes_list[i]; + ctp = &krb5int_cksumtypes_list[i]; checksum = krb5int_c_locate_iov((krb5_crypto_iov *)data, num_data, KRB5_CRYPTO_TYPE_CHECKSUM); @@ -81,7 +81,7 @@ krb5_k_verify_checksum_iov(krb5_context context, if (computed.data == NULL) return ENOMEM; - ret = krb5int_c_make_checksum_iov(&krb5_cksumtypes_list[i], key, usage, + ret = krb5int_c_make_checksum_iov(&krb5int_cksumtypes_list[i], key, usage, data, num_data, &computed); if (ret) { free(computed.data); diff --git a/src/lib/crypto/libk5crypto.exports b/src/lib/crypto/libk5crypto.exports index 097886c..03804c9 100644 --- a/src/lib/crypto/libk5crypto.exports +++ b/src/lib/crypto/libk5crypto.exports @@ -1,14 +1,14 @@ is_coll_proof_cksum is_keyed_cksum -krb5_MD4Final -krb5_MD4Init -krb5_MD4Update -krb5_MD5Final -krb5_MD5Init -krb5_MD5Update -krb5_arcfour_decrypt -krb5_arcfour_encrypt -krb5_arcfour_encrypt_length +krb5int_MD4Final +krb5int_MD4Init +krb5int_MD4Update +krb5int_MD5Final +krb5int_MD5Init +krb5int_MD5Update +krb5int_arcfour_decrypt +krb5int_arcfour_encrypt +krb5int_arcfour_encrypt_length krb5_c_block_size krb5_c_fx_cf2_simple krb5_c_checksum_length @@ -43,31 +43,31 @@ krb5_c_valid_cksumtype krb5_c_valid_enctype krb5_c_verify_checksum krb5_c_verify_checksum_iov -krb5_c_weak_enctype +krb5int_c_weak_enctype krb5_calculate_checksum krb5_checksum_size krb5_cksumtype_to_string -krb5_cksumtypes_length -krb5_cksumtypes_list +krb5int_cksumtypes_length +krb5int_cksumtypes_list krb5_decrypt krb5_decrypt_data -krb5_derive_key -krb5_derive_random -krb5_dk_decrypt -krb5_dk_encrypt -krb5_dk_encrypt_length -krb5_dk_make_checksum +krb5int_derive_key +krb5int_derive_random +krb5int_dk_decrypt +krb5int_dk_encrypt +krb5int_dk_encrypt_length +krb5int_dk_make_checksum krb5_eblock_enctype krb5_encrypt krb5_encrypt_data krb5_encrypt_size krb5_enctype_to_string -krb5_enctypes_length -krb5_enctypes_list +krb5int_enctypes_length +krb5int_enctypes_list krb5_finish_key krb5_finish_random_key krb5_free_cksumtypes -krb5_hmac +krb5int_hmac krb5_init_random_key krb5_k_create_key krb5_k_decrypt @@ -81,15 +81,15 @@ krb5_k_make_checksum krb5_k_make_checksum_iov krb5_k_verify_checksum krb5_k_verify_checksum_iov -krb5_nfold -krb5_old_decrypt -krb5_old_encrypt -krb5_old_encrypt_length +krb5int_nfold +krb5int_old_decrypt +krb5int_old_encrypt +krb5int_old_encrypt_length krb5_process_key krb5_random_confounder krb5_random_key -krb5_raw_decrypt -krb5_raw_encrypt +krb5int_raw_decrypt +krb5int_raw_encrypt krb5_raw_encrypt_length krb5_string_to_cksumtype krb5_string_to_enctype diff --git a/src/lib/crypto/openssl/aes/aes_s2k.c b/src/lib/crypto/openssl/aes/aes_s2k.c index db6553e..1b088ae 100644 --- a/src/lib/crypto/openssl/aes/aes_s2k.c +++ b/src/lib/crypto/openssl/aes/aes_s2k.c @@ -81,7 +81,7 @@ krb5int_aes_string_to_key(const struct krb5_enc_provider *enc, if (err) goto cleanup; - err = krb5_derive_keyblock (enc, tempkey, key, &usage); + err = krb5int_derive_keyblock (enc, tempkey, key, &usage); cleanup: if (err) diff --git a/src/lib/crypto/openssl/arcfour/arcfour.c b/src/lib/crypto/openssl/arcfour/arcfour.c index 719bfaa..68feb49 100644 --- a/src/lib/crypto/openssl/arcfour/arcfour.c +++ b/src/lib/crypto/openssl/arcfour/arcfour.c @@ -13,7 +13,7 @@ of RSA Data Security) const char *const krb5int_arcfour_l40 = "fortybits"; void -krb5_arcfour_encrypt_length(const struct krb5_enc_provider *enc, +krb5int_arcfour_encrypt_length(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, size_t inputlen, size_t *length) { @@ -63,7 +63,7 @@ case 7: /* tgs-req authenticator */ /* RFC 4757 */ krb5_error_code -krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, +krb5int_arcfour_encrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, @@ -149,7 +149,7 @@ krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, salt.length=4; store_32_le(ms_usage, salt.data); } - krb5_hmac(hash, key, 1, &salt, &d1); + krb5int_hmac(hash, key, 1, &salt, &d1); memcpy(k2.contents, k1.contents, k2.length); @@ -193,7 +193,7 @@ krb5_arcfour_encrypt(const struct krb5_enc_provider *enc, /* This is the arcfour-hmac decryption routine */ krb5_error_code -krb5_arcfour_decrypt(const struct krb5_enc_provider *enc, +krb5int_arcfour_decrypt(const struct krb5_enc_provider *enc, const struct krb5_hash_provider *hash, krb5_key key, krb5_keyusage usage, const krb5_data *ivec, const krb5_data *input, @@ -276,7 +276,7 @@ krb5_arcfour_decrypt(const struct krb5_enc_provider *enc, salt.length = 4; store_32_le(ms_usage, salt.data); } - ret = krb5_hmac(hash, key, 1, &salt, &d1); + ret = krb5int_hmac(hash, key, 1, &salt, &d1); if (ret) goto cleanup; diff --git a/src/lib/crypto/openssl/arcfour/arcfour.h b/src/lib/crypto/openssl/arcfour/arcfour.h index 1a28764..e00708a 100644 --- a/src/lib/crypto/openssl/arcfour/arcfour.h +++ b/src/lib/crypto/openssl/arcfour/arcfour.h @@ -2,13 +2,13 @@ #define ARCFOUR_H extern void -krb5_arcfour_encrypt_length(const struct krb5_enc_provider *, +krb5int_arcfour_encrypt_length(const struct krb5_enc_provider *, const struct krb5_hash_provider *, size_t, size_t *); -extern -krb5_error_code krb5_arcfour_encrypt(const struct krb5_enc_provider *, +extern krb5_error_code +krb5int_arcfour_encrypt(const struct krb5_enc_provider *, const struct krb5_hash_provider *, krb5_key, krb5_keyusage, @@ -16,8 +16,8 @@ krb5_error_code krb5_arcfour_encrypt(const struct krb5_enc_provider *, const krb5_data *, krb5_data *); -extern -krb5_error_code krb5_arcfour_decrypt(const struct krb5_enc_provider *, +extern krb5_error_code +krb5int_arcfour_decrypt(const struct krb5_enc_provider *, const struct krb5_hash_provider *, krb5_key, krb5_keyusage, @@ -25,7 +25,8 @@ krb5_error_code krb5_arcfour_decrypt(const struct krb5_enc_provider *, const krb5_data *, krb5_data *); -extern krb5_error_code krb5int_arcfour_string_to_key( +extern krb5_error_code +krb5int_arcfour_string_to_key( const struct krb5_enc_provider *, const krb5_data *, const krb5_data *, diff --git a/src/lib/crypto/openssl/arcfour/arcfour_aead.c b/src/lib/crypto/openssl/arcfour/arcfour_aead.c index 4896afa..c01fc00 100644 --- a/src/lib/crypto/openssl/arcfour/arcfour_aead.c +++ b/src/lib/crypto/openssl/arcfour/arcfour_aead.c @@ -152,7 +152,7 @@ krb5int_arcfour_encrypt_iov(const struct krb5_aead_provider *aead, salt.length = 4; store_32_le(ms_usage, salt.data); } - ret = krb5_hmac(hash, key, 1, &salt, &d1); + ret = krb5int_hmac(hash, key, 1, &salt, &d1); if (ret != 0) goto cleanup; @@ -272,7 +272,7 @@ krb5int_arcfour_decrypt_iov(const struct krb5_aead_provider *aead, salt.length = 4; store_32_le(ms_usage, (unsigned char *)salt.data); } - ret = krb5_hmac(hash, key, 1, &salt, &d1); + ret = krb5int_hmac(hash, key, 1, &salt, &d1); if (ret != 0) goto cleanup; diff --git a/src/lib/crypto/openssl/arcfour/arcfour_s2k.c b/src/lib/crypto/openssl/arcfour/arcfour_s2k.c index 41053ed..09c9b76 100644 --- a/src/lib/crypto/openssl/arcfour/arcfour_s2k.c +++ b/src/lib/crypto/openssl/arcfour/arcfour_s2k.c @@ -35,9 +35,9 @@ krb5int_arcfour_string_to_key(const struct krb5_enc_provider *enc, return err; /* the actual MD4 hash of the data */ - krb5_MD4Init(&md4_context); - krb5_MD4Update(&md4_context, copystr, copystrlen); - krb5_MD4Final(&md4_context); + krb5int_MD4Init(&md4_context); + krb5int_MD4Update(&md4_context, copystr, copystrlen); + krb5int_MD4Final(&md4_context); memcpy(key->contents, md4_context.digest, 16); #if 0 diff --git a/src/lib/crypto/openssl/hash_provider/hash_md4.c b/src/lib/crypto/openssl/hash_provider/hash_md4.c index f507aaa..3a4a4d5 100644 --- a/src/lib/crypto/openssl/hash_provider/hash_md4.c +++ b/src/lib/crypto/openssl/hash_provider/hash_md4.c @@ -38,10 +38,10 @@ k5_md4_hash(unsigned int icount, const krb5_data *input, if (output->length != RSA_MD4_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); - krb5_MD4Init(&ctx); + krb5int_MD4Init(&ctx); for (i=0; i<icount; i++) - krb5_MD4Update(&ctx, (unsigned char *) input[i].data, input[i].length); - krb5_MD4Final(&ctx); + krb5int_MD4Update(&ctx, (unsigned char *) input[i].data, input[i].length); + krb5int_MD4Final(&ctx); memcpy(output->data, ctx.digest, RSA_MD4_CKSUM_LENGTH); diff --git a/src/lib/crypto/openssl/hash_provider/hash_md5.c b/src/lib/crypto/openssl/hash_provider/hash_md5.c index a6e380a..10840d0 100644 --- a/src/lib/crypto/openssl/hash_provider/hash_md5.c +++ b/src/lib/crypto/openssl/hash_provider/hash_md5.c @@ -38,10 +38,10 @@ k5_md5_hash(unsigned int icount, const krb5_data *input, if (output->length != RSA_MD5_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); - krb5_MD5Init(&ctx); + krb5int_MD5Init(&ctx); for (i=0; i<icount; i++) - krb5_MD5Update(&ctx, (unsigned char *) input[i].data, input[i].length); - krb5_MD5Final(&ctx); + krb5int_MD5Update(&ctx, (unsigned char *) input[i].data, input[i].length); + krb5int_MD5Final(&ctx); memcpy(output->data, ctx.digest, RSA_MD5_CKSUM_LENGTH); diff --git a/src/lib/crypto/openssl/hmac.c b/src/lib/crypto/openssl/hmac.c index 658bc28..f0734b6 100644 --- a/src/lib/crypto/openssl/hmac.c +++ b/src/lib/crypto/openssl/hmac.c @@ -112,7 +112,7 @@ krb5int_hmac_iov_keyblock(const struct krb5_hash_provider *hash, } krb5_error_code -krb5_hmac(const struct krb5_hash_provider *hash, krb5_key key, +krb5int_hmac(const struct krb5_hash_provider *hash, krb5_key key, unsigned int icount, const krb5_data *input, krb5_data *output) { return krb5int_hmac_keyblock(hash, &key->keyblock, icount, input, output); diff --git a/src/lib/crypto/openssl/md4/md4.c b/src/lib/crypto/openssl/md4/md4.c index 88d5191..88f5e36 100644 --- a/src/lib/crypto/openssl/md4/md4.c +++ b/src/lib/crypto/openssl/md4/md4.c @@ -8,20 +8,20 @@ #include <openssl/md4.h> void -krb5_MD4Init (krb5_MD4_CTX *mdContext) +krb5int_MD4Init (krb5_MD4_CTX *mdContext) { EVP_MD_CTX_init(&mdContext->ossl_md4_ctx ); EVP_DigestInit_ex(&mdContext->ossl_md4_ctx, EVP_md4(), NULL); } void -krb5_MD4Update (krb5_MD4_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) +krb5int_MD4Update (krb5_MD4_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) { EVP_DigestUpdate(&mdContext->ossl_md4_ctx, inBuf, inLen); } void -krb5_MD4Final (krb5_MD4_CTX *mdContext) +krb5int_MD4Final (krb5_MD4_CTX *mdContext) { EVP_DigestFinal_ex(&mdContext->ossl_md4_ctx, mdContext->digest , NULL); EVP_MD_CTX_cleanup(&mdContext->ossl_md4_ctx ); diff --git a/src/lib/crypto/openssl/md4/rsa-md4.h b/src/lib/crypto/openssl/md4/rsa-md4.h index 4b02047..ec4e045 100644 --- a/src/lib/crypto/openssl/md4/rsa-md4.h +++ b/src/lib/crypto/openssl/md4/rsa-md4.h @@ -87,9 +87,9 @@ typedef struct { unsigned char digest[16]; /* actual digest after MD4Final call */ } krb5_MD4_CTX; -extern void krb5_MD4Init(krb5_MD4_CTX *); -extern void krb5_MD4Update(krb5_MD4_CTX *, const unsigned char *, unsigned int); -extern void krb5_MD4Final(krb5_MD4_CTX *); +extern void krb5int_MD4Init(krb5_MD4_CTX *); +extern void krb5int_MD4Update(krb5_MD4_CTX *, const unsigned char *, unsigned int); +extern void krb5int_MD4Final(krb5_MD4_CTX *); /* ********************************************************************** diff --git a/src/lib/crypto/openssl/md5/md5.c b/src/lib/crypto/openssl/md5/md5.c index 8519dd5..2a725dc 100644 --- a/src/lib/crypto/openssl/md5/md5.c +++ b/src/lib/crypto/openssl/md5/md5.c @@ -4,31 +4,31 @@ #include <openssl/evp.h> #include <openssl/md5.h> -/* The routine krb5_MD5Init initializes the message-digest context +/* The routine krb5int_MD5Init initializes the message-digest context mdContext. All fields are set to zero. */ void -krb5_MD5Init (krb5_MD5_CTX *mdContext) +krb5int_MD5Init (krb5_MD5_CTX *mdContext) { EVP_MD_CTX_init(&mdContext->ossl_md5_ctx); EVP_DigestInit_ex(&mdContext->ossl_md5_ctx, EVP_md5(), NULL); } -/* The routine krb5_MD5Update updates the message-digest context to +/* The routine krb5int_MD5Update updates the message-digest context to account for the presence of each of the characters inBuf[0..inLen-1] in the message whose digest is being computed. */ void -krb5_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) +krb5int_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) { EVP_DigestUpdate(&mdContext->ossl_md5_ctx, inBuf, inLen); } -/* The routine krb5_MD5Final terminates the message-digest computation and +/* The routine krb5int_MD5Final terminates the message-digest computation and ends with the desired message digest in mdContext->digest[0...15]. */ void -krb5_MD5Final (krb5_MD5_CTX *mdContext) +krb5int_MD5Final (krb5_MD5_CTX *mdContext) { EVP_DigestFinal_ex(&mdContext->ossl_md5_ctx, mdContext->digest, NULL); EVP_MD_CTX_cleanup(&mdContext->ossl_md5_ctx); diff --git a/src/lib/crypto/openssl/md5/rsa-md5.h b/src/lib/crypto/openssl/md5/rsa-md5.h index 7240b20..3142f6b 100644 --- a/src/lib/crypto/openssl/md5/rsa-md5.h +++ b/src/lib/crypto/openssl/md5/rsa-md5.h @@ -15,9 +15,9 @@ typedef struct { unsigned char digest[16]; /* actual digest after MD5Final call */ } krb5_MD5_CTX; -extern void krb5_MD5Init(krb5_MD5_CTX *); -extern void krb5_MD5Update(krb5_MD5_CTX *,const unsigned char *,unsigned int); -extern void krb5_MD5Final(krb5_MD5_CTX *); +extern void krb5int_MD5Init(krb5_MD5_CTX *); +extern void krb5int_MD5Update(krb5_MD5_CTX *,const unsigned char *,unsigned int); +extern void krb5int_MD5Final(krb5_MD5_CTX *); #define RSA_MD5_CKSUM_LENGTH 16 #define OLD_RSA_MD5_DES_CKSUM_LENGTH 16 diff --git a/src/lib/gssapi/krb5/util_crypt.c b/src/lib/gssapi/krb5/util_crypt.c index 8afd603..0f712ea 100644 --- a/src/lib/gssapi/krb5/util_crypt.c +++ b/src/lib/gssapi/krb5/util_crypt.c @@ -321,7 +321,7 @@ kg_arcfour_docrypt(const krb5_keyblock *longterm_key , int ms_usage, input.length = i; output.data = (void *) usage_key.contents; output.length = usage_key.length; - code = (*kaccess.krb5_hmac) (kaccess.md5_hash_provider, + code = (*kaccess.krb5int_hmac) (kaccess.md5_hash_provider, longterm_key, 1, &input, &output); if (code) goto cleanup_arcfour; @@ -331,7 +331,7 @@ kg_arcfour_docrypt(const krb5_keyblock *longterm_key , int ms_usage, input.data = ( void *) kd_data; input.length = kd_data_len; output.data = (void *) seq_enc_key.contents; - code = (*kaccess.krb5_hmac) (kaccess.md5_hash_provider, + code = (*kaccess.krb5int_hmac) (kaccess.md5_hash_provider, &usage_key, 1, &input, &output); if (code) goto cleanup_arcfour; @@ -667,7 +667,7 @@ kg_arcfour_docrypt_iov(krb5_context context, input.length = i; output.data = (void *) usage_key.contents; output.length = usage_key.length; - code = (*kaccess.krb5_hmac) (kaccess.md5_hash_provider, + code = (*kaccess.krb5int_hmac) (kaccess.md5_hash_provider, longterm_key, 1, &input, &output); if (code) goto cleanup_arcfour; @@ -677,7 +677,7 @@ kg_arcfour_docrypt_iov(krb5_context context, input.data = ( void *) kd_data; input.length = kd_data_len; output.data = (void *) seq_enc_key.contents; - code = (*kaccess.krb5_hmac) (kaccess.md5_hash_provider, + code = (*kaccess.krb5int_hmac) (kaccess.md5_hash_provider, &usage_key, 1, &input, &output); if (code) goto cleanup_arcfour; diff --git a/src/lib/krb5/krb/init_ctx.c b/src/lib/krb5/krb/init_ctx.c index 2545be3..ea78e0d 100644 --- a/src/lib/krb5/krb/init_ctx.c +++ b/src/lib/krb5/krb/init_ctx.c @@ -309,7 +309,7 @@ set_default_etype_var(krb5_context context, const krb5_enctype *etypes, for (i = 0; etypes[i]; i++) { if (!krb5_c_valid_enctype(etypes[i])) return KRB5_PROG_ETYPE_NOSUPP; - if (!context->allow_weak_crypto && krb5_c_weak_enctype(etypes[i])) + if (!context->allow_weak_crypto && krb5int_c_weak_enctype(etypes[i])) return KRB5_PROG_ETYPE_NOSUPP; } @@ -357,7 +357,7 @@ mod_list(krb5_enctype etype, krb5_boolean add, krb5_boolean allow_weak, unsigned int i; assert(etype > 0 && etype <= MAX_ENCTYPE); - if (!allow_weak && krb5_c_weak_enctype(etype)) + if (!allow_weak && krb5int_c_weak_enctype(etype)) return; for (i = 0; i < *count; i++) { if (list[i] == etype) { diff --git a/src/lib/krb5/os/accessor.c b/src/lib/krb5/os/accessor.c index 5575687..6df7e11 100644 --- a/src/lib/krb5/os/accessor.c +++ b/src/lib/krb5/os/accessor.c @@ -52,7 +52,7 @@ krb5int_accessor(krb5int_access *internals, krb5_int32 version) krb5int_access internals_temp; #endif S (free_addrlist, krb5int_free_addrlist), - S (krb5_hmac, krb5int_hmac_keyblock), + S (krb5int_hmac, krb5int_hmac_keyblock), S (krb5_auth_con_get_subkey_enctype, krb5_auth_con_get_subkey_enctype), S (md5_hash_provider, &krb5int_hash_md5), S (arcfour_enc_provider, &krb5int_enc_arcfour), diff --git a/src/tests/misc/test_nfold.c b/src/tests/misc/test_nfold.c index 78b5866..7a0bffe 100644 --- a/src/tests/misc/test_nfold.c +++ b/src/tests/misc/test_nfold.c @@ -51,7 +51,7 @@ int main(int argc, char *argv[]) exit(1); } - krb5_nfold(inlen,instr,outlen,outstr); + krb5int_nfold(inlen,instr,outlen,outstr); printf("%d-fold(",outlen); for (i=0; i<(inlen/8); i++) |