*
*/
#ifndef OPENSSL_NO_SRP
-# include "cryptlib.h"
+# include "internal/cryptlib.h"
# include <openssl/sha.h>
# include <openssl/srp.h>
# include <openssl/evp.h>
EVP_DigestFinal_ex(&ctxt, cu, NULL);
EVP_MD_CTX_cleanup(&ctxt);
- if (!(u = BN_bin2bn(cu, sizeof(cu), NULL)))
+ if ((u = BN_bin2bn(cu, sizeof(cu), NULL)) == NULL)
return NULL;
if (!BN_is_zero(u))
return u;
/* B = g**b + k*v */
- if (!BN_mod_exp(gb, g, b, N, bn_ctx) ||
- !(k = srp_Calc_k(N, g)) ||
- !BN_mod_mul(kv, v, k, N, bn_ctx) ||
- !BN_mod_add(B, gb, kv, N, bn_ctx)) {
+ if (!BN_mod_exp(gb, g, b, N, bn_ctx)
+ || (k = srp_Calc_k(N, g)) == NULL
+ || !BN_mod_mul(kv, v, k, N, bn_ctx)
+ || !BN_mod_add(B, gb, kv, N, bn_ctx)) {
BN_free(B);
B = NULL;
}
if (!BN_mod_exp(tmp, g, x, N, bn_ctx))
goto err;
- if (!(k = srp_Calc_k(N, g)))
+ if ((k = srp_Calc_k(N, g)) == NULL)
goto err;
if (!BN_mod_mul(tmp2, tmp, k, N, bn_ctx))
goto err;
if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx))
goto err;
-
if (!BN_mod_mul(tmp3, u, x, N, bn_ctx))
goto err;
if (!BN_mod_add(tmp2, a, tmp3, N, bn_ctx))