 ssl/ssl.h      |  2 ++
 ssl/ssl_ciph.c | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/ssl/ssl.h b/ssl/ssl.h
index afec1f5..9269708 100644
--- a/ssl/ssl.h
+++ b/ssl/ssl.h
@@ -2144,6 +2144,8 @@ int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits);
 char *SSL_CIPHER_get_version(const SSL_CIPHER *c);
 const char *SSL_CIPHER_get_name(const SSL_CIPHER *c);
 unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c);
+int SSL_CIPHER_is_PSK(const SSL_CIPHER *c);
+int SSL_CIPHER_is_SRP(const SSL_CIPHER *c);
 
 int SSL_get_fd(const SSL *s);
 int SSL_get_rfd(const SSL *s);
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index 6957bda..2747a40 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -1912,7 +1912,20 @@ int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits)
 
 unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c)
 {
-    return c->id;
+    if (c != NULL ) return c->id;
+    return 0;    /* may be not the best error value ? */
+}
+
+int SSL_CIPHER_is_PSK(const SSL_CIPHER *c)
+{
+    if (c != NULL && c->algorithm_auth == SSL_aPSK) return 1;
+    return 0;
+}
+
+int SSL_CIPHER_is_SRP(const SSL_CIPHER *c)
+{
+    if (c != NULL && c->algorithm_auth == SSL_aSRP) return 1;
+    return 0;
 }
 
 SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n)
