summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-11-09 15:04:13 +0200
committerPanu Matilainen <pmatilai@redhat.com>2011-11-09 15:16:28 +0200
commit70f063cb773bedb7d336429d9bc8ed1d4e5d18f4 (patch)
tree6d525fdbb1e92051dda4b05e5c23fc7f2e531f71 /lib/formats.c
parent6bced5bc08c3c8291fc7488c35e1703cba0f9ef6 (diff)
downloadlibrpm-tizen-70f063cb773bedb7d336429d9bc8ed1d4e5d18f4.tar.gz
librpm-tizen-70f063cb773bedb7d336429d9bc8ed1d4e5d18f4.tar.bz2
librpm-tizen-70f063cb773bedb7d336429d9bc8ed1d4e5d18f4.zip
Make base64 encoding/decoding part of rpmio public API
- Base64 is present in headers and all, it's only reasonable that our API users have access to this functionality without having to link to other libraries. Even if we didn't want to carry the implementation forever in our codebase, we should provide a wrapping for this (much like the other crypto stuff) for the reason stated above. - A bigger issue is that our dirty little (badly hidden) secret was using non-namespaced function names, clashing with at least beecrypt. And we couldn't have made these internal-only symbols even on platforms that support it, because they are used all over the place outside rpmio. So... rename the b64 functions to rpmLikeNamingStyle and make 'em public. No functional changes, just trivial renaming despite touching numerous places.
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/formats.c b/lib/formats.c
index 03d32f238..6edb264bb 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -305,7 +305,7 @@ static char * armorFormat(rpmtd td)
case RPM_STRING_TYPE:
case RPM_STRING_ARRAY_TYPE:
enc = rpmtdGetString(td);
- if (b64decode(enc, (void **)&bs, &ns))
+ if (rpmBase64Decode(enc, (void **)&bs, &ns))
return xstrdup(_("(not base64)"));
s = bs;
atype = PGPARMOR_PUBKEY; /* XXX check pkt for pubkey */
@@ -343,7 +343,7 @@ static char * base64Format(rpmtd td)
if (rpmtdType(td) != RPM_BIN_TYPE) {
val = xstrdup(_("(not a blob)"));
} else {
- val = b64encode(td->data, td->count, -1);
+ val = rpmBase64Encode(td->data, td->count, -1);
if (val == NULL)
val = xstrdup("");
}