CONF inclusion test: Add VMS specific tests
[oweals/openssl.git] / test / ossl_shim / async_bio.cc
index 825b22372f8b5dc27d688cba6dbad940f7c8cfe9..cbbabe01eab05571c97a12fcb590f738a0cbb36a 100644 (file)
@@ -1,22 +1,18 @@
-/* Copyright (c) 2014, Google Inc.
+/*
+ * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+ * Licensed under the OpenSSL license (the "License").  You may not use
+ * this file except in compliance with the License.  You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
 
 #include "async_bio.h"
 
 #include <errno.h>
 #include <string.h>
 
+#include <openssl/bio.h>
 #include <openssl/crypto.h>
 
 
@@ -30,15 +26,6 @@ struct AsyncBio {
 };
 
 AsyncBio *GetData(BIO *bio) {
-  /*
-   * TODO: Missing accessor? This probably needs a BIO_get_method() in OpenSSL
-   *       For now skip this check
-   */
-#if 0
-  if (bio->method != &g_async_bio_method) {
-    return NULL;
-  }
-#endif
   return (AsyncBio *)BIO_get_data(bio);
 }
 
@@ -131,10 +118,10 @@ static int AsyncFree(BIO *bio) {
   return 1;
 }
 
-static long AsyncCallbackCtrl(BIO *bio, int cmd, bio_info_cb fp) {
-  if (BIO_next(bio) == NULL) {
+static long AsyncCallbackCtrl(BIO *bio, int cmd, BIO_info_cb fp)
+{
+  if (BIO_next(bio) == NULL)
     return 0;
-  }
   return BIO_callback_ctrl(BIO_next(bio), cmd, fp);
 }
 
@@ -158,12 +145,12 @@ static const BIO_METHOD *AsyncMethod(void)
 
 }  // namespace
 
-ScopedBIO AsyncBioCreate() {
-  return ScopedBIO(BIO_new(AsyncMethod()));
+bssl::UniquePtr<BIO> AsyncBioCreate() {
+  return bssl::UniquePtr<BIO>(BIO_new(AsyncMethod()));
 }
 
-ScopedBIO AsyncBioCreateDatagram() {
-  ScopedBIO ret(BIO_new(AsyncMethod()));
+bssl::UniquePtr<BIO> AsyncBioCreateDatagram() {
+  bssl::UniquePtr<BIO> ret(BIO_new(AsyncMethod()));
   if (!ret) {
     return nullptr;
   }