Permalink
Browse files

Added COPYING / Supplessed unneeded imports

darcs-hash:20070717082814-62b54-bc40000b230281780fad78f5ae8fc0a1e5dc6242.gz
  • Loading branch information...
1 parent d145e51 commit 0e4cdc653971a4353103da92e510c475b97865e5 @depressed-pho committed Jul 17, 2007
View
29 COPYING
@@ -0,0 +1,29 @@
+<!-- -*- xml -*-
+
+HsOpenSSL はパブリックドメインに在ります。
+HsOpenSSL is in the public domain.
+
+See http://creativecommons.org/licenses/publicdomain/
+
+-->
+
+<rdf:RDF xmlns="http://web.resource.org/cc/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <Work rdf:about="http://ccm.sherry.jp/HsOpenSSL/">
+ <dc:title>HsOpenSSL</dc:title>
+ <dc:rights>
+ <Agent>
+ <dc:title>phonohawk</dc:title>
+ </Agent>
+ </dc:rights>
+ <license rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ </Work>
+
+ <License rdf:about="http://web.resource.org/cc/PublicDomain">
+ <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
+ <permits rdf:resource="http://web.resource.org/cc/Distribution" />
+ <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+ </License>
+
+</rdf:RDF>
View
@@ -7,10 +7,11 @@ Description:
messages.
Version: 0.1
License: PublicDomain
-Author: PHO <phonohawk AT ps DOT sakura DOT ne DOT jp>
-Maintainer: PHO <phonohawk AT ps DOT sakura DOT ne DOT jp>
+License-File: COPYING
+Author: PHO <phonohawk at ps dot sakura dot ne dot jp>
+Maintainer: PHO <phonohawk at ps dot sakura dot ne dot jp>
Stability: experimental
-Homepage: http://ccm.sherry.jp/hs-openssl/
+Homepage: http://ccm.sherry.jp/HsOpenSSL/
Category: Cryptography
Tested-With: GHC == 6.6.1
Build-Depends:
@@ -44,7 +45,7 @@ Exposed-Modules:
Extensions:
ForeignFunctionInterface
ghc-options:
- -fglasgow-exts -O2
+ -fglasgow-exts -O2 -fwarn-unused-imports
C-Sources:
cbits/HsOpenSSL.c
Include-Dirs:
@@ -53,9 +54,10 @@ Install-Includes:
HsOpenSSL.h
Extra-Source-Files:
HsOpenSSL.buildinfo.in
+ cbits/HsOpenSSL.h
configure
configure.ac
examples/Makefile
examples/GenRSAKey.hs
examples/HelloWorld.hs
- examples/PKCS7.hs
+ examples/PKCS7.hs
View
@@ -76,7 +76,6 @@ module OpenSSL.BIO
where
import Control.Monad
-import qualified Data.ByteString as B
import Data.ByteString.Base
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
@@ -261,7 +260,7 @@ bioReadLBS bio = lazyRead >>= return . LPS
lazyRead = unsafeInterleaveIO loop
loop = do bs <- bioReadBS bio chunkSize
- if B.null bs then
+ if B8.null bs then
do isEOF <- bioEOF bio
if isEOF then
return []
@@ -318,10 +317,10 @@ bioWriteBS bio bs
where
interpret :: Int -> IO ()
interpret n
- | n == B.length bs = return ()
- | n == -1 = bioWriteBS bio bs -- full retry
- | n < -1 = raiseOpenSSLError
- | otherwise = bioWriteBS bio (B.drop n bs) -- partial retry
+ | n == B8.length bs = return ()
+ | n == -1 = bioWriteBS bio bs -- full retry
+ | n < -1 = raiseOpenSSLError
+ | otherwise = bioWriteBS bio (B8.drop n bs) -- partial retry
-- |@'bioWriteLBS' bio lbs@ lazily writes entire @lbs@ to @bio@. The
-- string doesn't necessarily have to be finite.
@@ -459,7 +458,7 @@ newConstMemBS bs
-- LazyByteString.
newConstMemLBS :: LazyByteString -> IO BIO
newConstMemLBS (LPS bss)
- = (return . B.concat) bss >>= newConstMemBS
+ = (return . B8.concat) bss >>= newConstMemBS
{- null --------------------------------------------------------------------- -}
View
@@ -16,7 +16,6 @@ module OpenSSL.EVP.Base64
where
import Control.Exception
-import qualified Data.ByteString as B
import Data.ByteString.Base
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
@@ -27,13 +26,13 @@ import OpenSSL.Utils
-- エンコード時: 最低 3 バイト以上になるまで次のブロックを取り出し續け
--- る。返された[ByteString] は B.concat してから、その文字列長より小さ
+-- る。返された[ByteString] は B8.concat してから、その文字列長より小さ
-- な最大の 3 の倍數の位置で分割し、殘りは次のブロックの一部と見做す。
--
-- デコード時: 分割のアルゴリズムは同じだが最低バイト数が 4。
nextBlock :: Int -> ([ByteString], LazyByteString) -> ([ByteString], LazyByteString)
nextBlock _ (xs, LPS [] ) = (xs, LPS [])
-nextBlock minLen (xs, LPS src) = if foldl' (+) 0 (map B.length xs) >= minLen then
+nextBlock minLen (xs, LPS src) = if foldl' (+) 0 (map B8.length xs) >= minLen then
(xs, LPS src)
else
case src of
@@ -54,7 +53,7 @@ encodeBlock inBS
_EncodeBlock (unsafeCoercePtr outBuf) inBuf inLen
where
maxOutLen = (inputLen `div` 3 + 1) * 4 + 1 -- +1: '\0'
- inputLen = B.length inBS
+ inputLen = B8.length inBS
-- |@'encodeBase64' str@ lazilly encodes a stream of data to
@@ -75,14 +74,14 @@ encodeBase64LBS inLBS
| L8.null inLBS = L8.empty
| otherwise
= let (blockParts', remain' ) = nextBlock 3 ([], inLBS)
- block' = B.concat blockParts'
- blockLen' = B.length block'
+ block' = B8.concat blockParts'
+ blockLen' = B8.length block'
(block , leftover) = if blockLen' < 3 then
-- 最後の半端
- (block', B.empty)
+ (block', B8.empty)
else
- B.splitAt (blockLen' - blockLen' `mod` 3) block'
- remain = if B.null leftover then
+ B8.splitAt (blockLen' - blockLen' `mod` 3) block'
+ remain = if B8.null leftover then
remain'
else
case remain' of
@@ -101,10 +100,10 @@ foreign import ccall unsafe "EVP_DecodeBlock"
decodeBlock :: ByteString -> ByteString
decodeBlock inBS
- = assert (B.length inBS `mod` 4 == 0) $
+ = assert (B8.length inBS `mod` 4 == 0) $
unsafePerformIO $
unsafeUseAsCStringLen inBS $ \ (inBuf, inLen) ->
- createAndTrim (B.length inBS) $ \ outBuf ->
+ createAndTrim (B8.length inBS) $ \ outBuf ->
_DecodeBlock (unsafeCoercePtr outBuf) inBuf inLen
-- |@'decodeBase64' str@ lazilly decodes a stream of data from
@@ -124,11 +123,11 @@ decodeBase64LBS inLBS
| L8.null inLBS = L8.empty
| otherwise
= let (blockParts', remain' ) = nextBlock 4 ([], inLBS)
- block' = B.concat blockParts'
- blockLen' = B.length block'
+ block' = B8.concat blockParts'
+ blockLen' = B8.length block'
(block , leftover) = assert (blockLen' >= 4) $
- B.splitAt (blockLen' - blockLen' `mod` 4) block'
- remain = if B.null leftover then
+ B8.splitAt (blockLen' - blockLen' `mod` 4) block'
+ remain = if B8.null leftover then
remain'
else
case remain' of
View
@@ -33,7 +33,6 @@ module OpenSSL.EVP.Cipher
where
import Control.Monad
-import qualified Data.ByteString as B
import Data.ByteString.Base
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
@@ -207,7 +206,7 @@ cipherStrictly :: CipherCtx -> ByteString -> IO ByteString
cipherStrictly ctx input
= do output' <- cipherUpdateBS ctx input
output'' <- cipherFinalBS ctx
- return $ B.append output' output''
+ return $ B8.append output' output''
cipherLazily :: CipherCtx -> LazyByteString -> IO LazyByteString
View
@@ -11,7 +11,6 @@ module OpenSSL.EVP.Open
where
import Control.Monad
-import qualified Data.ByteString as B
import Data.ByteString.Base
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
View
@@ -25,7 +25,6 @@ module OpenSSL.EVP.PKey
where
import Foreign
-import Foreign.C
import OpenSSL.EVP.Digest
import OpenSSL.RSA
import OpenSSL.Utils
View
@@ -11,7 +11,6 @@ module OpenSSL.EVP.Seal
where
import Control.Monad
-import qualified Data.ByteString as B
import Data.ByteString.Base
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
View
@@ -12,7 +12,6 @@ module OpenSSL.EVP.Verify
where
import Control.Monad
-import Data.ByteString as B
import Data.ByteString.Base
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy.Char8 as L8
View
@@ -27,11 +27,6 @@ module OpenSSL.PKCS7
)
where
-import Data.Bits
-import qualified Data.ByteString as B
-import Data.ByteString.Base
-import qualified Data.ByteString.Char8 as B8
-import qualified Data.ByteString.Lazy.Char8 as L8
import Data.List
import Data.Traversable
import Data.Typeable
View
@@ -30,7 +30,6 @@ module OpenSSL.RSA
import Control.Monad
import Foreign
-import Foreign.C
import OpenSSL.BN
import OpenSSL.Utils
View
@@ -12,11 +12,10 @@ module OpenSSL.Stack
import Control.Exception
import Foreign
-import Foreign.C
import OpenSSL.Utils
-data STACK = STACK
+data STACK
foreign import ccall unsafe "sk_new_null"
View
@@ -12,7 +12,6 @@ module OpenSSL.Utils
where
import Foreign
-import Foreign.C
import GHC.Base
import OpenSSL.ERR
View
@@ -17,7 +17,6 @@ module OpenSSL.X509.Store
where
import Foreign
-import Foreign.C
import OpenSSL.X509
import OpenSSL.X509.Revocation
import OpenSSL.Utils

0 comments on commit 0e4cdc6

Please sign in to comment.