Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
17ae5ab
libq/hash adding function hash_from_string. The function create an ha…
mrmonopoly-cyber Aug 13, 2023
893d00c
libq/contents.c/.h generalize the function contents_parse_line so tha…
mrmonopoly-cyber Aug 13, 2023
7b27719
libq/Makefile.am libq/Makefile.in Makefile.in configuring libq/Makefi…
mrmonopoly-cyber Aug 13, 2023
51cd461
commit to fix, recommitting gentoo team commit by mystake
mrmonopoly-cyber Aug 13, 2023
5877a82
libq/cur_sys_pkg.c/.h adding files for patch. These function allow th…
mrmonopoly-cyber Aug 13, 2023
b17d767
qmerge.c implementation of the libq/cur_sys_pkg in qmerge. Add the fe…
mrmonopoly-cyber Aug 13, 2023
c184934
libq/contents.c reinserting symbolik parsing, removed by mystake
mrmonopoly-cyber Aug 13, 2023
38be82a
fixing bugs in libq/cur_sys_pkg.c find_in_tree function
mrmonopoly-cyber Aug 30, 2023
79af1df
Merge branch 'master' into default-file
mrmonopoly-cyber Jan 21, 2024
f73a710
removed two spaces at the end of libq/hash.c
mrmonopoly-cyber Jan 22, 2024
f72d28b
little bugfix and refactoring of the contract
mrmonopoly-cyber Jan 22, 2024
238c325
Added include to prevent compile error about the variabile _Q_PATH_MAX
mrmonopoly-cyber Jan 24, 2024
019318c
Changed implementation of cur_sys_pkg.c. Now it no longer manually
mrmonopoly-cyber Jan 24, 2024
e9c0bed
refactoring the code after the change of implementation, there is a
mrmonopoly-cyber Jan 24, 2024
32e8fc9
added personal info
mrmonopoly-cyber Jan 24, 2024
ff1c60d
removed assertion
mrmonopoly-cyber Jan 24, 2024
53816ac
fixing dangerous parsing of CONTENTS string of pkgs with strtok_r(), …
mrmonopoly-cyber Jan 26, 2024
50f68a9
fixing merges
mrmonopoly-cyber Jan 26, 2024
a1937d5
remove dynamic allocation in cur_sys_pkg.c during parsing of CONTENTS…
mrmonopoly-cyber Jan 26, 2024
69ecbe8
Restored the old implementation of contents.c, only added a new function
mrmonopoly-cyber Jan 28, 2024
1a2b989
removed useless file
mrmonopoly-cyber Jan 29, 2024
406c836
Merge branch 'gentoo:master' into default-file
mrmonopoly-cyber Jan 29, 2024
9e0b0c7
Merge branch 'master' into default-file
mrmonopoly-cyber Feb 14, 2024
180b4f7
adapted code to recent changes in signature declaration of hash_from_…
mrmonopoly-cyber Feb 17, 2024
fe60c06
fix bug in qmerge.c: using previnst in pkg_merge to to obtain the inf…
mrmonopoly-cyber Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions libq/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,34 @@ hash_file_at_cb(int pfd, const char *fname, int hash, hash_cb_t cb)

return _hash_file_buf;
}


Comment thread
mrmonopoly-cyber marked this conversation as resolved.
/*
*Generate and alloc in heap a hash with MD5.
Comment thread
mrmonopoly-cyber marked this conversation as resolved.
Outdated
*Param: str :string to hash the string must be \0 terminating
* len : len of the string str, if <=0 the function will compute the len itself
*/
char *
hash_from_string(char *str,size_t len)
{
unsigned int hash_size = 32;
unsigned char hex_buf[hash_size+1];
char *hash_final;
MD5_CTX ctx;

if(len <= 0){
len=strlen(str);
}

hash_final=xmalloc(hash_size+1*sizeof(*hash_final));
hash_final[hash_size]='\0';
hex_buf[hash_size]='\0';
MD5_Init(&ctx);
MD5_Update(&ctx,str,len);
MD5_Final(hex_buf,&ctx);
hash_hex(hash_final,hex_buf,(hash_size>>1));

return hash_final;
}


1 change: 1 addition & 0 deletions libq/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ int hash_multiple_file_at_cb(
char *hash_file_at_cb(int pfd, const char *filename, int hash_algo, hash_cb_t cb);
#define hash_file(f, h) hash_file_at_cb(AT_FDCWD, f, h, NULL)
#define hash_file_at(fd, f, h) hash_file_at_cb(fd, f, h, NULL)
char * hash_from_string(char *str,size_t len);
Comment thread
mrmonopoly-cyber marked this conversation as resolved.
Outdated

#endif