X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=crypt_common.c;h=71aabf53f944eea64d4214fccff354787b7e6f9b;hp=8de346c74b47468a15c566cae29a4ff484b056c6;hb=3889b355ca075111a717da36946c779b7474a63d;hpb=5ff2b0b3a6f9242033c436fb8272245f5594dd8c diff --git a/crypt_common.c b/crypt_common.c index 8de346c7..71aabf53 100644 --- a/crypt_common.c +++ b/crypt_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2011 Andre Noll + * Copyright (C) 2005-2014 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -7,13 +7,12 @@ /** \file crypt_common.c Crypto functions independent of openssl/libgcrypt. */ #include -#include #include "para.h" #include "error.h" #include "string.h" -#include "crypt_backend.h" #include "crypt.h" +#include "crypt_backend.h" /** If the key begins with this text, we treat it as an ssh key. */ #define KEY_TYPE_TXT "ssh-rsa" @@ -322,33 +321,3 @@ int hash_compare(unsigned char *h1, unsigned char *h2) } return 0; } - -int sc_recv_buffer(struct stream_cipher_context *scc, char *buf, size_t size) -{ - int n; - - assert(size); - n = sc_recv_bin_buffer(scc, buf, size - 1); - if (n >= 0) - buf[n] = '\0'; - else - *buf = '\0'; - return n; -} - -int sc_send_buffer(struct stream_cipher_context *scc, char *buf) -{ - return sc_send_bin_buffer(scc, buf, strlen(buf)); -} - -__printf_2_3 int sc_send_va_buffer(struct stream_cipher_context *scc, - const char *fmt, ...) -{ - char *msg; - int ret; - - PARA_VSPRINTF(fmt, msg); - ret = sc_send_buffer(scc, msg); - free(msg); - return ret; -}