diff options
author | beck <> | 2014-04-17 13:37:50 +0000 |
---|---|---|
committer | beck <> | 2014-04-17 13:37:50 +0000 |
commit | bddb7c686e3d1aeb156722adc64b6c35ae720f87 (patch) | |
tree | 7595a93a27385c367802aa17ecf20f96551cf14d /src/lib/libcrypto/srp/srp_vfy.c | |
parent | ecec66222d758996a4ff2671ca5026d9ede5ef76 (diff) | |
download | openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.gz openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.tar.bz2 openbsd-bddb7c686e3d1aeb156722adc64b6c35ae720f87.zip |
Change library to use intrinsic memory allocation functions instead of
OPENSSL_foo wrappers. This changes:
OPENSSL_malloc->malloc
OPENSSL_free->free
OPENSSL_relloc->realloc
OPENSSL_freeFunc->free
Diffstat (limited to 'src/lib/libcrypto/srp/srp_vfy.c')
-rw-r--r-- | src/lib/libcrypto/srp/srp_vfy.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/lib/libcrypto/srp/srp_vfy.c b/src/lib/libcrypto/srp/srp_vfy.c index 4a3d13edf6..de7dbe5bbd 100644 --- a/src/lib/libcrypto/srp/srp_vfy.c +++ b/src/lib/libcrypto/srp/srp_vfy.c | |||
@@ -185,14 +185,14 @@ static void SRP_user_pwd_free(SRP_user_pwd *user_pwd) | |||
185 | return; | 185 | return; |
186 | BN_free(user_pwd->s); | 186 | BN_free(user_pwd->s); |
187 | BN_clear_free(user_pwd->v); | 187 | BN_clear_free(user_pwd->v); |
188 | OPENSSL_free(user_pwd->id); | 188 | free(user_pwd->id); |
189 | OPENSSL_free(user_pwd->info); | 189 | free(user_pwd->info); |
190 | OPENSSL_free(user_pwd); | 190 | free(user_pwd); |
191 | } | 191 | } |
192 | 192 | ||
193 | static SRP_user_pwd *SRP_user_pwd_new() | 193 | static SRP_user_pwd *SRP_user_pwd_new() |
194 | { | 194 | { |
195 | SRP_user_pwd *ret = OPENSSL_malloc(sizeof(SRP_user_pwd)); | 195 | SRP_user_pwd *ret = malloc(sizeof(SRP_user_pwd)); |
196 | if (ret == NULL) | 196 | if (ret == NULL) |
197 | return NULL; | 197 | return NULL; |
198 | ret->N = NULL; | 198 | ret->N = NULL; |
@@ -243,14 +243,14 @@ static int SRP_user_pwd_set_sv_BN(SRP_user_pwd *vinfo, BIGNUM *s, BIGNUM *v) | |||
243 | 243 | ||
244 | SRP_VBASE *SRP_VBASE_new(char *seed_key) | 244 | SRP_VBASE *SRP_VBASE_new(char *seed_key) |
245 | { | 245 | { |
246 | SRP_VBASE *vb = (SRP_VBASE *) OPENSSL_malloc(sizeof(SRP_VBASE)); | 246 | SRP_VBASE *vb = (SRP_VBASE *) malloc(sizeof(SRP_VBASE)); |
247 | 247 | ||
248 | if (vb == NULL) | 248 | if (vb == NULL) |
249 | return NULL; | 249 | return NULL; |
250 | if (!(vb->users_pwd = sk_SRP_user_pwd_new_null()) || | 250 | if (!(vb->users_pwd = sk_SRP_user_pwd_new_null()) || |
251 | !(vb->gN_cache = sk_SRP_gN_cache_new_null())) | 251 | !(vb->gN_cache = sk_SRP_gN_cache_new_null())) |
252 | { | 252 | { |
253 | OPENSSL_free(vb); | 253 | free(vb); |
254 | return NULL; | 254 | return NULL; |
255 | } | 255 | } |
256 | vb->default_g = NULL; | 256 | vb->default_g = NULL; |
@@ -261,7 +261,7 @@ SRP_VBASE *SRP_VBASE_new(char *seed_key) | |||
261 | { | 261 | { |
262 | sk_SRP_user_pwd_free(vb->users_pwd); | 262 | sk_SRP_user_pwd_free(vb->users_pwd); |
263 | sk_SRP_gN_cache_free(vb->gN_cache); | 263 | sk_SRP_gN_cache_free(vb->gN_cache); |
264 | OPENSSL_free(vb); | 264 | free(vb); |
265 | return NULL; | 265 | return NULL; |
266 | } | 266 | } |
267 | return vb; | 267 | return vb; |
@@ -272,8 +272,8 @@ int SRP_VBASE_free(SRP_VBASE *vb) | |||
272 | { | 272 | { |
273 | sk_SRP_user_pwd_pop_free(vb->users_pwd,SRP_user_pwd_free); | 273 | sk_SRP_user_pwd_pop_free(vb->users_pwd,SRP_user_pwd_free); |
274 | sk_SRP_gN_cache_free(vb->gN_cache); | 274 | sk_SRP_gN_cache_free(vb->gN_cache); |
275 | OPENSSL_free(vb->seed_key); | 275 | free(vb->seed_key); |
276 | OPENSSL_free(vb); | 276 | free(vb); |
277 | return 0; | 277 | return 0; |
278 | } | 278 | } |
279 | 279 | ||
@@ -283,7 +283,7 @@ static SRP_gN_cache *SRP_gN_new_init(const char *ch) | |||
283 | unsigned char tmp[MAX_LEN]; | 283 | unsigned char tmp[MAX_LEN]; |
284 | int len; | 284 | int len; |
285 | 285 | ||
286 | SRP_gN_cache *newgN = (SRP_gN_cache *)OPENSSL_malloc(sizeof(SRP_gN_cache)); | 286 | SRP_gN_cache *newgN = (SRP_gN_cache *)malloc(sizeof(SRP_gN_cache)); |
287 | if (newgN == NULL) | 287 | if (newgN == NULL) |
288 | return NULL; | 288 | return NULL; |
289 | 289 | ||
@@ -294,9 +294,9 @@ static SRP_gN_cache *SRP_gN_new_init(const char *ch) | |||
294 | if ((newgN->bn = BN_bin2bn(tmp, len, NULL))) | 294 | if ((newgN->bn = BN_bin2bn(tmp, len, NULL))) |
295 | return newgN; | 295 | return newgN; |
296 | 296 | ||
297 | OPENSSL_free(newgN->b64_bn); | 297 | free(newgN->b64_bn); |
298 | err: | 298 | err: |
299 | OPENSSL_free(newgN); | 299 | free(newgN); |
300 | return NULL; | 300 | return NULL; |
301 | } | 301 | } |
302 | 302 | ||
@@ -305,9 +305,9 @@ static void SRP_gN_free(SRP_gN_cache *gN_cache) | |||
305 | { | 305 | { |
306 | if (gN_cache == NULL) | 306 | if (gN_cache == NULL) |
307 | return; | 307 | return; |
308 | OPENSSL_free(gN_cache->b64_bn); | 308 | free(gN_cache->b64_bn); |
309 | BN_free(gN_cache->bn); | 309 | BN_free(gN_cache->bn); |
310 | OPENSSL_free(gN_cache); | 310 | free(gN_cache); |
311 | } | 311 | } |
312 | 312 | ||
313 | static SRP_gN *SRP_get_gN_by_id(const char *id, STACK_OF(SRP_gN) *gN_tab) | 313 | static SRP_gN *SRP_get_gN_by_id(const char *id, STACK_OF(SRP_gN) *gN_tab) |
@@ -395,7 +395,7 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file) | |||
395 | { | 395 | { |
396 | /*we add this couple in the internal Stack */ | 396 | /*we add this couple in the internal Stack */ |
397 | 397 | ||
398 | if ((gN = (SRP_gN *)OPENSSL_malloc(sizeof(SRP_gN))) == NULL) | 398 | if ((gN = (SRP_gN *)malloc(sizeof(SRP_gN))) == NULL) |
399 | goto err; | 399 | goto err; |
400 | 400 | ||
401 | if (!(gN->id = BUF_strdup(pp[DB_srpid])) | 401 | if (!(gN->id = BUF_strdup(pp[DB_srpid])) |
@@ -456,8 +456,8 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file) | |||
456 | 456 | ||
457 | if (gN != NULL) | 457 | if (gN != NULL) |
458 | { | 458 | { |
459 | OPENSSL_free(gN->id); | 459 | free(gN->id); |
460 | OPENSSL_free(gN); | 460 | free(gN); |
461 | } | 461 | } |
462 | 462 | ||
463 | SRP_user_pwd_free(user_pwd); | 463 | SRP_user_pwd_free(user_pwd); |
@@ -573,7 +573,7 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, | |||
573 | if(!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) goto err; | 573 | if(!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) goto err; |
574 | 574 | ||
575 | BN_bn2bin(v,tmp); | 575 | BN_bn2bin(v,tmp); |
576 | if (((vf = OPENSSL_malloc(BN_num_bytes(v)*2)) == NULL)) | 576 | if (((vf = malloc(BN_num_bytes(v)*2)) == NULL)) |
577 | goto err; | 577 | goto err; |
578 | t_tob64(vf, tmp, BN_num_bytes(v)); | 578 | t_tob64(vf, tmp, BN_num_bytes(v)); |
579 | 579 | ||
@@ -582,9 +582,9 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, | |||
582 | { | 582 | { |
583 | char *tmp_salt; | 583 | char *tmp_salt; |
584 | 584 | ||
585 | if ((tmp_salt = OPENSSL_malloc(SRP_RANDOM_SALT_LEN * 2)) == NULL) | 585 | if ((tmp_salt = malloc(SRP_RANDOM_SALT_LEN * 2)) == NULL) |
586 | { | 586 | { |
587 | OPENSSL_free(vf); | 587 | free(vf); |
588 | goto err; | 588 | goto err; |
589 | } | 589 | } |
590 | t_tob64(tmp_salt, tmp2, SRP_RANDOM_SALT_LEN); | 590 | t_tob64(tmp_salt, tmp2, SRP_RANDOM_SALT_LEN); |