Reload configuration through control socket
[tinc] / src / gcrypt / cipher.c
index e1f1e05..71add00 100644 (file)
@@ -173,7 +173,7 @@ bool cipher_set_key(cipher_t *cipher, void *key, bool encrypt) {
        return true;
 }
 
-bool cipher_set_key(cipher_t *cipher, void *key, size_t len, bool encrypt) {
+bool cipher_set_key_from_rsa(cipher_t *cipher, void *key, size_t len, bool encrypt) {
        memcpy(cipher->key, key + len - cipher->keylen, cipher->keylen + cipher->blklen);
        memcpy(cipher->key + cipher->keylen, key + len - cipher->keylen - cipher->blklen, cipher->blklen);
 
@@ -227,7 +227,7 @@ static bool cipher_remove_padding(cipher_t *cipher, void *indata, size_t inlen,
        return true;
 }
 
-bool cipher_encrypt(cipher_t *cipher, void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) {
+bool cipher_encrypt(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) {
        gcry_error_t err;
 
        // To be fixed
@@ -240,7 +240,7 @@ bool cipher_encrypt(cipher_t *cipher, void *indata, size_t inlen, void *outdata,
        return true;
 }
 
-bool cipher_decrypt(cipher_t *cipher, void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) {
+bool cipher_decrypt(cipher_t *cipher, const void *indata, size_t inlen, void *outdata, size_t *outlen, bool oneshot) {
        gcry_error_t err;
 
        // To be fixed