]> git.ipfire.org Git - thirdparty/krb5.git/commit
Fix error checking in PKINIT authdata creation
authorGreg Hudson <ghudson@mit.edu>
Sat, 14 Jun 2014 15:23:08 +0000 (11:23 -0400)
committerGreg Hudson <ghudson@mit.edu>
Fri, 20 Jun 2014 18:42:25 +0000 (14:42 -0400)
commit09246e64e20f079bef6163e9e1d0ecda7917b8c2
treea655e13fe696adb4b9117bc3582690047ff8cbf6
parent1cddc360c25386a55dc2f2d44056c88721784dd6
Fix error checking in PKINIT authdata creation

In create_identifiers_from_stack: check for allocation errors from
PKCS7_ISSUER_AND_SERIAL_new and M_ASN1_INTEGER_dup.  Use
PKCS7_ISSUER_AND_SERIAL_free to more concisely clean up the OpenSSL
issuer variable, and make sure that any partially processed value is
cleaned up on error.  Use calloc to allocate krb5_cas so that all of
its pointers are initially nulled, so that
free_krb5_external_principal_identifier can operate on it safely in
case of error.  Eliminate the retval variable as it was not used
safely.  Rename the error label from "cleanup" to "oom" and separate
it from the successful return path (which has nothing to clean up).

ticket: 7943 (new)
target_version: 1.12.2
tags: pullup
src/plugins/preauth/pkinit/pkinit_crypto_openssl.c