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:
parent
90aa9e3473
commit
4edd87d207
2 changed files with 0 additions and 26 deletions
|
@ -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
|
||||
|
|
|
@ -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 {{{
|
||||
|
|
Loading…
Reference in a new issue