search for: sha1_init

Displaying 8 results from an estimated 8 matches for "sha1_init".

2000 Jul 02
2
``portability'' patch for OpenSSH S/Key support
...;sha1.h> +#include <openssl/sha.h> /* from %OpenBSD: skeylogin.c,v 1.32 1999/08/16 14:46:56 millert Exp % */ @@ -74,7 +74,6 @@ size_t secretlen = 0; SHA_CTX ctx; char *p, *u; - char md[SHA_DIGEST_LENGTH]; /* * Base first 4 chars of seed on hostname. @@ -99,7 +98,7 @@ SHA1_Init(&ctx); SHA1_Update(&ctx, username, strlen(username)); - SHA1_End(&ctx, up); + SHA1_Final(up, &ctx); /* Collapse the hash */ ptr = hash_collapse(up); @@ -133,7 +132,7 @@ SHA1_Init(&ctx); SHA1_Update(&ctx, secret, secretlen); SHA1_Update(&ctx, usernam...
2013 Aug 21
1
Bug in dovecot 2.2.5: segfault due to bad alignment
...), &hash_method_sha1); In hmac.c, lines 43 and following, ctx->ctx with an alignment of 4 is passed to meth->init and meth->loop where meth refers to hash_method_sha1: meth->init(ctx->ctx); meth->loop(ctx->ctx, k_ipad, 64); These functions refer now to sha1_init and sha1_loop where the first parameter is expected to be a pointer to struct sha1_ctxt, a data structure which is declared in sha1.h: struct sha1_ctxt { union { uint8_t b8[20]; uint32_t b32[5]; } h; union {...
2012 Sep 17
9
[PATCH] Upgrade vtpmd to berlios version 0.7.4
...* - * This module is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published -@@ -381,7 +382,7 @@ static int encode_message(int type, uint - msg[0] = 0x00; - get_random_bytes(&msg[1], SHA1_DIGEST_LENGTH); - sha1_init(&ctx); -- sha1_update(&ctx, "TCPA", 4); -+ sha1_update(&ctx, (uint8_t *) "TCPA", 4); - sha1_final(&ctx, &msg[1 + SHA1_DIGEST_LENGTH]); - memset(&msg[1 + 2 * SHA1_DIGEST_LENGTH], 0x00, - msg_len - data_len - 2 * SHA1_DIGEST_LE...
2012 Sep 04
2
[PATCH] Generalize HMAC implementation
...ot;str.h" @@ -44,23 +45,23 @@ const unsigned char *salt, size_t salt_size, unsigned int i, unsigned char result[SHA1_RESULTLEN]) { - struct hmac_sha1_context ctx; + struct hmac_context ctx; unsigned char U[SHA1_RESULTLEN]; unsigned int j, k; /* Calculate U1 */ - hmac_sha1_init(&ctx, str, str_size); - hmac_sha1_update(&ctx, salt, salt_size); - hmac_sha1_update(&ctx, "\0\0\0\1", 4); - hmac_sha1_final(&ctx, U); + hmac_init(&ctx, str, str_size, &hash_method_sha1); + hmac_update(&ctx, salt, salt_size); + hmac_update(&ctx, "\0\0\0...
2006 Jun 26
1
[PATCH, RFC 0/13] OTP: add auth_cache_remove()
This patchset add support for One-Time-Password authentication mechanisms, both S/Key (RFC 1731) and OTP (RFC 2444) are implemented. Tested with mutt (uses cyrus sasl library for authentication). Patches were made against CVS HEAD. Please take a look. Add auth_cache_remove() function which will be used by OTP code to evict old entries from auth cache. diff -urdpNX /usr/share/dontdiff -x
2008 Apr 21
3
FIPS 140-2 OpenSSL(2007) patches
...s); xfree(cipher_list); @@ -291,9 +300,25 @@ cipher_set_key_string(CipherContext *cc, Cipher *cipher, const char *passphrase, int do_encrypt) { +#ifdef OPENSSL_FIPS + SHA_CTX sha; +#endif MD5_CTX md; - u_char digest[16]; + u_char digest[20]; +#ifdef OPENSSL_FIPS + if (fips_mode) { + SHA1_Init(&sha); + SHA1_Update(&sha, (const u_char *)passphrase, strlen(passphrase)); + SHA1_Final(digest, &sha); + + cipher_init(cc, cipher, digest, 20, NULL, 0, do_encrypt); + + memset(digest, 0, sizeof(digest)); + memset(&sha, 0, sizeof(sha)); + return; + } +#endif MD5_Init(&m...
2005 Aug 09
2
error compiling asterisk on solaris
...nce to `sk_num' /usr/local/ssl/lib/libssl.so: undefined reference to `BIO_free_all' /usr/local/ssl/lib/libssl.so: undefined reference to `BIO_get_retry_reason' /usr/local/ssl/lib/libssl.so: undefined reference to `X509_STORE_new' /usr/local/ssl/lib/libssl.so: undefined reference to `SHA1_Init' /usr/local/ssl/lib/libssl.so: undefined reference to `HMAC_Final' /usr/local/ssl/lib/libssl.so: undefined reference to `EVP_md5' /usr/local/ssl/lib/libssl.so: undefined reference to `ASN1_object_size' /usr/local/ssl/lib/libssl.so: undefined reference to `EVP_get_cipherbyname' /...
2020 Feb 09
2
[RFC PATCH] Add SHA1 support
...a1, out); + return 1; +} + +#endif diff --git a/lib/sha1.c b/lib/sha1.c new file mode 100644 index 0000000000000..e1cc3fccf2552 --- /dev/null +++ b/lib/sha1.c @@ -0,0 +1,19 @@ +#include "rsync.h" +#include "sha_local.h" + +#ifndef HAVE_OPENSSL +void sha1_begin(SHA_CTX *ctx) +{ + SHA1_Init(ctx); +} + +void sha1_update(SHA_CTX *ctx, const void *input, unsigned int length) +{ + HASH_UPDATE(ctx, input, length); +} + +void sha1_result(SHA_CTX *ctx, void *digest) +{ + HASH_FINAL(digest, ctx); +} +#endif diff --git a/lib/sha1.h b/lib/sha1.h new file mode 100644 index 0000000000000..ea979e4...