Option to set current cert to server certificate.
[openssl.git] / ssl / tls_srp.c
index 98925f7..c363fc3 100644 (file)
@@ -4,7 +4,7 @@
  * for the EdelKey project and contributed to the OpenSSL project 2004.
  */
 /* ====================================================================
- * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 2004-2011 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -82,7 +82,6 @@ int SSL_CTX_SRP_CTX_free(struct ssl_ctx_st *ctx)
        ctx->srp_ctx.SRP_cb_arg = NULL;
        ctx->srp_ctx.SRP_verify_param_callback = NULL;
        ctx->srp_ctx.SRP_give_srp_client_pwd_callback = NULL;
-       ctx->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback = NULL;
        ctx->srp_ctx.N = NULL;
        ctx->srp_ctx.g = NULL;
        ctx->srp_ctx.s = NULL;
@@ -115,7 +114,6 @@ int SSL_SRP_CTX_free(struct ssl_st *s)
        s->srp_ctx.SRP_cb_arg = NULL;
        s->srp_ctx.SRP_verify_param_callback = NULL;
        s->srp_ctx.SRP_give_srp_client_pwd_callback = NULL;
-       s->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback = NULL;
        s->srp_ctx.N = NULL;
        s->srp_ctx.g = NULL;
        s->srp_ctx.s = NULL;
@@ -144,7 +142,6 @@ int SSL_SRP_CTX_init(struct ssl_st *s)
        s->srp_ctx.SRP_verify_param_callback = ctx->srp_ctx.SRP_verify_param_callback;
        /* set SRP client passwd callback */
        s->srp_ctx.SRP_give_srp_client_pwd_callback = ctx->srp_ctx.SRP_give_srp_client_pwd_callback;
-       s->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback = ctx->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback;
 
        s->srp_ctx.N = NULL;
        s->srp_ctx.g = NULL;
@@ -212,7 +209,6 @@ int SSL_CTX_SRP_CTX_init(struct ssl_ctx_st *ctx)
        ctx->srp_ctx.SRP_verify_param_callback = NULL;
        /* set SRP client passwd callback */
        ctx->srp_ctx.SRP_give_srp_client_pwd_callback = NULL;
-       ctx->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback = NULL;
 
        ctx->srp_ctx.N = NULL;
        ctx->srp_ctx.g = NULL;
@@ -236,7 +232,7 @@ int SSL_srp_server_param_with_username(SSL *s, int *ad)
        unsigned char b[SSL_MAX_MASTER_KEY_LENGTH];
        int al;
 
-       *ad = SSL_AD_UNKNOWN_SRP_USERNAME;
+       *ad = SSL_AD_UNKNOWN_PSK_IDENTITY;
        if ((s->srp_ctx.TLS_ext_srp_username_callback !=NULL) &&
                ((al = s->srp_ctx.TLS_ext_srp_username_callback(s, ad, s->srp_ctx.SRP_cb_arg))!=SSL_ERROR_NONE))
                        return al;
@@ -440,16 +436,6 @@ int SRP_Calc_A_param(SSL *s)
        return 1;
        }
 
-int SRP_have_to_put_srp_username(SSL *s)
-       {
-       if (s->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback == NULL)
-               return 0;
-       if ((s->srp_ctx.login = s->srp_ctx.SRP_TLS_ext_missing_srp_client_username_callback(s,s->srp_ctx.SRP_cb_arg)) == NULL)
-               return 0;
-       s->srp_ctx.srp_Mask|=SSL_kSRP;
-       return 1;
-       }
-
 BIGNUM *SSL_get_srp_g(SSL *s)
        {
        if (s->srp_ctx.g != NULL)
@@ -521,11 +507,4 @@ int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx, char *(*cb)(SSL *,void *))
                                      (void (*)(void))cb);
        }
 
-int SSL_CTX_set_srp_missing_srp_username_callback(SSL_CTX *ctx,
-                                                 char *(*cb)(SSL *,void *))
-       {
-       return tls1_ctx_callback_ctrl(ctx,
-                           SSL_CTRL_SET_TLS_EXT_SRP_MISSING_CLIENT_USERNAME_CB,
-                                     (void (*)(void))cb);
-       }
 #endif