scepclient: Replaced usages of datatot().

This commit is contained in:
Tobias Brunner
2012-06-11 17:09:19 +02:00
parent a2ddcc3695
commit 50e51bee54
+4 -4
View File
@@ -1,4 +1,5 @@
/* /*
* Copyright (C) 2012 Tobias Brunner
* Copyright (C) 2005 Jan Hutter, Martin Willi * Copyright (C) 2005 Jan Hutter, Martin Willi
* Hochschule fuer Technik Rapperswil * Hochschule fuer Technik Rapperswil
* *
@@ -299,9 +300,7 @@ void scep_generate_transaction_id(public_key_t *key, chunk_t *transID,
memcpy(pos, digest.ptr, digest.len); memcpy(pos, digest.ptr, digest.len);
/* the transaction id is the serial number in hex format */ /* the transaction id is the serial number in hex format */
transID->len = 2*digest.len; *transID = chunk_to_hex(digest, NULL, FALSE);
transID->ptr = malloc(transID->len + 1);
datatot(digest.ptr, digest.len, 16, transID->ptr, transID->len + 1);
} }
/** /**
@@ -394,7 +393,8 @@ static char* escape_http_request(chunk_t req)
char *encoded_req = malloc(len); char *encoded_req = malloc(len);
/* do the base64 conversion */ /* do the base64 conversion */
len = datatot(req.ptr, req.len, 64, encoded_req, len); chunk_t base64 = chunk_to_base64(req, encoded_req);
len = base64.len + 1;
/* compute newline characters to be inserted every 64 characters */ /* compute newline characters to be inserted every 64 characters */
lines = (len - 2) / 64; lines = (len - 2) / 64;