diff --git a/crypto/external/bsd/openpgpsdk/dist/src/lib/util.c b/crypto/external/bsd/openpgpsdk/dist/src/lib/util.c index e080f194ff85..8a2911172159 100644 --- a/crypto/external/bsd/openpgpsdk/dist/src/lib/util.c +++ b/crypto/external/bsd/openpgpsdk/dist/src/lib/util.c @@ -114,44 +114,6 @@ typedef struct size_t offset; } reader_mem_arg_t; -static int mem_reader(void *dest,size_t length,ops_error_t **errors, - ops_reader_info_t *rinfo,ops_parse_cb_info_t *cbinfo) - { - reader_mem_arg_t *arg=ops_reader_get_arg(rinfo); - unsigned n; - - OPS_USED(cbinfo); - OPS_USED(errors); - - if(arg->offset+length > arg->length) - n=arg->length-arg->offset; - else - n=length; - - if(n == 0) - return 0; - - memcpy(dest,arg->buffer+arg->offset,n); - arg->offset+=n; - - return n; - } - -static void mem_destroyer(ops_reader_info_t *rinfo) - { free(ops_reader_get_arg(rinfo)); } - -// Note that its the caller's responsibility to ensure buffer continues to -// exist -void ops_reader_set_memory(ops_parse_info_t *pinfo,const void *buffer, - size_t length) - { - reader_mem_arg_t *arg=malloc(sizeof *arg); - - arg->buffer=buffer; - arg->length=length; - arg->offset=0; - ops_reader_set(pinfo,mem_reader,mem_destroyer,arg); - } /** \ingroup HighLevel_Misc