Compare commits

..

No commits in common. "f5ce4f52385ed1f7d80fd4115f56e0db03730591" and "494be7b4dc356f04bdec368f487b5cd641c5f6b3" have entirely different histories.

2 changed files with 1 additions and 46 deletions

View file

@ -28,27 +28,6 @@
#include <limits.h> #include <limits.h>
/* TODO: Verify LibreSSL support later */
#if TLS_IMPL == TLS_OPENSSL
#include <openssl/sha.h>
unsigned char *
Sha1(char *str)
{
unsigned char *digest;
if (!str)
{
return NULL;
}
digest = Malloc(20 + 1);
SHA1((unsigned char *) str, strlen(str), digest);
digest[20] = '\0';
return digest;
}
#else
#define LOAD32H(x, y) \ #define LOAD32H(x, y) \
{ \ { \
x = ((uint32_t)((y)[0] & 255) << 24) | \ x = ((uint32_t)((y)[0] & 255) << 24) | \
@ -285,4 +264,3 @@ Sha1(char *str)
return out; return out;
} }
#endif

View file

@ -21,36 +21,14 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#include <Memory.h>
#include <Sha.h> #include <Sha.h>
#include <Memory.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
/* TODO: Verify LibreSSL support later */
#if TLS_IMPL == TLS_OPENSSL
#include <openssl/sha.h>
unsigned char *
Sha256(char *str)
{
unsigned char *digest;
if (!str)
{
return NULL;
}
digest = Malloc(32 + 1);
SHA256((unsigned char *) str, strlen(str), digest);
digest[32] = '\0';
return digest;
}
#else
#define GET_UINT32(x) \ #define GET_UINT32(x) \
(((uint32_t)(x)[0] << 24) | \ (((uint32_t)(x)[0] << 24) | \
((uint32_t)(x)[1] << 16) | \ ((uint32_t)(x)[1] << 16) | \
@ -252,4 +230,3 @@ Sha256(char *str)
return out; return out;
} }
#endif