Fixed memory leak in the event of a failure of BUF_MEM_grow
[openssl.git] / ssl / kssl.c
index 0033e9bf62e3857f27ea9dbda7047eb2a50a5f82..4eaf294ca9a9d72b98d5f25d3e241f11572d986c 100644 (file)
@@ -2093,9 +2093,12 @@ krb5_error_code  kssl_check_authent(
         EVP_CIPHER_CTX_cleanup(&ciph_ctx);
 
 #ifdef KSSL_DEBUG
+       {
+       int padl;
        printf("kssl_check_authent: decrypted authenticator[%d] =\n", outl);
        for (padl=0; padl < outl; padl++) printf("%02x ",unenc_authent[padl]);
        printf("\n");
+       }
 #endif /* KSSL_DEBUG */
 
        if ((p = kssl_skip_confound(enctype, unenc_authent)) == NULL)
@@ -2130,7 +2133,7 @@ krb5_error_code  kssl_check_authent(
 
 #ifdef KSSL_DEBUG
        printf("kssl_check_authent: returns %d for client time ", *atimep);
-       if (auth && auth->ctime && auth->ctime->length && auth->ctime->data)
+       if (auth->ctime && auth->ctime->length && auth->ctime->data)
                printf("%.*s\n", auth->ctime->length, auth->ctime->data);
        else    printf("NULL\n");
 #endif /* KSSL_DEBUG */
@@ -2145,7 +2148,7 @@ krb5_error_code  kssl_check_authent(
 
 
 /*  Replaces krb5_build_principal_ext(), with varargs length == 2 (svc, host),
-**  because I dont't know how to stub varargs.
+**  because I don't know how to stub varargs.
 **  Returns krb5_error_code == ENOMEM on alloc error, otherwise
 **  passes back newly constructed principal, which should be freed by caller.
 */
@@ -2191,6 +2194,22 @@ krb5_error_code  kssl_build_principal_2(
        return ENOMEM;
        }
 
+void SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx)
+       {
+       s->kssl_ctx = kctx;
+       } 
+
+KSSL_CTX * SSL_get0_kssl_ctx(SSL *s)
+       {
+       return s->kssl_ctx;
+       }
+
+char *kssl_ctx_get0_client_princ(KSSL_CTX *kctx)
+       {
+       if (kctx)
+               return kctx->client_princ;
+       return NULL;
+       }
 
 #else /* !OPENSSL_NO_KRB5 */