Skip to content

Commit

Permalink
Avoid duplicate code
Browse files Browse the repository at this point in the history
Remove duplicate code in files in the `crapi` directory. Unify
functions behind a single iface.
  • Loading branch information
jan-cerny committed Feb 5, 2024
1 parent 1d53104 commit 85681d7
Show file tree
Hide file tree
Showing 10 changed files with 281 additions and 1,298 deletions.
410 changes: 281 additions & 129 deletions src/OVAL/probes/crapi/digest.c

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions src/OVAL/probes/crapi/digest.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,8 @@ typedef enum {
CRAPI_DIGEST_SHA384 = 0x40
} crapi_alg_t;

#include "md5.h"
#include "sha1.h"
#include "sha2.h"
#include "rmd160.h"

int crapi_digest_fd (int fd, crapi_alg_t alg, void *dst, size_t *size);

struct digest_ctbl_t {
void *ctx;
void *(*init) (void *, void *);
int (*update)(void *, void *, size_t);
int (*fini) (void *);
void (*free) (void *);
};

int crapi_mdigest_fd (int fd, int num, ... /*crapi_alg_t alg, void *dst, size_t *size, ...*/);

#endif /* CRAPI_DIGEST_H */
236 changes: 0 additions & 236 deletions src/OVAL/probes/crapi/md5.c

This file was deleted.

39 changes: 0 additions & 39 deletions src/OVAL/probes/crapi/md5.h

This file was deleted.

Loading

0 comments on commit 85681d7

Please sign in to comment.