Remove references to gnutls_certificate_type_set_priority.

This function was deprecated at some point in the distant past, and has
now been removed from gnutls upstream. There is no good replacement, and
no current users of the Haskell wrapper, so the easiest solution is to
remove setPriority from the binding.
This commit is contained in:
John Millikin 2015-06-17 20:47:49 -07:00
parent 90aa9e3473
commit 4edd87d207
No known key found for this signature in database
GPG key ID: A13371E69A7D8899
2 changed files with 0 additions and 26 deletions

View file

@ -36,10 +36,6 @@ module Network.Protocol.TLS.GNU
, Credentials
, setCredentials
, certificateCredentials
, Prioritised
, setPriority
, CertificateType (..)
) where
import Control.Applicative (Applicative, pure, (<*>))
@ -243,25 +239,6 @@ certificateCredentials = do
fp <- liftIO $ F.newForeignPtr F.gnutls_certificate_free_credentials_funptr ptr
return $ Credentials (F.CredentialsType 1) fp
class Prioritised a where
priorityInt :: a -> F.CInt
priorityProc :: a -> F.Session -> F.Ptr F.CInt -> IO F.ReturnCode
data CertificateType = X509 | OpenPGP
deriving (Show)
instance Prioritised CertificateType where
priorityProc = const F.gnutls_certificate_type_set_priority
priorityInt x = case x of
X509 -> 1
OpenPGP -> 2
setPriority :: Prioritised a => [a] -> TLS ()
setPriority xs = do
let fake = head $ [undefined] ++ xs
rc <- withSession $ F.withArray0 0 (map priorityInt xs) . priorityProc fake
checkRC rc
withSession :: (F.Session -> IO a) -> TLS a
withSession io = do
s <- getSession

View file

@ -195,9 +195,6 @@ foreign import ccall safe "gnutls_certificate_type_get"
foreign import ccall safe "gnutls_certificate_type_list"
gnutls_certificate_type_list :: IO (Ptr CertificateType)
foreign import ccall safe "gnutls_certificate_type_set_priority"
gnutls_certificate_type_set_priority :: Session -> Ptr CInt -> IO ReturnCode
-- }}}
-- Credentials {{{