This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| struct | SHA1_CONTEXT |
Defines | |
| #define | SHA1_HASH_SIZE 20 |
Enumerations | |
| enum | sha_result_codes { SHA_SUCCESS = 0, SHA_NULL, SHA_INPUT_TOO_LONG, SHA_STATE_ERROR } |
Functions | |
| C_MODE_START int | mysql_sha1_reset (SHA1_CONTEXT *) |
| int | mysql_sha1_input (SHA1_CONTEXT *, const uint8 *, unsigned int) |
| int | mysql_sha1_result (SHA1_CONTEXT *, uint8 Message_Digest[SHA1_HASH_SIZE]) |
| #define SHA1_HASH_SIZE 20 |
Definition at line 40 of file sha1.h.
Referenced by check_scramble(), Item_func_sha::fix_length_and_dec(), get_salt_from_password(), make_password_from_salt(), make_scrambled_password(), scramble(), and Item_func_sha::val_str().
| enum sha_result_codes |
Definition at line 32 of file sha1.h.
00033 { 00034 SHA_SUCCESS = 0, 00035 SHA_NULL, /* Null pointer parameter */ 00036 SHA_INPUT_TOO_LONG, /* input data too long */ 00037 SHA_STATE_ERROR /* called Input after Result */ 00038 };
| int mysql_sha1_input | ( | SHA1_CONTEXT * | , | |
| const uint8 * | , | |||
| unsigned | int | |||
| ) |
Definition at line 179 of file sha1.c.
References SHA1_CONTEXT::Computed, SHA1_CONTEXT::Corrupted, SHA1_CONTEXT::Length, SHA1_CONTEXT::Message_Block, SHA1_CONTEXT::Message_Block_Index, SHA1ProcessMessageBlock(), SHA_NULL, SHA_STATE_ERROR, and SHA_SUCCESS.
Referenced by check_scramble(), make_scrambled_password(), scramble(), and Item_func_sha::val_str().
00181 { 00182 if (!length) 00183 return SHA_SUCCESS; 00184 00185 #ifndef DBUG_OFF 00186 /* We assume client konows what it is doing in non-debug mode */ 00187 if (!context || !message_array) 00188 return SHA_NULL; 00189 if (context->Computed) 00190 return (context->Corrupted= SHA_STATE_ERROR); 00191 if (context->Corrupted) 00192 return context->Corrupted; 00193 #endif 00194 00195 while (length--) 00196 { 00197 context->Message_Block[context->Message_Block_Index++]= 00198 (*message_array & 0xFF); 00199 context->Length += 8; /* Length is in bits */ 00200 00201 #ifndef DBUG_OFF 00202 /* 00203 Then we're not debugging we assume we never will get message longer 00204 2^64 bits. 00205 */ 00206 if (context->Length == 0) 00207 return (context->Corrupted= 1); /* Message is too long */ 00208 #endif 00209 00210 if (context->Message_Block_Index == 64) 00211 { 00212 SHA1ProcessMessageBlock(context); 00213 } 00214 message_array++; 00215 } 00216 return SHA_SUCCESS; 00217 }
Here is the call graph for this function:

Here is the caller graph for this function:

| C_MODE_START int mysql_sha1_reset | ( | SHA1_CONTEXT * | ) |
Definition at line 95 of file sha1.c.
References SHA1_CONTEXT::Computed, SHA1_CONTEXT::Corrupted, SHA1_CONTEXT::Intermediate_Hash, SHA1_CONTEXT::Length, SHA1_CONTEXT::Message_Block_Index, sha_const_key, SHA_NULL, and SHA_SUCCESS.
Referenced by check_scramble(), make_scrambled_password(), scramble(), and Item_func_sha::val_str().
00096 { 00097 #ifndef DBUG_OFF 00098 if (!context) 00099 return SHA_NULL; 00100 #endif 00101 00102 context->Length = 0; 00103 context->Message_Block_Index = 0; 00104 00105 context->Intermediate_Hash[0] = sha_const_key[0]; 00106 context->Intermediate_Hash[1] = sha_const_key[1]; 00107 context->Intermediate_Hash[2] = sha_const_key[2]; 00108 context->Intermediate_Hash[3] = sha_const_key[3]; 00109 context->Intermediate_Hash[4] = sha_const_key[4]; 00110 00111 context->Computed = 0; 00112 context->Corrupted = 0; 00113 00114 return SHA_SUCCESS; 00115 }
Here is the caller graph for this function:

| int mysql_sha1_result | ( | SHA1_CONTEXT * | , | |
| uint8 | Message_Digest[SHA1_HASH_SIZE] | |||
| ) |
Definition at line 135 of file sha1.c.
References bzero, SHA1_CONTEXT::Computed, SHA1_CONTEXT::Corrupted, SHA1_CONTEXT::Intermediate_Hash, SHA1_CONTEXT::Length, SHA1_CONTEXT::Message_Block, SHA1PadMessage(), SHA_NULL, and SHA_SUCCESS.
Referenced by check_scramble(), make_scrambled_password(), scramble(), and Item_func_sha::val_str().
00137 { 00138 int i; 00139 00140 #ifndef DBUG_OFF 00141 if (!context || !Message_Digest) 00142 return SHA_NULL; 00143 00144 if (context->Corrupted) 00145 return context->Corrupted; 00146 #endif 00147 00148 if (!context->Computed) 00149 { 00150 SHA1PadMessage(context); 00151 /* message may be sensitive, clear it out */ 00152 bzero((char*) context->Message_Block,64); 00153 context->Length = 0; /* and clear length */ 00154 context->Computed = 1; 00155 } 00156 00157 for (i = 0; i < SHA1_HASH_SIZE; i++) 00158 Message_Digest[i] = (int8)((context->Intermediate_Hash[i>>2] >> 8 00159 * ( 3 - ( i & 0x03 ) ))); 00160 return SHA_SUCCESS; 00161 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

