From 9249294000b235a0a80ee5e8c70f43c186205888 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 10 Jul 2016 16:32:39 +0200 Subject: [PATCH] gcrypt: Rename E_OEAP to E_RSA_DECODE. This error code was misleading since gcry_sexp_nth_data() can fail for other reasons as well. The patch also removes a pointless error message. --- error.h | 2 +- gcrypt.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/error.h b/error.h index dbd97ae1..3daee6af 100644 --- a/error.h +++ b/error.h @@ -165,7 +165,6 @@ PARA_ERROR(NOT_PLAYING, "not playing"), \ PARA_ERROR(NO_VALID_FILES, "no valid file found in playlist"), \ PARA_ERROR(NO_WMA, "asf/wma format not recognized"), \ - PARA_ERROR(OEAP, "error during oeap (un)padding"), \ PARA_ERROR(OGGDEC_BADHEADER, "invalid vorbis bitstream header"), \ PARA_ERROR(OGGDEC_BADLINK, "invalid stream section or requested link corrupt"), \ PARA_ERROR(OGGDEC_FAULT, "bug or heap/stack corruption"), \ @@ -197,6 +196,7 @@ PARA_ERROR(REGEX, "regular expression error"), \ PARA_ERROR(RESAMPLE_EOF, "resample filter: end of file"), \ PARA_ERROR(RSA, "RSA error"), \ + PARA_ERROR(RSA_DECODE, "RSA decoding error"), \ PARA_ERROR(SB_PACKET_SIZE, "invalid sideband packet size or protocol error"), \ PARA_ERROR(SCM_CREDENTIALS, "did not receive SCM credentials"), \ PARA_ERROR(SENDER_CMD, "command not supported by this sender"), \ diff --git a/gcrypt.c b/gcrypt.c index f4dbeb8e..7d6b2cae 100644 --- a/gcrypt.c +++ b/gcrypt.c @@ -601,10 +601,8 @@ static int decode_rsa(gcry_sexp_t sexp, unsigned char *outbuf, size_t *nbytes) { const char *p = gcry_sexp_nth_data(sexp, 1, nbytes); - if (!p) { - PARA_ERROR_LOG("could not get data from list\n"); - return -E_OEAP; - } + if (!p) + return -E_RSA_DECODE; memcpy(outbuf, p, *nbytes); return 1; } -- 2.39.5