~ubuntu-branches/ubuntu/trusty/postgresql-9.3/trusty-proposed

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/pgp-decrypt.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2014-07-24 16:13:59 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20140724161359-uk325qfv03euxuuh
Tags: 9.3.5-0ubuntu0.14.04.1
* New upstream bug fix release: (LP: #1348176)
  - pg_upgrade: Users who upgraded to version 9.3 using pg_upgrade may have
    an issue with transaction information which causes VACUUM to eventually
    fail. These users should run the script provided in the release notes to
    determine if their installation is affected, and then take the remedy
    steps outlined there.
  - Various data integrity and other bug fixes.
  - Secure Unix-domain sockets of temporary postmasters started during make
    check.
    Any local user able to access the socket file could connect as the
    server's bootstrap superuser, then proceed to execute arbitrary code as
    the operating-system user running the test, as we previously noted in
    CVE-2014-0067. This change defends against that risk by placing the
    server's socket in a temporary, mode 0700 subdirectory of /tmp.
  - See release notes for details:
    http://www.postgresql.org/about/news/1534/
* Remove pg_regress patches to support --host=/path, obsolete with above
  upstream changes and not applicable any more.
* Drop tcl8.6 patch, applied upstream.
* Add missing logrotate test dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18
18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
 
 * ARE DISCLAIMED.      IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 
20
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21
21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
210
210
{
211
211
        struct PktData *pkt = priv;
212
212
 
213
 
        memset(pkt, 0, sizeof(*pkt));
 
213
        px_memset(pkt, 0, sizeof(*pkt));
214
214
        px_free(pkt);
215
215
}
216
216
 
257
257
        if (res != len + 2)
258
258
        {
259
259
                px_debug("prefix_init: short read");
260
 
                memset(tmpbuf, 0, sizeof(tmpbuf));
 
260
                px_memset(tmpbuf, 0, sizeof(tmpbuf));
261
261
                return PXE_PGP_CORRUPT_DATA;
262
262
        }
263
263
 
280
280
                 */
281
281
                ctx->corrupt_prefix = 1;
282
282
        }
283
 
        memset(tmpbuf, 0, sizeof(tmpbuf));
 
283
        px_memset(tmpbuf, 0, sizeof(tmpbuf));
284
284
        return 0;
285
285
}
286
286
 
395
395
         */
396
396
        px_md_finish(ctx->mdc_ctx, hash);
397
397
        res = memcmp(hash, *data_p, 20);
398
 
        memset(hash, 0, 20);
399
 
        memset(tmpbuf, 0, sizeof(tmpbuf));
 
398
        px_memset(hash, 0, 20);
 
399
        px_memset(tmpbuf, 0, sizeof(tmpbuf));
400
400
        if (res != 0)
401
401
        {
402
402
                px_debug("mdc_finish: mdc failed");
493
493
        px_md_update(st->ctx->mdc_ctx, st->mdc_buf, 2);
494
494
        px_md_finish(st->ctx->mdc_ctx, hash);
495
495
        res = memcmp(hash, st->mdc_buf + 2, 20);
496
 
        memset(hash, 0, 20);
 
496
        px_memset(hash, 0, 20);
497
497
        if (res)
498
498
        {
499
499
                px_debug("mdcbuf_finish: MDC does not match");
593
593
 
594
594
        px_md_free(st->ctx->mdc_ctx);
595
595
        st->ctx->mdc_ctx = NULL;
596
 
        memset(st, 0, sizeof(*st));
 
596
        px_memset(st, 0, sizeof(*st));
597
597
        px_free(st);
598
598
}
599
599
 
703
703
                res = decrypt_key(ctx, p, res);
704
704
        }
705
705
 
706
 
        memset(tmpbuf, 0, sizeof(tmpbuf));
 
706
        px_memset(tmpbuf, 0, sizeof(tmpbuf));
707
707
        return res;
708
708
}
709
709
 
753
753
                if (res < 0)
754
754
                        return res;
755
755
        }
 
756
        px_memset(tmpbuf, 0, sizeof(tmpbuf));
756
757
        return 0;
757
758
}
758
759
 
792
793
                px_debug("parse_literal_data: unexpected eof");
793
794
                return PXE_PGP_CORRUPT_DATA;
794
795
        }
795
 
        memset(tmpbuf, 0, 4);
 
796
        px_memset(tmpbuf, 0, 4);
796
797
 
797
798
        /* check if text */
798
799
        if (ctx->text_mode)