diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-11-09 14:23:17 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-11-09 14:23:17 +0000 |
commit | 3b4fb53221cb13d3affd63477fc17a81978838f6 (patch) | |
tree | 848920db4b558ee43c405e1fddda553549956619 | |
parent | 7437036cdf3aefa51be93b3bc6e04c4c21e2cf5d (diff) |
fclose streams in fips_drbvs.cOpenSSL-fips-2_0-rc2
Produced error message for unsupported curves in fips_ecdhvs.c
-rw-r--r-- | fips/ecdh/fips_ecdhvs.c | 5 | ||||
-rw-r--r-- | fips/rand/fips_drbgvs.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/fips/ecdh/fips_ecdhvs.c b/fips/ecdh/fips_ecdhvs.c index a30e335e2b..099285aac3 100644 --- a/fips/ecdh/fips_ecdhvs.c +++ b/fips/ecdh/fips_ecdhvs.c @@ -413,6 +413,11 @@ int main(int argc, char **argv) if (group) EC_GROUP_free(group); group = EC_GROUP_new_by_curve_name(nid); + if (!group) + { + fprintf(stderr, "ERROR: unsupported curve %s\n", buf + 1); + return 1; + } } if (strlen(buf) > 6 && !strncmp(buf, "[E", 2)) diff --git a/fips/rand/fips_drbgvs.c b/fips/rand/fips_drbgvs.c index bcdfa6dac3..9aae88c3e1 100644 --- a/fips/rand/fips_drbgvs.c +++ b/fips/rand/fips_drbgvs.c @@ -176,7 +176,7 @@ int fips_drbgvs_main(int argc,char **argv) int main(int argc,char **argv) #endif { - FILE *in, *out; + FILE *in = NULL, *out = NULL; DRBG_CTX *dctx = NULL; TEST_ENT t; int r, nid = 0; @@ -406,6 +406,10 @@ int main(int argc,char **argv) } } + if (in && in != stdin) + fclose(in); + if (out && out != stdout) + fclose(out); return 0; } |