Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0250a16

Browse files
pgcrypto: report init errors as PXE_CIPHER_INIT
Report OpenSSL errors during initialization as PXE_CIPHER_INIT since that's just what they were, and not generic unknown errors. This also removes the last users of the generic error, and thus it can be removed. Discussion: http://postgr.es/m/C89D932C-501E-4473-9750-638CFCD9095E@yesql.se
1 parent 17ec5fa commit 0250a16

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

contrib/pgcrypto/openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ px_find_digest(const char *name, PX_MD **res)
209209
if (!ctx)
210210
{
211211
pfree(digest);
212-
return -1;
212+
return PXE_CIPHER_INIT;
213213
}
214214
if (EVP_DigestInit_ex(ctx, md, NULL) == 0)
215215
{
216216
EVP_MD_CTX_destroy(ctx);
217217
pfree(digest);
218-
return -1;
218+
return PXE_CIPHER_INIT;
219219
}
220220

221221
digest->algo = md;

contrib/pgcrypto/px.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ struct error_desc
4141

4242
static const struct error_desc px_err_list[] = {
4343
{PXE_OK, "Everything ok"},
44-
{PXE_ERR_GENERIC, "Some PX error (not specified)"},
4544
{PXE_NO_HASH, "No such hash algorithm"},
4645
{PXE_NO_CIPHER, "No such cipher algorithm"},
4746
{PXE_BAD_OPTION, "Unknown option"},

contrib/pgcrypto/px.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* PX error codes
4545
*/
4646
#define PXE_OK 0
47-
#define PXE_ERR_GENERIC -1
47+
/* -1 is unused */
4848
#define PXE_NO_HASH -2
4949
#define PXE_NO_CIPHER -3
5050
/* -4 is unused */

0 commit comments

Comments
 (0)