Skip to content

Commit

Permalink
Merge pull request #293 from Wolf3s/Cleanups
Browse files Browse the repository at this point in the history
Fix codeql warnings
  • Loading branch information
sahlberg authored Nov 26, 2023
2 parents 22ab4c6 + 644ee5a commit 64c7e0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
20 changes: 10 additions & 10 deletions include/smb2/smb2.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ struct smb2_error_reply {

enum smb2_command {
SMB2_NEGOTIATE = 0,
SMB2_SESSION_SETUP,
SMB2_LOGOFF,
SMB2_TREE_CONNECT,
SMB2_TREE_DISCONNECT,
SMB2_CREATE,
SMB2_CLOSE,
SMB2_FLUSH,
SMB2_READ,
SMB2_WRITE,
SMB2_SESSION_SETUP = 1,
SMB2_LOGOFF = 2,
SMB2_TREE_CONNECT = 3,
SMB2_TREE_DISCONNECT = 4,
SMB2_CREATE = 5,
SMB2_CLOSE = 6,
SMB2_FLUSH = 7,
SMB2_READ = 8,
SMB2_WRITE = 9,
/* SMB2_LOCK, */
SMB2_IOCTL = 11,
/* SMB2_CANCEL, */
SMB2_ECHO = 13,
SMB2_QUERY_DIRECTORY,
SMB2_QUERY_DIRECTORY = 14,
/* SMB2_CHANGE_NOTIFY, */
SMB2_QUERY_INFO = 16,
SMB2_SET_INFO = 17,
Expand Down
10 changes: 0 additions & 10 deletions lib/sha384-512.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@
/*
* Add the 4word value in word2 to word1.
*/
//static uint32_t ADDTO4_temp, ADDTO4_temp2;
#define SHA512_ADDTO4(word1, word2) ( \
ADDTO4_temp = (word1)[3], \
(word1)[3] += (word2)[3], \
Expand All @@ -127,7 +126,6 @@
/*
* Add the 2word value in word2 to word1.
*/
//static uint32_t ADDTO2_temp;
#define SHA512_ADDTO2(word1, word2) ( \
ADDTO2_temp = (word1)[1], \
(word1)[1] += (word2)[1], \
Expand All @@ -136,7 +134,6 @@
/*
* SHA rotate ((word >> bits) | (word << (64-bits)))
*/
//static uint32_t ROTR_temp1[2], ROTR_temp2[2];
#define SHA512_ROTR(bits, word, ret) ( \
SHA512_SHR((bits), (word), ROTR_temp1), \
SHA512_SHL(64-(bits), (word), ROTR_temp2), \
Expand All @@ -146,7 +143,6 @@
* Define the SHA SIGMA and sigma macros
* SHA512_ROTR(28,word) ^ SHA512_ROTR(34,word) ^ SHA512_ROTR(39,word)
*/
//static uint32_t SIGMA0_temp1[2], SIGMA0_temp2[2], SIGMA0_temp3[2], SIGMA0_temp4[2];
#define SHA512_SIGMA0(word, ret) ( \
SHA512_ROTR(28, (word), SIGMA0_temp1), \
SHA512_ROTR(34, (word), SIGMA0_temp2), \
Expand All @@ -157,7 +153,6 @@
/*
* SHA512_ROTR(14,word) ^ SHA512_ROTR(18,word) ^ SHA512_ROTR(41,word)
*/
//static uint32_t SIGMA1_temp1[2], SIGMA1_temp2[2], SIGMA1_temp3[2], SIGMA1_temp4[2];
#define SHA512_SIGMA1(word, ret) ( \
SHA512_ROTR(14, (word), SIGMA1_temp1), \
SHA512_ROTR(18, (word), SIGMA1_temp2), \
Expand All @@ -168,7 +163,6 @@
/*
* (SHA512_ROTR( 1,word) ^ SHA512_ROTR( 8,word) ^ SHA512_SHR( 7,word))
*/
//static uint32_t sigma0_temp1[2], sigma0_temp2[2], sigma0_temp3[2], sigma0_temp4[2];
#define SHA512_sigma0(word, ret) ( \
SHA512_ROTR( 1, (word), sigma0_temp1), \
SHA512_ROTR( 8, (word), sigma0_temp2), \
Expand All @@ -179,7 +173,6 @@
/*
* (SHA512_ROTR(19,word) ^ SHA512_ROTR(61,word) ^ SHA512_SHR( 6,word))
*/
//static uint32_t sigma1_temp1[2], sigma1_temp2[2], sigma1_temp3[2], sigma1_temp4[2];
#define SHA512_sigma1(word, ret) ( \
SHA512_ROTR(19, (word), sigma1_temp1), \
SHA512_ROTR(61, (word), sigma1_temp2), \
Expand All @@ -195,7 +188,6 @@
* These definitions are the ones used in FIPS-180-2, section 4.1.3
* Ch(x,y,z) ((x & y) ^ (~x & z))
*/
//static uint32_t Ch_temp1[2], Ch_temp2[2], Ch_temp3[2];
#define SHA_Ch(x, y, z, ret) ( \
SHA512_AND(x, y, Ch_temp1), \
SHA512_TILDA(x, Ch_temp2), \
Expand All @@ -204,7 +196,6 @@
/*
* Maj(x,y,z) (((x)&(y)) ^ ((x)&(z)) ^ ((y)&(z)))
*/
//static uint32_t Maj_temp1[2], Maj_temp2[2], Maj_temp3[2], Maj_temp4[2];
#define SHA_Maj(x, y, z, ret) ( \
SHA512_AND(x, y, Maj_temp1), \
SHA512_AND(x, z, Maj_temp2), \
Expand Down Expand Up @@ -235,7 +226,6 @@
/*
* add "length" to the length
*/
//static uint32_t addTemp[4] = { 0, 0, 0, 0 };

#define SHA384_512AddLength(context, length) ( \
addTemp[3] = (length), SHA512_ADDTO4((context)->Length, addTemp), \
Expand Down

0 comments on commit 64c7e0a

Please sign in to comment.