/*
cipher.c -- Symmetric block cipher handling
- Copyright (C) 2007-2017 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2007-2022 Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "../system.h"
-#include <openssl/rand.h>
#include <openssl/err.h>
#include <openssl/evp.h>
+#include "log.h"
+#include "cipher.h"
#include "../cipher.h"
#include "../logger.h"
return true;
}
- logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
+ openssl_err("set key");
return false;
}
return true;
}
- logger(DEBUG_ALWAYS, LOG_ERR, "Error while setting key: %s", ERR_error_string(ERR_get_error(), NULL));
+ openssl_err("set key");
return false;
}
}
}
- logger(DEBUG_ALWAYS, LOG_ERR, "Error while encrypting: %s", ERR_error_string(ERR_get_error(), NULL));
+ openssl_err("encrypt data");
return false;
}
}
}
- logger(DEBUG_ALWAYS, LOG_ERR, "Error while decrypting: %s", ERR_error_string(ERR_get_error(), NULL));
+ openssl_err("decrypt data");
return false;
}