mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 03:50:57 +01:00
fail if trying to encrypt using an empty input buffer
This commit is contained in:
@@ -437,6 +437,14 @@ size_t pcp_encrypt_stream_sym(PCPCTX *ptx, Pcpstream *in, Pcpstream *out, byte *
|
|||||||
byte *hash = NULL;
|
byte *hash = NULL;
|
||||||
byte head[1];
|
byte head[1];
|
||||||
|
|
||||||
|
if(in->is_buffer) {
|
||||||
|
if(buffer_size(in->b) == 0) {
|
||||||
|
/* FIXME: add a ps_stream function for this */
|
||||||
|
fatal(ptx, "Empty input stream buffer at %p!\n", in->b);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(recsign != NULL) {
|
if(recsign != NULL) {
|
||||||
st = ucmalloc(sizeof(crypto_generichash_state));
|
st = ucmalloc(sizeof(crypto_generichash_state));
|
||||||
hash = ucmalloc(crypto_generichash_BYTES_MAX);
|
hash = ucmalloc(crypto_generichash_BYTES_MAX);
|
||||||
|
|||||||
Reference in New Issue
Block a user