summaryrefslogtreecommitdiffstats
path: root/src/plugins/preauth
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2013-02-14 11:41:10 -0500
committerGreg Hudson <ghudson@mit.edu>2013-02-14 11:42:28 -0500
commit6dda284554a869f7fa1e6d2a035df06c97f103ef (patch)
tree6854b38ce7274b914b82b20bfb65eb8130df1ab8 /src/plugins/preauth
parent80f53c8b2c745e75dc9d22acba63812d8533c133 (diff)
downloadkrb5-6dda284554a869f7fa1e6d2a035df06c97f103ef.tar.gz
krb5-6dda284554a869f7fa1e6d2a035df06c97f103ef.tar.xz
krb5-6dda284554a869f7fa1e6d2a035df06c97f103ef.zip
Modernize k5buf
Rename the krb5int_buf_ family of functions to use the k5_ prefix for brevity. Reformat some k5buf implementation code to match current practices.
Diffstat (limited to 'src/plugins/preauth')
-rw-r--r--src/plugins/preauth/pkinit/pkinit_crypto_nss.c35
-rw-r--r--src/plugins/preauth/pkinit/pkinit_crypto_openssl.c35
2 files changed, 30 insertions, 40 deletions
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_nss.c b/src/plugins/preauth/pkinit/pkinit_crypto_nss.c
index 7f73fbd25a..b33ce749b4 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_nss.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_nss.c
@@ -2053,39 +2053,34 @@ reassemble_pkcs11_name(PLArenaPool *pool, pkinit_identity_opts *idopts)
int n = 0;
char *ret;
- krb5int_buf_init_dynamic(&buf);
- krb5int_buf_add(&buf, "PKCS11:");
+ k5_buf_init_dynamic(&buf);
+ k5_buf_add(&buf, "PKCS11:");
n = 0;
if (idopts->p11_module_name != NULL) {
- krb5int_buf_add_fmt(&buf, "%smodule_name=%s",
- n++ ? "," : "",
- idopts->p11_module_name);
+ k5_buf_add_fmt(&buf, "%smodule_name=%s", n++ ? "," : "",
+ idopts->p11_module_name);
}
if (idopts->token_label != NULL) {
- krb5int_buf_add_fmt(&buf, "%stoken=%s",
- n++ ? "," : "",
- idopts->token_label);
+ k5_buf_add_fmt(&buf, "%stoken=%s", n++ ? "," : "",
+ idopts->token_label);
}
if (idopts->cert_label != NULL) {
- krb5int_buf_add_fmt(&buf, "%scertlabel=%s",
- n++ ? "," : "",
- idopts->cert_label);
+ k5_buf_add_fmt(&buf, "%scertlabel=%s", n++ ? "," : "",
+ idopts->cert_label);
}
if (idopts->cert_id_string != NULL) {
- krb5int_buf_add_fmt(&buf, "%scertid=%s",
- n++ ? "," : "",
- idopts->cert_id_string);
+ k5_buf_add_fmt(&buf, "%scertid=%s", n++ ? "," : "",
+ idopts->cert_id_string);
}
if (idopts->slotid != PK_NOSLOT) {
- krb5int_buf_add_fmt(&buf, "%sslotid=%ld",
- n++ ? "," : "",
- (long)idopts->slotid);
+ k5_buf_add_fmt(&buf, "%sslotid=%ld", n++ ? "," : "",
+ (long)idopts->slotid);
}
- if (krb5int_buf_len(&buf) >= 0)
- ret = PORT_ArenaStrdup(pool, krb5int_buf_data(&buf));
+ if (k5_buf_len(&buf) >= 0)
+ ret = PORT_ArenaStrdup(pool, k5_buf_data(&buf));
else
ret = NULL;
- krb5int_free_buf(&buf);
+ k5_free_buf(&buf);
return ret;
}
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
index 17c37c66bb..0360736d96 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
@@ -4491,39 +4491,34 @@ reassemble_pkcs11_name(pkinit_identity_opts *idopts)
int n = 0;
char *ret;
- krb5int_buf_init_dynamic(&buf);
- krb5int_buf_add(&buf, "PKCS11:");
+ k5_buf_init_dynamic(&buf);
+ k5_buf_add(&buf, "PKCS11:");
n = 0;
if (idopts->p11_module_name != NULL) {
- krb5int_buf_add_fmt(&buf, "%smodule_name=%s",
- n++ ? "," : "",
- idopts->p11_module_name);
+ k5_buf_add_fmt(&buf, "%smodule_name=%s", n++ ? "," : "",
+ idopts->p11_module_name);
}
if (idopts->token_label != NULL) {
- krb5int_buf_add_fmt(&buf, "%stoken=%s",
- n++ ? "," : "",
- idopts->token_label);
+ k5_buf_add_fmt(&buf, "%stoken=%s", n++ ? "," : "",
+ idopts->token_label);
}
if (idopts->cert_label != NULL) {
- krb5int_buf_add_fmt(&buf, "%scertlabel=%s",
- n++ ? "," : "",
- idopts->cert_label);
+ k5_buf_add_fmt(&buf, "%scertlabel=%s", n++ ? "," : "",
+ idopts->cert_label);
}
if (idopts->cert_id_string != NULL) {
- krb5int_buf_add_fmt(&buf, "%scertid=%s",
- n++ ? "," : "",
- idopts->cert_id_string);
+ k5_buf_add_fmt(&buf, "%scertid=%s", n++ ? "," : "",
+ idopts->cert_id_string);
}
if (idopts->slotid != PK_NOSLOT) {
- krb5int_buf_add_fmt(&buf, "%sslotid=%ld",
- n++ ? "," : "",
- (long)idopts->slotid);
+ k5_buf_add_fmt(&buf, "%sslotid=%ld", n++ ? "," : "",
+ (long)idopts->slotid);
}
- if (krb5int_buf_len(&buf) >= 0)
- ret = strdup(krb5int_buf_data(&buf));
+ if (k5_buf_len(&buf) >= 0)
+ ret = strdup(k5_buf_data(&buf));
else
ret = NULL;
- krb5int_free_buf(&buf);
+ k5_free_buf(&buf);
return ret;
}