summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-11-04 17:42:53 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-11-12 16:34:01 +1100
commitfd5174e88ca1727a91d6dc9bf9bd898ff9087fe8 (patch)
tree7f1511fcea311f2ef637ca23dee8699ba00adfb6 /source4
parenta8769e667514f83a45ee3e825d21a351987d0210 (diff)
downloadsamba-fd5174e88ca1727a91d6dc9bf9bd898ff9087fe8.tar.gz
samba-fd5174e88ca1727a91d6dc9bf9bd898ff9087fe8.tar.bz2
samba-fd5174e88ca1727a91d6dc9bf9bd898ff9087fe8.zip
lib/util Split data_blob_hex_string() into upper and lower
Rather than have a repeat of the bugs we found at the plugfest where hexidecimal strings must be in upper or lower case in particular places, ensure that each caller chooses which case they want. This reverts most of the callers back to upper case, as things were before tridge's patch. The critical call in the extended DN code is of course handled in lower case. Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c10
-rw-r--r--source4/lib/ldb-samba/ldif_handlers.c2
-rw-r--r--source4/lib/registry/util.c2
-rw-r--r--source4/torture/ldap/schema.c2
-rw-r--r--source4/torture/rpc/samsync.c4
5 files changed, 10 insertions, 10 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 7779a1752b..8791db2bc4 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1137,7 +1137,7 @@ static int setup_supplemental_field(struct setup_password_fields_io *io)
nt_errstr(status));
return LDB_ERR_OPERATIONS_ERROR;
}
- pknb_hexstr = data_blob_hex_string(io->ac, &pknb_blob);
+ pknb_hexstr = data_blob_hex_string_upper(io->ac, &pknb_blob);
if (!pknb_hexstr) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -1169,7 +1169,7 @@ static int setup_supplemental_field(struct setup_password_fields_io *io)
nt_errstr(status));
return LDB_ERR_OPERATIONS_ERROR;
}
- pkb_hexstr = data_blob_hex_string(io->ac, &pkb_blob);
+ pkb_hexstr = data_blob_hex_string_upper(io->ac, &pkb_blob);
if (!pkb_hexstr) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -1200,7 +1200,7 @@ static int setup_supplemental_field(struct setup_password_fields_io *io)
nt_errstr(status));
return LDB_ERR_OPERATIONS_ERROR;
}
- pdb_hexstr = data_blob_hex_string(io->ac, &pdb_blob);
+ pdb_hexstr = data_blob_hex_string_upper(io->ac, &pdb_blob);
if (!pdb_hexstr) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -1229,7 +1229,7 @@ static int setup_supplemental_field(struct setup_password_fields_io *io)
nt_errstr(status));
return LDB_ERR_OPERATIONS_ERROR;
}
- pcb_hexstr = data_blob_hex_string(io->ac, &pcb_blob);
+ pcb_hexstr = data_blob_hex_string_upper(io->ac, &pcb_blob);
if (!pcb_hexstr) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -1255,7 +1255,7 @@ static int setup_supplemental_field(struct setup_password_fields_io *io)
nt_errstr(status));
return LDB_ERR_OPERATIONS_ERROR;
}
- pb_hexstr = data_blob_hex_string(io->ac, &pb_blob);
+ pb_hexstr = data_blob_hex_string_upper(io->ac, &pb_blob);
if (!pb_hexstr) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
diff --git a/source4/lib/ldb-samba/ldif_handlers.c b/source4/lib/ldb-samba/ldif_handlers.c
index 9467bef873..d8edeb0beb 100644
--- a/source4/lib/ldb-samba/ldif_handlers.c
+++ b/source4/lib/ldb-samba/ldif_handlers.c
@@ -784,7 +784,7 @@ static int ldif_write_replUpToDateVector(struct ldb_context *ldb, void *mem_ctx,
static int extended_dn_write_hex(struct ldb_context *ldb, void *mem_ctx,
const struct ldb_val *in, struct ldb_val *out)
{
- *out = data_blob_string_const(data_blob_hex_string(mem_ctx, in));
+ *out = data_blob_string_const(data_blob_hex_string_lower(mem_ctx, in));
if (!out->data) {
return -1;
}
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index a1897eff2e..038b23fc87 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -68,7 +68,7 @@ _PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
(void **)&ret, NULL, false);
return ret;
case REG_BINARY:
- ret = data_blob_hex_string(mem_ctx, &data);
+ ret = data_blob_hex_string_upper(mem_ctx, &data);
return ret;
case REG_DWORD:
if (*(int *)data.data == 0)
diff --git a/source4/torture/ldap/schema.c b/source4/torture/ldap/schema.c
index 7fe171691a..b0a4892d7a 100644
--- a/source4/torture/ldap/schema.c
+++ b/source4/torture/ldap/schema.c
@@ -356,7 +356,7 @@ static bool test_dump_sorted_syntax(struct ldb_context *ldb, struct test_rootDSE
if (strcmp(syntaxes[i], a->attributeSyntax_oid) != 0) continue;
- om_hex = data_blob_hex_string(ldb, &a->oMObjectClass);
+ om_hex = data_blob_hex_string_upper(ldb, &a->oMObjectClass);
if (!om_hex) {
return false;
}
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 52df4eb6b9..19060c69a9 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -593,11 +593,11 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct
if (nt_hash_p) {
DATA_BLOB nt_hash_blob = data_blob_const(nt_hash_p, 16);
- DEBUG(100,("ACCOUNT [%s\\%-25s] NTHASH %s\n", samsync_state->domain_name[0], username, data_blob_hex_string(mem_ctx, &nt_hash_blob)));
+ DEBUG(100,("ACCOUNT [%s\\%-25s] NTHASH %s\n", samsync_state->domain_name[0], username, data_blob_hex_string_upper(mem_ctx, &nt_hash_blob)));
}
if (lm_hash_p) {
DATA_BLOB lm_hash_blob = data_blob_const(lm_hash_p, 16);
- DEBUG(100,("ACCOUNT [%s\\%-25s] LMHASH %s\n", samsync_state->domain_name[0], username, data_blob_hex_string(mem_ctx, &lm_hash_blob)));
+ DEBUG(100,("ACCOUNT [%s\\%-25s] LMHASH %s\n", samsync_state->domain_name[0], username, data_blob_hex_string_upper(mem_ctx, &lm_hash_blob)));
}
nt_status = test_SamLogon(samsync_state->p_netlogon_wksta, mem_ctx, samsync_state->creds_netlogon_wksta,