| From a4b6d9ce64f132e463b9091d0536913ddaf11516 Mon Sep 17 00:00:00 2001 |
| From: Neil Horman <nhorman@tuxdriver.com> |
| Date: Thu, 30 Apr 2020 16:57:35 -0400 |
| Subject: [PATCH] Remove name conflict with libc encrypt |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| Forgot to fixup the funciton name conflict with libcs encrypt() function |
| on power systems |
| |
| Upstream-Status: Backport [https://github.com/nhorman/rng-tools/commit/a4b6d9ce64f132e463b9091d0536913ddaf11516] |
| Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
| Signed-off-by: Neil Horman <nhorman@tuxdriver.com> |
| Reported-by: Natanael Copa <ncopa@alpinelinux.org> |
| Reported-by: "Milan P. Stanić" <mps@arvanta.net> |
| --- |
| rngd_darn.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/rngd_darn.c b/rngd_darn.c |
| index 35df7a1..9345895 100644 |
| --- a/rngd_darn.c |
| +++ b/rngd_darn.c |
| @@ -109,7 +109,7 @@ static int init_openssl(struct rng *ent_src) |
| return 0; |
| } |
| |
| -int encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, |
| +static int osslencrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, |
| unsigned char *iv, unsigned char *ciphertext) |
| { |
| int len; |
| @@ -150,7 +150,7 @@ static inline int openssl_mangle(unsigned char *tmp, struct rng *ent_src) |
| unsigned char ciphertext[CHUNK_SIZE * RDRAND_ROUNDS]; |
| |
| /* Encrypt the plaintext */ |
| - ciphertext_len = encrypt (tmp, strlen(tmp), key, iv_buf, |
| + ciphertext_len = osslencrypt (tmp, strlen(tmp), key, iv_buf, |
| ciphertext); |
| printf("Calling mangle with len %d\n", ciphertext_len); |
| if (!ciphertext_len) |