1 /*
   2  * Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   3  *
   4  * Licensed under the Apache License, Version 2.0 (the "License").
   5  * You may not use this file except in compliance with the License.
   6  * A copy of the License is located at
   7  *
   8  *  http://aws.amazon.com/apache2.0
   9  *
  10  * or in the "license" file accompanying this file. This file is distributed
  11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12  * express or implied. See the License for the specific language governing
  13  * permissions and limitations under the License.
  14  */
  15 
  16 /* Use usleep */
  17 #define _XOPEN_SOURCE 500
  18 #include <unistd.h>
  19 
  20 #include <errno.h>
  21 #include <s2n.h>
  22 
  23 #include "error/s2n_errno.h"
  24 
  25 #include "tls/s2n_connection.h"
  26 #include "tls/s2n_handshake.h"
  27 #include "tls/s2n_record.h"
  28 #include "tls/s2n_alerts.h"
  29 #include "tls/s2n_tls.h"
  30 
  31 #include "stuffer/s2n_stuffer.h"
  32 
  33 #include "utils/s2n_safety.h"
  34 #include "utils/s2n_blob.h"
  35 
  36 int s2n_read_full_record(struct s2n_connection *conn, uint8_t *record_type, int *isSSLv2)
  37 {
 
 | 
   1 /*
   2  * Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   3  *
   4  * Licensed under the Apache License, Version 2.0 (the "License").
   5  * You may not use this file except in compliance with the License.
   6  * A copy of the License is located at
   7  *
   8  *  http://aws.amazon.com/apache2.0
   9  *
  10  * or in the "license" file accompanying this file. This file is distributed
  11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12  * express or implied. See the License for the specific language governing
  13  * permissions and limitations under the License.
  14  */
  15 
  16 /* Use usleep */
  17 #ifndef __sun
  18 #define _XOPEN_SOURCE 500
  19 #endif /* __sun doesn't need XOPEN_SOURCE defined for usleep() in unistd.h. */
  20 #include <unistd.h>
  21 
  22 #include <errno.h>
  23 #include <s2n.h>
  24 
  25 #include "error/s2n_errno.h"
  26 
  27 #include "tls/s2n_connection.h"
  28 #include "tls/s2n_handshake.h"
  29 #include "tls/s2n_record.h"
  30 #include "tls/s2n_alerts.h"
  31 #include "tls/s2n_tls.h"
  32 
  33 #include "stuffer/s2n_stuffer.h"
  34 
  35 #include "utils/s2n_safety.h"
  36 #include "utils/s2n_blob.h"
  37 
  38 int s2n_read_full_record(struct s2n_connection *conn, uint8_t *record_type, int *isSSLv2)
  39 {
 
 |