Skip to content

Commit

Permalink
fix #38: affverify failing due to evp md context being used after freed
Browse files Browse the repository at this point in the history
  • Loading branch information
sshock committed Feb 16, 2019
1 parent 8207bec commit fb5a4fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ tools/affstats
tools/affuse
tools/affverify
tools/affxml
tools/rawevidence.raw

lib/version.h
*.lo
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,8 @@ int af_sig_verify_seg2(AFFILE *af,const char *segname,EVP_PKEY * /*pubkey*/,u_ch
EVP_VerifyUpdate(md,(const unsigned char *)segname,strlen(segname)+1);
EVP_VerifyUpdate(md,(const unsigned char *)&arg_net,sizeof(arg_net));
EVP_VerifyUpdate(md,segbuf,seglen);
EVP_MD_CTX_free(md);
int r = EVP_VerifyFinal(md,sigbuf,sigbuf_len,af->crypto->sign_pubkey);
EVP_MD_CTX_free(md);
free(segbuf);

if(r==1) return 0; // verifies
Expand Down

0 comments on commit fb5a4fd

Please sign in to comment.