Loading apps/passwd.c +53 −32 Original line number Original line Diff line number Diff line Loading @@ -287,7 +287,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) char *salt_out; char *salt_out; int n; int n; unsigned int i; unsigned int i; EVP_MD_CTX *md, *md2; EVP_MD_CTX *md = NULL, *md2 = NULL; size_t passwd_len, salt_len; size_t passwd_len, salt_len; passwd_len = strlen(passwd); passwd_len = strlen(passwd); Loading @@ -303,49 +303,65 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) assert(salt_len <= 8); assert(salt_len <= 8); md = EVP_MD_CTX_new(); md = EVP_MD_CTX_new(); if (md == NULL) if (md == NULL return NULL; || !EVP_DigestInit_ex(md, EVP_md5(), NULL) EVP_DigestInit_ex(md, EVP_md5(), NULL); || !EVP_DigestUpdate(md, passwd, passwd_len) EVP_DigestUpdate(md, passwd, passwd_len); || !EVP_DigestUpdate(md, "$", 1) EVP_DigestUpdate(md, "$", 1); || !EVP_DigestUpdate(md, magic, strlen(magic)) EVP_DigestUpdate(md, magic, strlen(magic)); || !EVP_DigestUpdate(md, "$", 1) EVP_DigestUpdate(md, "$", 1); || !EVP_DigestUpdate(md, salt_out, salt_len)) EVP_DigestUpdate(md, salt_out, salt_len); md2 = EVP_MD_CTX_new(); md2 = EVP_MD_CTX_new(); if (md2 == NULL) if (md2 == NULL return NULL; || !EVP_DigestInit_ex(md2, EVP_md5(), NULL) EVP_DigestInit_ex(md2, EVP_md5(), NULL); || !EVP_DigestUpdate(md2, passwd, passwd_len) EVP_DigestUpdate(md2, passwd, passwd_len); || !EVP_DigestUpdate(md2, salt_out, salt_len) EVP_DigestUpdate(md2, salt_out, salt_len); || !EVP_DigestUpdate(md2, passwd, passwd_len) EVP_DigestUpdate(md2, passwd, passwd_len); || !EVP_DigestFinal_ex(md2, buf, NULL)) EVP_DigestFinal_ex(md2, buf, NULL); goto err; for (i = passwd_len; i > sizeof buf; i -= sizeof buf) for (i = passwd_len; i > sizeof buf; i -= sizeof buf) { EVP_DigestUpdate(md, buf, sizeof buf); if (!EVP_DigestUpdate(md, buf, sizeof buf)) EVP_DigestUpdate(md, buf, i); goto err; } if (!EVP_DigestUpdate(md, buf, i)) goto err; n = passwd_len; n = passwd_len; while (n) { while (n) { EVP_DigestUpdate(md, (n & 1) ? "\0" : passwd, 1); if (!EVP_DigestUpdate(md, (n & 1) ? "\0" : passwd, 1)) goto err; n >>= 1; n >>= 1; } } EVP_DigestFinal_ex(md, buf, NULL); if (!EVP_DigestFinal_ex(md, buf, NULL)) return NULL; for (i = 0; i < 1000; i++) { for (i = 0; i < 1000; i++) { EVP_DigestInit_ex(md2, EVP_md5(), NULL); if (!EVP_DigestInit_ex(md2, EVP_md5(), NULL)) EVP_DigestUpdate(md2, (i & 1) ? (unsigned const char *)passwd : buf, goto err; (i & 1) ? passwd_len : sizeof buf); if (!EVP_DigestUpdate(md2, if (i % 3) (i & 1) ? (unsigned const char *)passwd : buf, EVP_DigestUpdate(md2, salt_out, salt_len); (i & 1) ? passwd_len : sizeof buf)) if (i % 7) goto err; EVP_DigestUpdate(md2, passwd, passwd_len); if (i % 3) { EVP_DigestUpdate(md2, (i & 1) ? buf : (unsigned const char *)passwd, if (!EVP_DigestUpdate(md2, salt_out, salt_len)) (i & 1) ? sizeof buf : passwd_len); goto err; EVP_DigestFinal_ex(md2, buf, NULL); } if (i % 7) { if (!EVP_DigestUpdate(md2, passwd, passwd_len)) goto err; } if (!EVP_DigestUpdate(md2, (i & 1) ? buf : (unsigned const char *)passwd, (i & 1) ? sizeof buf : passwd_len)) goto err; if (!EVP_DigestFinal_ex(md2, buf, NULL)) goto err; } } EVP_MD_CTX_free(md2); EVP_MD_CTX_free(md2); EVP_MD_CTX_free(md); EVP_MD_CTX_free(md); md2 = NULL; md = NULL; { { /* transform buf into output string */ /* transform buf into output string */ Loading Loading @@ -386,6 +402,11 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) } } return out_buf; return out_buf; err: EVP_MD_CTX_free(md2); EVP_MD_CTX_free(md); return NULL; } } # endif # endif Loading apps/speed.c +28 −15 Original line number Original line Diff line number Diff line Loading @@ -601,9 +601,11 @@ static int EVP_Digest_MD2_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char md2[MD2_DIGEST_LENGTH]; unsigned char md2[MD2_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_MD2][testnum]); count++) for (count = 0; COND(c[D_MD2][testnum]); count++) { EVP_Digest(buf, (unsigned long)lengths[testnum], &(md2[0]), NULL, if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(md2[0]), NULL, EVP_md2(), NULL); EVP_md2(), NULL)) return -1; } return count; return count; } } #endif #endif Loading @@ -615,9 +617,11 @@ static int EVP_Digest_MDC2_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char mdc2[MDC2_DIGEST_LENGTH]; unsigned char mdc2[MDC2_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_MDC2][testnum]); count++) for (count = 0; COND(c[D_MDC2][testnum]); count++) { EVP_Digest(buf, (unsigned long)lengths[testnum], &(mdc2[0]), NULL, if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(mdc2[0]), NULL, EVP_mdc2(), NULL); EVP_mdc2(), NULL)) return -1; } return count; return count; } } #endif #endif Loading @@ -629,9 +633,11 @@ static int EVP_Digest_MD4_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char md4[MD4_DIGEST_LENGTH]; unsigned char md4[MD4_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_MD4][testnum]); count++) for (count = 0; COND(c[D_MD4][testnum]); count++) { EVP_Digest(&(buf[0]), (unsigned long)lengths[testnum], &(md4[0]), if (!EVP_Digest(&(buf[0]), (unsigned long)lengths[testnum], &(md4[0]), NULL, EVP_md4(), NULL); NULL, EVP_md4(), NULL)) return -1; } return count; return count; } } #endif #endif Loading Loading @@ -717,9 +723,11 @@ static int EVP_Digest_RMD160_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_RMD160][testnum]); count++) for (count = 0; COND(c[D_RMD160][testnum]); count++) { EVP_Digest(buf, (unsigned long)lengths[testnum], &(rmd160[0]), NULL, if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(rmd160[0]), EVP_ripemd160(), NULL); NULL, EVP_ripemd160(), NULL)) return -1; } return count; return count; } } #endif #endif Loading Loading @@ -888,9 +896,10 @@ static int EVP_Digest_loop(void *args) unsigned char md[EVP_MAX_MD_SIZE]; unsigned char md[EVP_MAX_MD_SIZE]; int count; int count; for (count = 0; for (count = 0; COND(save_count * 4 * lengths[0] / lengths[testnum]); count++) COND(save_count * 4 * lengths[0] / lengths[testnum]); count++) { EVP_Digest(buf, lengths[testnum], &(md[0]), NULL, evp_md, NULL); if (!EVP_Digest(buf, lengths[testnum], &(md[0]), NULL, evp_md, NULL)) return -1; } return count; return count; } } Loading Loading @@ -2845,6 +2854,10 @@ static void pkey_print_message(const char *str, const char *str2, long num, static void print_result(int alg, int run_no, int count, double time_used) static void print_result(int alg, int run_no, int count, double time_used) { { if (count == -1) { BIO_puts(bio_err, "EVP error!\n"); exit(1); } BIO_printf(bio_err, BIO_printf(bio_err, mr ? "+R:%d:%s:%f\n" mr ? "+R:%d:%s:%f\n" : "%d %s's in %.2fs\n", count, names[alg], time_used); : "%d %s's in %.2fs\n", count, names[alg], time_used); Loading apps/ts.c +14 −9 Original line number Original line Diff line number Diff line Loading @@ -492,28 +492,30 @@ static int create_digest(BIO *input, char *digest, const EVP_MD *md, unsigned char **md_value) unsigned char **md_value) { { int md_value_len; int md_value_len; int rv = 0; EVP_MD_CTX *md_ctx = NULL; md_value_len = EVP_MD_size(md); md_value_len = EVP_MD_size(md); if (md_value_len < 0) if (md_value_len < 0) return 0; return 0; if (input) { if (input) { EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); unsigned char buffer[4096]; unsigned char buffer[4096]; int length; int length; md_ctx = EVP_MD_CTX_new(); if (md_ctx == NULL) if (md_ctx == NULL) return 0; return 0; *md_value = app_malloc(md_value_len, "digest buffer"); *md_value = app_malloc(md_value_len, "digest buffer"); EVP_DigestInit(md_ctx, md); if (!EVP_DigestInit(md_ctx, md)) goto err; while ((length = BIO_read(input, buffer, sizeof(buffer))) > 0) { while ((length = BIO_read(input, buffer, sizeof(buffer))) > 0) { EVP_DigestUpdate(md_ctx, buffer, length); if (!EVP_DigestUpdate(md_ctx, buffer, length)) } goto err; if (!EVP_DigestFinal(md_ctx, *md_value, NULL)) { EVP_MD_CTX_free(md_ctx); return 0; } } EVP_MD_CTX_free(md_ctx); if (!EVP_DigestFinal(md_ctx, *md_value, NULL)) goto err; md_value_len = EVP_MD_size(md); } else { } else { long digest_len; long digest_len; *md_value = OPENSSL_hexstr2buf(digest, &digest_len); *md_value = OPENSSL_hexstr2buf(digest, &digest_len); Loading @@ -525,7 +527,10 @@ static int create_digest(BIO *input, char *digest, const EVP_MD *md, return 0; return 0; } } } } return md_value_len; rv = md_value_len; err: EVP_MD_CTX_free(md_ctx); return rv; } } static ASN1_INTEGER *create_nonce(int bits) static ASN1_INTEGER *create_nonce(int bits) Loading crypto/dh/dh_kdf.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -117,8 +117,8 @@ int DH_KDF_X9_42(unsigned char *out, size_t outlen, goto err; goto err; for (i = 1;; i++) { for (i = 1;; i++) { unsigned char mtmp[EVP_MAX_MD_SIZE]; unsigned char mtmp[EVP_MAX_MD_SIZE]; EVP_DigestInit_ex(mctx, md, NULL); if (!EVP_DigestInit_ex(mctx, md, NULL) if (!EVP_DigestUpdate(mctx, Z, Zlen)) || !EVP_DigestUpdate(mctx, Z, Zlen)) goto err; goto err; ctr[3] = i & 0xFF; ctr[3] = i & 0xFF; ctr[2] = (i >> 8) & 0xFF; ctr[2] = (i >> 8) & 0xFF; Loading crypto/ec/ecdh_kdf.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -34,7 +34,8 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, mdlen = EVP_MD_size(md); mdlen = EVP_MD_size(md); for (i = 1;; i++) { for (i = 1;; i++) { unsigned char mtmp[EVP_MAX_MD_SIZE]; unsigned char mtmp[EVP_MAX_MD_SIZE]; EVP_DigestInit_ex(mctx, md, NULL); if (!EVP_DigestInit_ex(mctx, md, NULL)) goto err; ctr[3] = i & 0xFF; ctr[3] = i & 0xFF; ctr[2] = (i >> 8) & 0xFF; ctr[2] = (i >> 8) & 0xFF; ctr[1] = (i >> 16) & 0xFF; ctr[1] = (i >> 16) & 0xFF; Loading Loading
apps/passwd.c +53 −32 Original line number Original line Diff line number Diff line Loading @@ -287,7 +287,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) char *salt_out; char *salt_out; int n; int n; unsigned int i; unsigned int i; EVP_MD_CTX *md, *md2; EVP_MD_CTX *md = NULL, *md2 = NULL; size_t passwd_len, salt_len; size_t passwd_len, salt_len; passwd_len = strlen(passwd); passwd_len = strlen(passwd); Loading @@ -303,49 +303,65 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) assert(salt_len <= 8); assert(salt_len <= 8); md = EVP_MD_CTX_new(); md = EVP_MD_CTX_new(); if (md == NULL) if (md == NULL return NULL; || !EVP_DigestInit_ex(md, EVP_md5(), NULL) EVP_DigestInit_ex(md, EVP_md5(), NULL); || !EVP_DigestUpdate(md, passwd, passwd_len) EVP_DigestUpdate(md, passwd, passwd_len); || !EVP_DigestUpdate(md, "$", 1) EVP_DigestUpdate(md, "$", 1); || !EVP_DigestUpdate(md, magic, strlen(magic)) EVP_DigestUpdate(md, magic, strlen(magic)); || !EVP_DigestUpdate(md, "$", 1) EVP_DigestUpdate(md, "$", 1); || !EVP_DigestUpdate(md, salt_out, salt_len)) EVP_DigestUpdate(md, salt_out, salt_len); md2 = EVP_MD_CTX_new(); md2 = EVP_MD_CTX_new(); if (md2 == NULL) if (md2 == NULL return NULL; || !EVP_DigestInit_ex(md2, EVP_md5(), NULL) EVP_DigestInit_ex(md2, EVP_md5(), NULL); || !EVP_DigestUpdate(md2, passwd, passwd_len) EVP_DigestUpdate(md2, passwd, passwd_len); || !EVP_DigestUpdate(md2, salt_out, salt_len) EVP_DigestUpdate(md2, salt_out, salt_len); || !EVP_DigestUpdate(md2, passwd, passwd_len) EVP_DigestUpdate(md2, passwd, passwd_len); || !EVP_DigestFinal_ex(md2, buf, NULL)) EVP_DigestFinal_ex(md2, buf, NULL); goto err; for (i = passwd_len; i > sizeof buf; i -= sizeof buf) for (i = passwd_len; i > sizeof buf; i -= sizeof buf) { EVP_DigestUpdate(md, buf, sizeof buf); if (!EVP_DigestUpdate(md, buf, sizeof buf)) EVP_DigestUpdate(md, buf, i); goto err; } if (!EVP_DigestUpdate(md, buf, i)) goto err; n = passwd_len; n = passwd_len; while (n) { while (n) { EVP_DigestUpdate(md, (n & 1) ? "\0" : passwd, 1); if (!EVP_DigestUpdate(md, (n & 1) ? "\0" : passwd, 1)) goto err; n >>= 1; n >>= 1; } } EVP_DigestFinal_ex(md, buf, NULL); if (!EVP_DigestFinal_ex(md, buf, NULL)) return NULL; for (i = 0; i < 1000; i++) { for (i = 0; i < 1000; i++) { EVP_DigestInit_ex(md2, EVP_md5(), NULL); if (!EVP_DigestInit_ex(md2, EVP_md5(), NULL)) EVP_DigestUpdate(md2, (i & 1) ? (unsigned const char *)passwd : buf, goto err; (i & 1) ? passwd_len : sizeof buf); if (!EVP_DigestUpdate(md2, if (i % 3) (i & 1) ? (unsigned const char *)passwd : buf, EVP_DigestUpdate(md2, salt_out, salt_len); (i & 1) ? passwd_len : sizeof buf)) if (i % 7) goto err; EVP_DigestUpdate(md2, passwd, passwd_len); if (i % 3) { EVP_DigestUpdate(md2, (i & 1) ? buf : (unsigned const char *)passwd, if (!EVP_DigestUpdate(md2, salt_out, salt_len)) (i & 1) ? sizeof buf : passwd_len); goto err; EVP_DigestFinal_ex(md2, buf, NULL); } if (i % 7) { if (!EVP_DigestUpdate(md2, passwd, passwd_len)) goto err; } if (!EVP_DigestUpdate(md2, (i & 1) ? buf : (unsigned const char *)passwd, (i & 1) ? sizeof buf : passwd_len)) goto err; if (!EVP_DigestFinal_ex(md2, buf, NULL)) goto err; } } EVP_MD_CTX_free(md2); EVP_MD_CTX_free(md2); EVP_MD_CTX_free(md); EVP_MD_CTX_free(md); md2 = NULL; md = NULL; { { /* transform buf into output string */ /* transform buf into output string */ Loading Loading @@ -386,6 +402,11 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) } } return out_buf; return out_buf; err: EVP_MD_CTX_free(md2); EVP_MD_CTX_free(md); return NULL; } } # endif # endif Loading
apps/speed.c +28 −15 Original line number Original line Diff line number Diff line Loading @@ -601,9 +601,11 @@ static int EVP_Digest_MD2_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char md2[MD2_DIGEST_LENGTH]; unsigned char md2[MD2_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_MD2][testnum]); count++) for (count = 0; COND(c[D_MD2][testnum]); count++) { EVP_Digest(buf, (unsigned long)lengths[testnum], &(md2[0]), NULL, if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(md2[0]), NULL, EVP_md2(), NULL); EVP_md2(), NULL)) return -1; } return count; return count; } } #endif #endif Loading @@ -615,9 +617,11 @@ static int EVP_Digest_MDC2_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char mdc2[MDC2_DIGEST_LENGTH]; unsigned char mdc2[MDC2_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_MDC2][testnum]); count++) for (count = 0; COND(c[D_MDC2][testnum]); count++) { EVP_Digest(buf, (unsigned long)lengths[testnum], &(mdc2[0]), NULL, if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(mdc2[0]), NULL, EVP_mdc2(), NULL); EVP_mdc2(), NULL)) return -1; } return count; return count; } } #endif #endif Loading @@ -629,9 +633,11 @@ static int EVP_Digest_MD4_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char md4[MD4_DIGEST_LENGTH]; unsigned char md4[MD4_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_MD4][testnum]); count++) for (count = 0; COND(c[D_MD4][testnum]); count++) { EVP_Digest(&(buf[0]), (unsigned long)lengths[testnum], &(md4[0]), if (!EVP_Digest(&(buf[0]), (unsigned long)lengths[testnum], &(md4[0]), NULL, EVP_md4(), NULL); NULL, EVP_md4(), NULL)) return -1; } return count; return count; } } #endif #endif Loading Loading @@ -717,9 +723,11 @@ static int EVP_Digest_RMD160_loop(void *args) unsigned char *buf = tempargs->buf; unsigned char *buf = tempargs->buf; unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; unsigned char rmd160[RIPEMD160_DIGEST_LENGTH]; int count; int count; for (count = 0; COND(c[D_RMD160][testnum]); count++) for (count = 0; COND(c[D_RMD160][testnum]); count++) { EVP_Digest(buf, (unsigned long)lengths[testnum], &(rmd160[0]), NULL, if (!EVP_Digest(buf, (unsigned long)lengths[testnum], &(rmd160[0]), EVP_ripemd160(), NULL); NULL, EVP_ripemd160(), NULL)) return -1; } return count; return count; } } #endif #endif Loading Loading @@ -888,9 +896,10 @@ static int EVP_Digest_loop(void *args) unsigned char md[EVP_MAX_MD_SIZE]; unsigned char md[EVP_MAX_MD_SIZE]; int count; int count; for (count = 0; for (count = 0; COND(save_count * 4 * lengths[0] / lengths[testnum]); count++) COND(save_count * 4 * lengths[0] / lengths[testnum]); count++) { EVP_Digest(buf, lengths[testnum], &(md[0]), NULL, evp_md, NULL); if (!EVP_Digest(buf, lengths[testnum], &(md[0]), NULL, evp_md, NULL)) return -1; } return count; return count; } } Loading Loading @@ -2845,6 +2854,10 @@ static void pkey_print_message(const char *str, const char *str2, long num, static void print_result(int alg, int run_no, int count, double time_used) static void print_result(int alg, int run_no, int count, double time_used) { { if (count == -1) { BIO_puts(bio_err, "EVP error!\n"); exit(1); } BIO_printf(bio_err, BIO_printf(bio_err, mr ? "+R:%d:%s:%f\n" mr ? "+R:%d:%s:%f\n" : "%d %s's in %.2fs\n", count, names[alg], time_used); : "%d %s's in %.2fs\n", count, names[alg], time_used); Loading
apps/ts.c +14 −9 Original line number Original line Diff line number Diff line Loading @@ -492,28 +492,30 @@ static int create_digest(BIO *input, char *digest, const EVP_MD *md, unsigned char **md_value) unsigned char **md_value) { { int md_value_len; int md_value_len; int rv = 0; EVP_MD_CTX *md_ctx = NULL; md_value_len = EVP_MD_size(md); md_value_len = EVP_MD_size(md); if (md_value_len < 0) if (md_value_len < 0) return 0; return 0; if (input) { if (input) { EVP_MD_CTX *md_ctx = EVP_MD_CTX_new(); unsigned char buffer[4096]; unsigned char buffer[4096]; int length; int length; md_ctx = EVP_MD_CTX_new(); if (md_ctx == NULL) if (md_ctx == NULL) return 0; return 0; *md_value = app_malloc(md_value_len, "digest buffer"); *md_value = app_malloc(md_value_len, "digest buffer"); EVP_DigestInit(md_ctx, md); if (!EVP_DigestInit(md_ctx, md)) goto err; while ((length = BIO_read(input, buffer, sizeof(buffer))) > 0) { while ((length = BIO_read(input, buffer, sizeof(buffer))) > 0) { EVP_DigestUpdate(md_ctx, buffer, length); if (!EVP_DigestUpdate(md_ctx, buffer, length)) } goto err; if (!EVP_DigestFinal(md_ctx, *md_value, NULL)) { EVP_MD_CTX_free(md_ctx); return 0; } } EVP_MD_CTX_free(md_ctx); if (!EVP_DigestFinal(md_ctx, *md_value, NULL)) goto err; md_value_len = EVP_MD_size(md); } else { } else { long digest_len; long digest_len; *md_value = OPENSSL_hexstr2buf(digest, &digest_len); *md_value = OPENSSL_hexstr2buf(digest, &digest_len); Loading @@ -525,7 +527,10 @@ static int create_digest(BIO *input, char *digest, const EVP_MD *md, return 0; return 0; } } } } return md_value_len; rv = md_value_len; err: EVP_MD_CTX_free(md_ctx); return rv; } } static ASN1_INTEGER *create_nonce(int bits) static ASN1_INTEGER *create_nonce(int bits) Loading
crypto/dh/dh_kdf.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -117,8 +117,8 @@ int DH_KDF_X9_42(unsigned char *out, size_t outlen, goto err; goto err; for (i = 1;; i++) { for (i = 1;; i++) { unsigned char mtmp[EVP_MAX_MD_SIZE]; unsigned char mtmp[EVP_MAX_MD_SIZE]; EVP_DigestInit_ex(mctx, md, NULL); if (!EVP_DigestInit_ex(mctx, md, NULL) if (!EVP_DigestUpdate(mctx, Z, Zlen)) || !EVP_DigestUpdate(mctx, Z, Zlen)) goto err; goto err; ctr[3] = i & 0xFF; ctr[3] = i & 0xFF; ctr[2] = (i >> 8) & 0xFF; ctr[2] = (i >> 8) & 0xFF; Loading
crypto/ec/ecdh_kdf.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -34,7 +34,8 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, mdlen = EVP_MD_size(md); mdlen = EVP_MD_size(md); for (i = 1;; i++) { for (i = 1;; i++) { unsigned char mtmp[EVP_MAX_MD_SIZE]; unsigned char mtmp[EVP_MAX_MD_SIZE]; EVP_DigestInit_ex(mctx, md, NULL); if (!EVP_DigestInit_ex(mctx, md, NULL)) goto err; ctr[3] = i & 0xFF; ctr[3] = i & 0xFF; ctr[2] = (i >> 8) & 0xFF; ctr[2] = (i >> 8) & 0xFF; ctr[1] = (i >> 16) & 0xFF; ctr[1] = (i >> 16) & 0xFF; Loading