Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / boringssl / src / ssl / d1_srtp.c
index 1f909de..69b11ad 100644 (file)
   Copyright (C) 2011, RTFM, Inc.
 */
 
-#ifndef OPENSSL_NO_SRTP
-
 #include <stdio.h>
 
 #include <openssl/bytestring.h>
@@ -226,20 +224,17 @@ static int ssl_ctx_make_profiles(const char *profiles_string,STACK_OF(SRTP_PROTE
     
        return 1;
        }
-    
-int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx,const char *profiles)
+
+int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, const char *profiles)
        {
-       /* This API inverts its return value. */
-       return !ssl_ctx_make_profiles(profiles,&ctx->srtp_profiles);
+       return ssl_ctx_make_profiles(profiles, &ctx->srtp_profiles);
        }
 
-int SSL_set_tlsext_use_srtp(SSL *s,const char *profiles)
+int SSL_set_srtp_profiles(SSL *s, const char *profiles)
        {
-       /* This API inverts its return value. */
-       return !ssl_ctx_make_profiles(profiles,&s->srtp_profiles);
+       return ssl_ctx_make_profiles(profiles, &s->srtp_profiles);
        }
 
-
 STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *s)
        {
        if(s != NULL)
@@ -263,6 +258,18 @@ SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s)
        return s->srtp_profile;
        }
 
+int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles)
+       {
+       /* This API inverts its return value. */
+       return !SSL_CTX_set_srtp_profiles(ctx, profiles);
+       }
+
+int SSL_set_tlsext_use_srtp(SSL *s, const char *profiles)
+       {
+       /* This API inverts its return value. */
+       return !SSL_set_srtp_profiles(s, profiles);
+       }
+
 /* Note: this function returns 0 length if there are no 
    profiles specified */
 int ssl_add_clienthello_use_srtp_ext(SSL *s, unsigned char *p, int *len, int maxlen)
@@ -312,7 +319,7 @@ int ssl_parse_clienthello_use_srtp_ext(SSL *s, CBS *cbs, int *out_alert)
        CBS profile_ids, srtp_mki;
        SRTP_PROTECTION_PROFILE *cprof, *sprof;
        STACK_OF(SRTP_PROTECTION_PROFILE) *clnt = 0,*srvr;
-       int i,j;
+       size_t i,j;
        int ret = 0;
 
        if (!CBS_get_u16_length_prefixed(cbs, &profile_ids) ||
@@ -405,7 +412,7 @@ int ssl_parse_serverhello_use_srtp_ext(SSL *s, CBS *cbs, int *out_alert)
        {
        CBS profile_ids, srtp_mki;
        uint16_t profile_id;
-       int i;
+       size_t i;
 
        STACK_OF(SRTP_PROTECTION_PROFILE) *clnt;
        SRTP_PROTECTION_PROFILE *prof;
@@ -464,6 +471,3 @@ int ssl_parse_serverhello_use_srtp_ext(SSL *s, CBS *cbs, int *out_alert)
        *out_alert = SSL_AD_ILLEGAL_PARAMETER;
        return 0;
        }
-
-
-#endif