X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=armor.c;h=ab10f41dbc1e0cd6a49edca3c7ca0ab6a141a06c;hb=be5ba2d0e5abe871511b60918ace010acddb1f5e;hp=230510a24ed7fbaecbb3c4e919fa56d37a6b638f;hpb=d38e1f468376f8b19b208f2da4d20cb2919875dd;p=onak.git
diff --git a/armor.c b/armor.c
index 230510a..ab10f41 100644
--- a/armor.c
+++ b/armor.c
@@ -14,18 +14,16 @@
* more details.
*
* You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program. If not, see .
*/
#include
+#include "build-config.h"
+
#include "armor.h"
#include "keystructs.h"
-#include "log.h"
-#include "onak-conf.h"
#include "parsekey.h"
-#include "version.h"
/**
* @brief Line length we'll use for armored output
@@ -56,7 +54,7 @@ static unsigned char encode64(unsigned char c) {
} else if (c == 63) {
c = '/';
} else {
- log_assert(c < 64);
+ c = '?';
}
return c;
@@ -165,7 +163,6 @@ static int armor_putchar_int(void *ctx, unsigned char c)
unsigned char t;
int i;
- log_assert(ctx != NULL);
state = (struct armor_context *) ctx;
switch (state->curoctet++) {
@@ -210,7 +207,6 @@ static int armor_putchar(void *ctx, size_t count, void *c)
{
int i;
- log_assert(c != NULL);
for (i = 0; i < count; i++) {
armor_putchar_int(ctx, ((char *) c)[i]);
@@ -269,7 +265,6 @@ static int dearmor_getchar(void *ctx, unsigned char *c)
unsigned char tmpc;
int i;
- log_assert(ctx != NULL);
state = (struct dearmor_context *) ctx;
*c = 0;
@@ -337,9 +332,7 @@ int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
*/
putchar_func(ctx, sizeof("-----BEGIN PGP PUBLIC KEY BLOCK-----\n") - 1,
(unsigned char *) "-----BEGIN PGP PUBLIC KEY BLOCK-----\n");
- putchar_func(ctx, sizeof("Version: onak " ONAK_VERSION "\n\n") - 1,
- (unsigned char *) "Version: onak " ONAK_VERSION "\n\n");
-
+
armor_init(&armor_ctx);
armor_ctx.putchar_func = putchar_func;
armor_ctx.ctx = ctx;